Peter’s Substack

Peter’s Substack

DASTrader Hotkeys

DAS Trader Pro Advanced Hotkeys Part 57

A Real-time Reversal Scanner

Peter Benci's avatar
Peter Benci
Sep 04, 2025
∙ Paid
2
2
Share

Functionality description

Thanks to my fellow trader @AimanBBT who’s ideas were the reason and inspiration to make this thing working.

The solution in this post is very specific to my own needs but is adjustable to your needs if needed as the conditions on which you want to be alerted can be changed in one single code window. It does not mean it is simple to do if you have complex requirements, but it will surely show you some ways on how it can be achieved while most of the solution is universal for all/various needs.

  1. The scanner takes top XY symbols from the watch list, loads the symbols into dedicated (in my case 43) chart windows, where it monitors for the desired price action event.

  2. It also loads the symbols into a dedicated scanner window

  3. When the event occurs, it changes the color of the scanner button with the corresponding symbol.

  4. The scanner remembers if the event occurred until reset or reloaded.

  5. By clicking on the button with the symbol, the current montage symbol is changed to the montage symbol.

  6. There is a button to clear the color changes

  7. There is a button to reload the symbols from the new watch list

  8. There is a button to clean the symbol names from the buttons

  9. There is a button to go back to the last symbol used on the montage

  10. There is a button to reset the charts to no symbol

  11. The first load of the symbols to the scanner is automatic every day at specified time. (optional)

  12. The scanner works in real-time mode only.

I am controlling the trades manually so far but eventually will just call an entry hotkey together with the button color change effectively being a trading bot. I need to collect more data and fine tune the conditions for the alerts before I do it into a fully automated bot.

Here is a video of the functional scanner

Here is a video of the charts being changed in one click. The charts are running in a separate tab so they do not interfere with my trading charts

Conditions when the scanner takes actions

Both these conditions must be met

  1. price action is double the distance of ATR(14) on 1-minute chart from the 11EMA on 1-minute chart.

  2. the previous 3 5-minute candles have higher high close or lower low close

These are the conditions that can be customized to your needs, remembering DAS Trader Pro limits and syntax, of course.

Example trades taken from the scanner calls. The calls often give me a safe entry for a trade which i exit without a loss when it fails to continue in my direction.

break-even trade
break-even trade
5R winner
5R winner after a break-even trade

Challenges and workarounds

Please note that these are workarounds that probably could have had different solutions, but I chose these as a result of my limited knowledge and circumstances.

  • Limited number of charts

    The scanner can see only what it can load into the chart, thus is limited to the number of charts I can free up for its functionality. Theoretically it could work in every few seconds batches while loading different symbols to the charts every few seconds but for my needs the 40+ charts is enough.

  • bugs in DAS - as of today when writing this, we cannot retrieve window name with the getwindowobj() function therefore I am using variable window names by symbols not by chart window numbers, then use helper variables for the window names

  • 2000 characters limit in the chart window update script which is solved by calling hotkeys rather than writing the code to the chart.

  • I had to calculate the 5min candle close from the 1min candle hence the candle index retrieval and calculations. I did not find a better way to do it yet.

The windows

You will need a named watch list window (MYMKTVIEWER), named fundamental window (STRIP), the maximum number you can get of named chart windows (CHART1-CHART30).

The scripts

setvars
setvar($MASTUDYNAME+"_"+SYMB,getstudyval($MASTUDYNAME));
setvar($ATRSTUDYNAME+"_"+SYMB,getstudyval($ATRSTUDYNAME));
setvar("CUR_CDL_IDX_"+SYMB,getbar(0,"NumOfSeconds").time/60%5);
setvar($LSTPRICE+"_"+SYMB,getstudyval($LSTPRICE));
setvar("LSIZE_"+SYMB,ABS(getvar($LSTPRICE+"_"+SYMB)-getvar($MASTUDYNAME+"_"+SYMB)));
setvar("DOUBLEATR_"+SYMB,ABS(getvar($ATRSTUDYNAME+"_"+SYMB))*2);
setvar("TIME_"+SYMB,ROUND(GetBar(0,"NumOFSeconds").time,0));
setvar("CUR_CDL_IDX_"+SYMB,getbar(0,"NumOfSeconds").time/60%5);

this hotkey reads the studies on the charts and calculates new helper variables

5minpop
setvar("CUR_CDL_IDX_"+SYMB,getbar(0,"NumOfSeconds").time/60%5);
if(getvar("CUR_CDL_IDX_"+SYMB==0))
{
setvar("5CL1"+SYMB,getbar(-1).close);
setvar("5CL2"+SYMB,getbar(-6).close);
setvar("5CL3"+SYMB,getbar(-11).close);
}
if(getvar("CUR_CDL_IDX_"+SYMB)==1)
{
setvar("5CL1"+SYMB,getbar(-2).close);
setvar("5CL2"+SYMB,getbar(-7).close);
setvar("5CL3"+SYMB,getbar(-12).close);
}
if(getvar("CUR_CDL_IDX_"+SYMB)==2)
{
setvar("5CL1"+SYMB,getbar(-3).close);
setvar("5CL2"+SYMB,getbar(-8).close);
setvar("5CL3"+SYMB,getbar(-13).close);
}
if(getvar("CUR_CDL_IDX_"+SYMB)==3)
{
setvar("5CL1"+SYMB,getbar(-4).close);
setvar("5CL2"+SYMB,getbar(-9).close);
setvar("5CL3"+SYMB,getbar(-14).close);
}
if(getvar("CUR_CDL_IDX_"+SYMB)==4)
{
setvar("5CL1"+SYMB,getbar(-5).close);
setvar("5CL2"+SYMB,getbar(-10).close);
setvar("5CL3"+SYMB,getbar(-15).close);
}

