搜索
产品
社区
市场
新闻
经纪商
更多
CN
开始
社区
/
脚本
/
Dashboard Ais
OPEN-SOURCE SCRIPT
Dashboard Ais
由dekorumah24提供
关注
关注
20小时前
2
添加到收藏
添加到收藏
20小时前
//
version
=5
indicator("Custom Trading Dashboard", overlay=true)
/////////// DASHBOARD SETTINGS ///////////
bgColor = color.rgb(20, 30, 40, 90) // Background color of the dashboard
textColor = color.white // Text color
highlightColor = color.rgb(80, 150, 50, 90) // Highlight color
/////////// DATA SOURCES ///////////
symbol = syminfo.ticker
entryPrice = input.float(0.0, "Entry Price")
stopLoss = input.float(0.0, "Stop Loss Price")
takeProfit = input.float(0.0, "Take Profit Price")
riskRatio = na(entryPrice - stopLoss) or na(takeProfit - entryPrice) ? na : ((takeProfit - entryPrice) / (entryPrice - stopLoss))
/////////// HISTORY CALCULATIONS ///////////
tpToday = close > takeProfit ? 1 : 0
slToday = close < stopLoss ? 1 : 0
tpWeekly = close > takeProfit ? 1 : 0
slWeekly = close < stopLoss ? 1 : 0
/////////// DRAW DASHBOARD ///////////
// Declare table variable with 2 columns and 6 rows
var table dashboard = table.new(position.top_right, 2, 6, bgcolor=bgColor, border_width=1)
// Add content to the table
if bar_index == 0
// Header row
table.cell(dashboard, 0, 0, "Custom Dashboard", text_color=color.orange, text_size=size.large, bgcolor=highlightColor)
table.cell(dashboard, 0, 1, "", bgcolor=highlightColor)
// Symbol
table.cell(dashboard, 1, 0, "Symbol:", text_color=textColor)
table.cell(dashboard, 1, 1, symbol, text_color=textColor)
// Entry Price
table.cell(dashboard, 2, 0, "Entry Price:", text_color=textColor)
table.cell(dashboard, 2, 1, str.tostring(entryPrice), text_color=textColor)
// Risk Ratio
table.cell(dashboard, 3, 0, "Risk Ratio:", text_color=textColor)
table.cell(dashboard, 3, 1, na(riskRatio) ? "N/A" : str.tostring(riskRatio, "#.##"), text_color=textColor)
// History Header
table.cell(dashboard, 4, 0, "History (TP/SL)", text_color=textColor, bgcolor=highlightColor)
table.cell(dashboard, 4, 1, "", bgcolor=highlightColor)
// Today TP/SL
table.cell(dashboard, 5, 0, "Today:", text_color=textColor)
table.cell(dashboard, 5, 1, str.tostring(tpToday) + " / " + str.tostring(slToday), text_color=textColor)
// Weekly TP/SL
table.cell(dashboard, 6, 0, "Weekly:", text_color=textColor)
table.cell(dashboard, 6, 1, str.tostring(tpWeekly) + " / " + str.tostring(slWeekly), text_color=textColor)
Bands and Channels
educational
statistics
开源脚本
本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受
网站规则
约束。 您可以收藏它以在图表上使用。
想在图表上使用此脚本?
添加到收藏
dekorumah24
关注
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在
使用条款
阅读更多信息。