Peter’s Substack

Peter’s Substack

Share this post

Peter’s Substack
Peter’s Substack
DAS Trader Pro Advanced hotkeys part 40
Copy link
Facebook
Email
Notes
More
DASTrader Hotkeys

DAS Trader Pro Advanced hotkeys part 40

New hotkeys syntax for 2025

Peter Benci's avatar
Peter Benci
Apr 07, 2025
∙ Paid
4

Share this post

Peter’s Substack
Peter’s Substack
DAS Trader Pro Advanced hotkeys part 40
Copy link
Facebook
Email
Notes
More
29
Share

It has been a while since I posted the popular basic hotkeys in part 2 and this post should be a full replacement of that post, solving some of the problems the previous solutions carry with them.

DAS Trader pro has gone a long way since then, and I believe that the old syntax has become obsolete for use in 2025. The very old syntax for dynamic hotkeys using montage fields for calculations has been obsolete since the introduction of custom variables in version 5.7.6.8 in 2023.

You do not have to change it, but I encourage you to do so sooner or later, as it will allow you to use the new features.

Why the old syntax is obsolete

Simply, the old syntax is not compatible with the new features. The main difference is that now we can call hotkeys or click on hot buttons while the montage window is not in focus. That used to be a requirement before, and there was a helper function FocusWindow that could resolve problems like drawing lines to specific charts or creating alerts, but is not ideal.

The new functions allow us to treat the windows, buttons, trend lines or alerts as objects, so we can address the specific windows in the scripts, making the scripts universal to be called from any window, as a hotkey, or hot button attached to any window, which is the new function if you missed that see below

DAS Trader Pro Feature highlight

DAS Trader Pro Feature highlight

Peter Benci
·
October 24, 2024
Read full story

Requirements for the new syntax

Best practice is to name the windows we need to work with, so we can create the window objects by calling their names. Typically, this is a montage window (or every montage window if you use more than just one) and the chart windows.

Example of the newer and better syntax

The old syntax for static risk hotkey with automatic stop loss order attached.

CXL ALLSYMB;
$buyprice=Ask;
$risk=20;
$mystop=price;
$pricetostop=$buyprice-$mystop;
$amount=$risk/$pricetostop;
SShare=$amount;
Share=$amount;
TogSShare;
ROUTE="SMRTL";
Price=$buyprice*1.005;
Price=ROUND2;
TIF=DAY+;
BUY=Send;
TriggerOrder=RT:STOP STOPTYPE:MARKET PX:$mystop ACT:SELL STOPPRICE:$mystop QTY:Pos TIF:DAY+;

Rewritten into the newer syntax

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$buyprice=$MONTAGE.Ask;
$risk=20;
$mystop=$MONTAGE.price;
$pricetostop=$buyprice-$mystop;
$amount=$risk/$pricetostop;
$MONTAGE.share=$amount;
$MONTAGE.ROUTE="SMRTL";
$MONTAGE.Price=Round($buyprice*1.005,2);
$MONTAGE.TIF=DAY+;
$MONTAGE.Send;
$MONTAGE.TriggerOrder=RT:STOP STOPTYPE:MARKET PX:$mystop ACT:SELL STOPPRICE:$mystop QTY:Pos TIF:DAY+;

As you can see it is not much difference in text length but is more readable and most important it is universally working whenever it is called from.

Entry hotkeys

Static risk of $20 with automatic stop loss order attached

Long

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$buyprice=$MONTAGE.Ask;
$risk=20;
$mystop=$MONTAGE.price;
$pricetostop=$buyprice-$mystop;
$amount=$risk/$pricetostop;
$MONTAGE.share=$amount;
$MONTAGE.ROUTE="SMRTL";
$MONTAGE.Price=Round($buyprice*1.005,2);
$MONTAGE.TIF=DAY+;
$MONTAGE.Buy;
$MONTAGE.TriggerOrder=RT:STOP STOPTYPE:MARKET PX:$mystop ACT:SELL STOPPRICE:$mystop QTY:Pos TIF:DAY+;

Short

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$sellprice=$MONTAGE.bid;
$risk=20;
$mystop=$MONTAGE.price;
$pricetostop=$mystop-$sellprice;
$amount=$risk/$pricetostop;
$MONTAGE.share=$amount;
$MONTAGE.ROUTE="SMRTL";
$MONTAGE.Price=Round($sellprice*0.995,2);
$MONTAGE.TIF=DAY+;
$MONTAGE.Sell;
$MONTAGE.TriggerOrder=RT:STOP STOPTYPE:MARKET PX:$mystop ACT:BUY STOPPRICE:$mystop QTY:Pos TIF:DAY+;    

Static risk with $20 and attached range (OCO) orders of 3R target

Long

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$buyprice=$MONTAGE.Ask;
$risk=20;
$mystop=$MONTAGE.price;
$pricetostop=$buyprice-$mystop;
$target=3*$pricetostop+Ask;
$amount=$risk/$pricetostop;
$MONTAGE.Share=$amount;
$MONTAGE.ROUTE="SMRTL";
$MONTAGE.Price=Round($buyprice,2);
$MONTAGE.TIF=DAY+;
$MONTAGE.BUY;
$MONTAGE.TriggerOrder=RT:STOP STOPTYPE:RANGEMKT LowPrice:$mystop HighPrice:$target ACT:SELL QTY:POS TIF:DAY+;