this hotkey does the conditional variable population for virtual 5-min chart

5mintest
if(getvar("5CL1"+SYMB)>getvar("5CL2"+SYMB))
{
if(getvar("5CL2"+SYMB)>getvar("5CL3"+SYMB))
{
setvar("TRIO"+SYMB,1);
}
else
{
setvar("TRIO"+SYMB,0);}
}
if(getvar("5CL1"+SYMB)<getvar("5CL2"+SYMB))
{
if(getvar("5CL2"+SYMB)<getvar("5CL3"+SYMB))
{
setvar("TRIO"+SYMB,1);
}
else{setvar("TRIO"+SYMB,0);
}
}

this hotkey tests if the 5-minute chart conditions are met or not and saves the result in the symbol specific variable

paintbuttons
if (getvar("LSIZE_"+SYMB)>getvar("DOUBLEATR_"+SYMB))
{
if(getvar("TRIO"+symb)==1)
{
$BKCOLOR=$strip.GetCustButObj("b"+getvar("WINDOWNAME_"+SYMB)).bkcolor;
if ($BKCOLOR==255)
{
$strip.GetCustButObj("b"+getvar("WINDOWNAME_"+SYMB)).bkcolor="white";
}
else
{
$strip.GetCustButObj("b"+getvar("WINDOWNAME_"+SYMB)).bkcolor="red";
}
}
}

this hotkey paints the scanner buttons to red or white when the event happens

chart update script
$chartname=SYMBOL;
$MASTUDYNAME="MYEMA11";
$ATRSTUDYNAME="1minATR14";
$LSTPRICE="lprice";
if($TOD>$945AM)
{
exechotkey("SETVARS");
exechotkey("5MINPOP");
exechotkey("5MINTEST");
exechotkey("PAINTBUTTONS");
}

this scripts runs in every chart, it contains a time of the day condition which is optional

The X button code

this button resets the chart symbols to XXX so that no data is being updated. It is useful if things go wrong and you want to return to a state with clean charts.

$strip=getwindowobj("strip");
$row=1;
while($row<44)
{
$C=GetWindowObj("chart"+$row);
$c.symb="XXX";
$row=$row+1;
}

Edit the number 44 to the number of charts+1 you have. If you have 20 charts the number will be 21.

The green button

This button remembers the previously used symbol so it is easy to come back to it in case you clicked on a newly blinking button while watching a chart and want to go back.

$montage.symbol=$strip.GetCustButObj("b45").text;
The brown button

This button deletes the symbols from the scanner window while keeping them in the charts. It is useful to use it and see if the actual reload button works correctly.

$I=1;
while($I<44)
{
$strip.GetCustButObj("b"+$I).text="";
$I=$I+1;
}
The purple button

This button goes through the watch list and populates the scanner buttons as well as distributes the saved configuration from the chart template to all the charts.

$strip=getwindowobj("strip");
$row=1;
$a=GetWindowObj("MYMKTVIEWER");
while($row<125)
{
$a.selectedrow=$row;
setvar("WINDOWNAME_"+$a.selectedsymbol,43);
$row=$row+1;
}
$row=1;
$a=GetWindowObj("MYMKTVIEWER");
$b=GetWindowObj("MONTAGE1");
while($row<44)
{
$C=GetWindowObj("chart"+$row);
$a.selectedrow=$row;
$c.symb=$a.selectedsymbol;
$strip.GetCustButObj("b"+$row).text=$c.symb;
$c.loadsetting 40charts.cst;
setvar("WINDOWNAME_"+$c.symb,$ROW);
$row=$row+1;
}

the number 125 is the number of rows in the watch list. I am preparing the window name variables upfront with the loop.

The pink button code

This button clears out just the coloring of the buttons. It is useful if you returned to the screen after a while or have not been watching it and you want to see the latest thing popping up on the scanner only.

$I=1;
while($I<44)
{
$strip.GetCustButObj("b"+$I).bkcolor=13158600;
$I=$I+1;
}
Timer event script
$TOD=getsecond();
$MONTAGE=getwindowobj("montage1");
$STRIP=getwindowobj("strip");

this script is to measure the time of the day as I use this scanner only after 9:45 AM, the time of the day filtering limit can be skipped easily in the chart update script if needed.

If you have some das scripting experience you should be able to build it from the scripts provided above. For the rest, a step-by-step procedure with pictures follows. It still requires some basic orientation in DAS Trader Pro though.

Step-by-step procedure

Please make sure you want to go through the implementation and if it is the thing your need. It takes approximately 1 hour to implement if you are familiar with DAS Trader Pro. If you are the founding member subscriber I will do my best to help you to implement it. If you need help with making different conditions scanner of this type, send me a message and we can figure out something together.

This post is for subscribers in the Founding Member plan

Already in the Founding Member plan? Sign in
© 2025 Peter Benci
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture