Imagine being able to handle trade entries without worrying about whether you’re going long or short, trading during regular hours or extended sessions, or even the exact price of the stock. All you do is define your risk and hit the entry hotkey. For brokers like Guardian Trading, who support the LimitP stop route, that’s exactly what my single-hotkey solution delivers, and that is the reason why I call the hotkey universal.
What this hotkey does
Despite being just one hotkey, there is plenty of actions going on. It
- Opens a long or short position depending on where you click, using that point as the stop level
- Automatically rounds prices for stocks trading under $1
- Identifies whether the market is in regular or extended hours and applies the appropriate stop order type
- Calculates position size so that risk remains consistent on every trade
Why use it?
Everything is handled with a single button or hotkey. You simply click to define the stop and press the same key every time. This creates a repeatable workflow and greatly reduces the chance of errors.
The hotkey
It requires advanced hotkeys enabled, so make sure to read the previous article on how to prepare your DAS Trader Pro first.
$Risk=20;
$Montage.CXL ALLSYMB;
$mystop=$Montage.Price;
// Rounding of stop
if($mystop<1)
{
$mystop=Round($mystop,4);
}
else
{
$mystop=Round($mystop,2);
}
// Determine long or short
if($mystop<$Montage.LAST)
{
$EntryPrice=Round($Montage.Ask,2);
$Offset=$mystop*0.98;
}
else
{
$EntryPrice=Round($Montage.Bid,2);
$Offset=$mystop*1.02;
}
// Rounding of Offset Price
if($Offset<1)
{
$Offset=Round($Offset,4);
}
else
{
$Offset=Round($Offset,2);
}
// Rounding of entry Price
if($EntryPrice<1)
{
$EntryPrice=Round($EntryPrice,4);
}
else
{
$EntryPrice=Round($EntryPrice,2);
}
// Calculate shares and fill in the montage
$Pricetostop=ABS($EntryPrice-$mystop);
$Amount=$risk/$Pricetostop;
$Montage.share=$Amount;
$Montage.ROUTE="LIMIT";
$Montage.TIF="DAY+";
$Montage.Price=$EntryPrice;
// Use LimitP stop in 4:00 AM - 9:30 AM and 4:00 PM-8:00 PM
$STOPTYPE="LimitP";
if(getsecond()>34200)
{
if(getsecond()<57600)
{
// Standard stop type during normal hours. Change as necessary
$STOPTYPE="MARKET";
}
}
// Finally, place the order
if($mystop<$Montage.LAST)
{
$Montage.Buy;
$Montage.TriggerOrder=RT:STOP STOPTYPE:$STOPTYPE PX:$Offset ACT:SELL STOPPrice:$mystop QTY:Pos TIF:DAY+;
}
else
{
$Montage.Sell;
$Montage.TriggerOrder=RT:STOP STOPTYPE:$STOPTYPE PX:$Offset ACT:BUY STOPPrice:$mystop QTY:Pos TIF:DAY+;
}
Limitations
The hotkey does not submit a target OCO order because LimitP does not support this functionality. It could be modified to place a target during regular trading hours, but a more consistent solution for both regular and extended sessions would be preferable. One such approach would be using a price alert as the profit-taking action. I’ll go into more detail on that technique in a future article.
