Build Your Own Trading Dashboard
Topics covered:
• Using data from multiple charts simultaneously
• Creating custom dashboard displays with DAS objects
• Building reusable script components
• Displaying indicator values and calculated metrics
• Organizing information for fast decision making
• Updating dashboard values automatically with timer scripts
• Expanding the Daily 200 EMA concepts into larger projects
The script(s) featured in this episode are provided below for educational and reference purposes. Trading stocks, options, futures, and other financial instruments involves substantial risk of loss and is not suitable for all investors. You may lose some or all of your invested capital. Always review and thoroughly test any code in a simulator before using it in a live trading environment.
This video is provided by YouTube. It is blocked until you accept functional cookies.
Important!
Some of these scripts may also rely on scripts created in previous episodes. Any
updates to scripts will be shown below, but any scripts left unchanged would need to
be sourced from the episode they were featured in. It is recommended to watch all
videos in this series in order, that way you can piece together a working system
with a good understanding of all the connected parts.
INIT
This script is from a previous episode. Changes have been marked in the file so you can follow what was adjusted in this episode.
//INIT
$chart_1m = GetWindowObj("chart1m");
$chart_daily = GetWindowObj("chartd");
//+ ADDED THE FOLLOWING LINES
$montage_window = GetWindowObj("montage_window");
ExecHotkey("OBJECT_INIT_TRADE");
$ACCOUNT_NUMBER = "YOUR_ACCOUNT_NUMBER_HERE";
TIMER
This script is from a previous episode. Changes have been marked in the file so you can follow what was adjusted in this episode.
//TIMER
if ($TRADE.TIME_ON_TICKER > 2 && $TRADE.DAILYEMA200 == 0){
//EMA200 comes from daily chart
ExecHotkey("EMA200");
}
//+ ADDED THE FOLLOWING LINES
$bar0 = $chart_1m.GetBar(0);
ExecHotkey("ANALYZE_MACD");
ExecHotkey("DASHBOARD");
DASHBOARD (NEW) (This script was introduced in this episode)
//DASHBOARD
$DASHBOARD = GetWindowObj("DASHBOARD");
$TRADE.EMA20 = $chart_1m.getStudyVal("EMA20");
$TRADE.EMA50 = $chart_1m.getStudyVal("EMA50");
$TRADE.VWAP = $chart_1m.getStudyVal("VWAP");
$ACCOUNT=GetAccountObj($ACCOUNT_NUMBER);
//EMA200
if (IsObj($DASHBOARD.getCustButObj("EMA200"))){
if ($bar0.Close < ($TRADE.DAILYEMA200 - 0.50)){
$DASHBOARD.getCustButObj("EMA200").BkColor = Color("Green");
} else if ($bar0.Close > ($TRADE.DAILYEMA200 - 0.25) && $bar0.Close < ($TRADE.DAILYEMA200 + 0.01)){
$DASHBOARD.getCustButObj("EMA200").BkColor = Color("Red");
} else if ($bar0.Close < $TRADE.DAILYEMA200){
$DASHBOARD.getCustButObj("EMA200").BkColor = Color("Yellow");
} else {
$DASHBOARD.getCustButObj("EMA200").BkColor = Color("Green");
}
$DASHBOARD.getCustButObj("EMA200").Text = " " + Round($TRADE.DAILYEMA200,2);
}
//EMA20
if (IsObj($DASHBOARD.getCustButObj("EMA20"))){
if ($bar0.Close > $TRADE.EMA20){
$DASHBOARD.getCustButObj("EMA20").BkColor = Color("Green");
} else if ($bar0.Close == $TRADE.EMA20){
$DASHBOARD.getCustButObj("EMA20").BkColor = Color("Yellow");
} else {
$DASHBOARD.getCustButObj("EMA20").BkColor = Color("Red");
}
$DASHBOARD.getCustButObj("EMA20").Text = " " + Round($TRADE.EMA20,2);
}
//EMA50
if (IsObj($DASHBOARD.getCustButObj("EMA50"))){
if ($bar0.Close > $TRADE.EMA50){
$DASHBOARD.getCustButObj("EMA50").BkColor = Color("Green");
} else if ($bar0.Close == $TRADE.EMA50){
$DASHBOARD.getCustButObj("EMA50").BkColor = Color("Yellow");
} else {
$DASHBOARD.getCustButObj("EMA50").BkColor = Color("Red");
}
$DASHBOARD.getCustButObj("EMA50").Text = " " + Round($TRADE.EMA50,2);
}
//VWAP
if (IsObj($DASHBOARD.getCustButObj("VWAP"))){
if ($bar0.Close > $TRADE.VWAP){
$DASHBOARD.getCustButObj("VWAP").BkColor = Color("Green");
} else if ($bar0.Close == $TRADE.VWAP){
$DASHBOARD.getCustButObj("VWAP").BkColor = Color("Yellow");
} else {
$DASHBOARD.getCustButObj("VWAP").BkColor = Color("Red");
}
$DASHBOARD.getCustButObj("VWAP").Text = " " + Round($TRADE.VWAP,2);
}
//MACD
if (IsObj($ANALYZE_MACD)){
if (IsObj($DASHBOARD.getCustButObj("MACD"))){
if ($ANALYZE_MACD.LAST_MAC_OPEN){
//open
$DASHBOARD.getCustButObj("MACD").BkColor = Color("Green");
$DASHBOARD.getCustButObj("MACD").Text = " OPEN";
} else {
//closed
$DASHBOARD.getCustButObj("MACD").BkColor = Color("Red");
$DASHBOARD.getCustButObj("MACD").Text = " CLOSED";
}
}
}
//POSITION
if (IsObj($montage_window)){
//check to see if in a LONG position
if ($montage_window.POS > 0){
if (IsObj($DASHBOARD.getCustButObj("POSITION"))){
$DASHBOARD.getCustButObj("POSITION").BkColor = Color("Green");
$DASHBOARD.getCustButObj("POSITION").Text = " " + $montage_window.POS;
}
$TRADE.PL_SHARE = $montage_window.BID - $montage_window.AVGCost;
if (IsObj($DASHBOARD.getCustButObj("PL_SHARE"))){
if ($TRADE.PL_SHARE > 0){
$DASHBOARD.getCustButObj("PL_SHARE").BkColor = Color("Green");
$DASHBOARD.getCustButObj("PL_SHARE").Text = " " + $TRADE.PL_SHARE;
} else {
$DASHBOARD.getCustButObj("PL_SHARE").BkColor = Color("Red");
$DASHBOARD.getCustButObj("PL_SHARE").Text = " " + $TRADE.PL_SHARE;
}
}
} else {
if (IsObj($DASHBOARD.getCustButObj("POSITION"))){
$DASHBOARD.getCustButObj("POSITION").BkColor = Color("Gray");
$DASHBOARD.getCustButObj("POSITION").Text = " - ";
}
if (IsObj($DASHBOARD.getCustButObj("PL_SHARE"))){
$DASHBOARD.getCustButObj("PL_SHARE").BkColor = Color("Gray");
$DASHBOARD.getCustButObj("PL_SHARE").Text = " - ";
}
}
}
//ACCOUNT INFO
if (IsObj($DASHBOARD.getCustButObj("REALIZED"))){
if (IsObj($ACCOUNT)){
if ($ACCOUNT.Realized >= 0){
$DASHBOARD.getCustButObj("REALIZED").BkColor = Color("Green");
$DASHBOARD.getCustButObj("REALIZED").Text = " " + $ACCOUNT.Realized;
} else {
$DASHBOARD.getCustButObj("REALIZED").BkColor = Color("Red");
$DASHBOARD.getCustButObj("REALIZED").Text = " " + $ACCOUNT.Realized;
}
}
}
if (IsObj($DASHBOARD.getCustButObj("UNREALIZED"))){
if (IsObj($ACCOUNT)){
if ($ACCOUNT.UnRealized >= 0){
$DASHBOARD.getCustButObj("UNREALIZED").BkColor = Color("Green");
$DASHBOARD.getCustButObj("UNREALIZED").Text = " " + $ACCOUNT.UnRealized;
} else {
$DASHBOARD.getCustButObj("UNREALIZED").BkColor = Color("Red");
$DASHBOARD.getCustButObj("UNREALIZED").Text = " " + $ACCOUNT.UnRealized;
}
}
}
BUTTON_SHARES (NEW) (This script was introduced in this episode)
//BUTTON_SHARES
if (IsObj($DASHBOARD.getCustButObj("SHARES"))){
$DASHBOARD.getCustButObj("SHARES").Text = Round(Abs(Input("Allowed Shares", $DASHBOARD.getCustButObj("SHARES").Text)),0);
}
BUY_ASK (NEW) (This script was introduced in this episode)
//BUY_ASK
$shares_to_buy = Round($DASHBOARD.getCustButObj("SHARES").Text,0);
$montage_window.Route="Limit";
$montage_window.Share=$shares_to_buy;
$montage_window.Price=$montage_window.ASK;
$montage_window.ACCOUNT=$ACCOUNT_NUMBER;
$montage_window.TIF=DAY+;
$montage_window.BUY=SEND;
SELL_BID (NEW) (This script was introduced in this episode)
//SELL_BID
if ($montage_window.POS > 0){
$shares_to_sell = Round($montage_window.POS, 2);
$montage_window.Route="Limit";
$montage_window.Share=$shares_to_sell;
$montage_window.Price=$montage_window.BID;
$montage_window.ACCOUNT=$ACCOUNT_NUMBER;
$montage_window.TIF=DAY+;
$montage_window.SELL=SEND;
}
SELL_BID_HALF (NEW) (This script was introduced in this episode)
//SELL_BID_HALF
if ($montage_window.POS > 0){
$shares_to_sell = Round(($montage_window.POS / 2), 2);
$montage_window.Route="Limit";
$montage_window.Share=$shares_to_sell;
$montage_window.Price=$montage_window.BID;
$montage_window.ACCOUNT=$ACCOUNT_NUMBER;
$montage_window.TIF=DAY+;
$montage_window.SELL=SEND;
}
ANALYZE_MACD (NEW) (This script was introduced in this episode)
//ANALYZE_MACD
if (GetVar("$ANALYZE_MACD")==0) $ANALYZE_MACD=0;
if (IsObj($ANALYZE_MACD)){
//Histogram must be turned off for this logic to work as extra data in string not handled
$ANALYZE_MACD.STUDY = $chart_1m.getStudyVal("StudyMACD", "ByBarNum", 0);
$ANALYZE_MACD.VAL = SubString($ANALYZE_MACD.STUDY, (StrFind($ANALYZE_MACD.STUDY, ":") + 1), StrFind($ANALYZE_MACD.STUDY, ",") );
$ANALYZE_MACD.SIG = SubString($ANALYZE_MACD.STUDY, (StrFind($ANALYZE_MACD.STUDY, ",") + 9), (StrLen($ANALYZE_MACD.STUDY) - 1) );
$ANALYZE_MACD.VAL = Avg($ANALYZE_MACD.VAL);//convert float
$ANALYZE_MACD.SIG = Avg($ANALYZE_MACD.SIG);//convert float
if ($ANALYZE_MACD.VAL > $ANALYZE_MACD.SIG ){
$ANALYZE_MACD.LAST_MAC_OPEN = 1;
} else {
$ANALYZE_MACD.LAST_MAC_OPEN = 2;
}
} else {
$ANALYZE_MACD = newUserObj();
$ANALYZE_MACD.LAST_MAC_OPEN = 2;
}
Disclaimer:
This is an independent project and is not affiliated with or endorsed by DASTrader.com.
The tool is currently under development and intended for educational and experimental purposes only,
including improving the experience of working with DAS hotkey scripting (e.g., code validation,
highlighting, and structure).
It does not execute trades, provide trading signals, or offer financial advice. Any scripts created or used
with DAS Trader remain the sole responsibility of the user.
Trading involves significant risk. You are fully responsible for verifying all scripts, commands, and
behavior before using them in a live trading environment.
This tool is provided “as-is” with no guarantees of accuracy, completeness, or reliability. Use at your own
risk. Always test thoroughly in a simulator before live trading.