Short

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$sellprice=$MONTAGE.Bid;
$risk=20;
$mystop=$MONTAGE.price;
$pricetostop=$mystop-$sellprice;
$target=Bid-$pricetostop-$pricetostop-$pricetostop;
$amount=$risk/$pricetostop;
$MONTAGE.Share=$amount;
$MONTAGE.ROUTE="SMRTL";
$MONTAGE.Price=Round($sellprice,2);
$MONTAGE.TIF=DAY+;
$MONTAGE.SELL;
$MONTAGE.TriggerOrder=RT:STOP STOPTYPE:RANGEMKT LowPrice:$target HighPrice:$mystop ACT:BUY QTY:POS TIF:DAY+;

Future/stop order entries with static risk of $20 and attached range (OCO) orders of 3R target

To set the desired stop, I use a MYSTOP variable to store the price. Double-click on the chart, then press/call the hotkey:

$MONTAGE=GetWindowObj("MONTAGE1");
$MYSTOP=$MONTAGE.Price;

To set the desired entry point of a LONG position, double-click on the chart and press the hotkey:

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$MYRISK=$MONTAGE.Price-$MYSTOP;
$MYTARGET=$MONTAGE.Price+$MYRISK+$MYRISK+$MYRISK;
$MYSHARES=20/$MYRISK;
$MONTAGE.Share=$MYSHARES;
$MONTAGE.StopPrice=Price;
$MONTAGETIF=DAY+;
$MONTAGE.Route="STOP";
$MONTAGE.StopType="Limit";
$MONTAGE.Price=Price+0.05;
$MONTAGE.Buy;
$MONTAGE.TriggerOrder=RT:STOP STOPTYPE:RANGEMKT LowPrice:$MYSTOP HighPrice:$MYTARGET ACT:SELL QTY:POS TIF:DAY+;

To set the desired entry point of a SHORT position, double-click on the chart and press the hotkey:

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$MYRISK=$MYSTOP-$MONTAGE.Price;
$MYTARGET=$MONTAGE.Price-$MYRISK-$MYRISK-$MYRISK;
$MYSHARES=20/$MYRISK;
$MONTAGE.Share=$MYSHARES;
$MONTAGE.StopPrice=Price;
$MONTAGE.TIF=DAY+;
$MONTAGE.Route="STOP";
$MONTAGE.StopType="Limit";
$MONTAGE.Price=Price-0.05;
$MONTAGE.Sell;
$MONTAGE.TriggerOrder=RT:STOP STOPTYPE:RANGEMKT LowPrice:$MYTARGET HighPrice:$MYSTOP ACT:BUY QTY:POS TIF:DAY+;

Exit hotkeys

Partially exit 50% of a position and set the stop loss to break-even

For a long position, press the hotkey:

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$MONTAGE.ROUTE="SMRTL";
$MONTAGE.Price=Round($MONTAGE.BID-0.05,2);
$MONTAGE.Share=$MONTAGE.Pos*0.50;
$MONTAGE.TIF=DAY;
$MONTAGE.SELL;
$MONTAGE.ROUTE="STOP";
$MONTAGE.StopType="Market";
$MONTAGE.StopPrice=$MONTAGE.AvgCost;
$MONTAGE.Share=$MONTAGE.Pos-$MONTAGE.share;
$MONTAGE.TIF=DAY+;
$MONTAGE.SELL;

For a short position, press the hotkey:

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$MONTAGE.ROUTE="SMRTL";
$MONTAGE.Price=Round($MONTAGE.ASK+0.05,2);
$MONTAGE.Share=$MONTAGE.Pos*0.50;
$MONTAGE.TIF=DAY+;
$MONTAGE.BUY;
$MONTAGE.ROUTE="STOP";
$MONTAGE.StopType="Market";
$MONTAGE.StopPrice=$MONTAGE.AvgCost;
$MONTAGE.Share=$MONTAGE.Pos-$MONTAGE.share;
$MONTAGE.TIF=DAY+;
$MONTAGE.BUY;

Exit the whole position now

To exit the whole long position, use the hotkey:

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$MONTAGE.Route="SMRTL";
$MONTAGE.Share=$MONTAGE.Pos;
$MONTAGE.Price=round($MONTAGE.Bid*0.997,2);
$MONTAGE.TIF=DAY;
$MONTAGE.SELL;

To exit the whole short position, use the hotkey:

$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$MONTAGE.Route="SMRTL";
$MONTAGE.Share=$MONTAGE.Pos;
$MONTAGE.Price=round($MONTAGE.Ask*1.003,2);
$MONTAGE.TIF=DAY+;
$MONTAGE.BUY;

Add-up hotkeys

Keep reading with a 7-day free trial

Subscribe to Peter’s Substack to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Peter Benci
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More