Hey Peter, I tried these keybinds but I can't see the drag stop loss on my chart. I've setup the chart based on part 1 and enabled advanced hotkeys. I use version 5.8.0.6 x64 with Cobra
Hi Peter, thanks for the hot keys. I use the same script to exit partials but I’m trying to figure something out. For example, after a long position has progressed into profit I’d manually move the stop up. The issue I’m having is that when I take partial profits using the script the stop moves back to the initial location (double clicked location on chart). Do you know how the script could be modified to keep the stop from moving? Thanks
that does not seem to be a script from me... neither it is advanced hotkeys syntax. anyway you need to keep track of your original stop in a variable since the moment you entered the trade (only with advanced hotkeys enabled), or define a new stop by clicking on the chart and execute the hotkey that sets your stopprice to PRICE and position to POS
The hotkey for a buy stop limit doesn't seem to work any longer. It sets a buy stop for the top limit price, but does not seem to trigger at the actual price you'd like to enter. So if I do a price of $1.00 - it crosses $1.00, but doesn't seem to trigger, so it doesn't do anything til the top of the limit at $1.05.
Using DAS 5.8.0.3 Any ideas to make it work with this version?
these are great, thank you. ive been trying to come up with a fixed risk hot key long/short but instead of using market to enter the order, been trying to do something like split the spread with a limit order. any idea?
sorry, should've been a little more clear. instead of buying the ask with a limit order im wanting to fill closer to the bid. i guess i could do something like this?
CXL ALLSYMB;
$buyprice=Bid+0.01; // Adjust to buy at the bid price plus 0.01
Another one I've been struggling with is the same kind of order (fill slightly above bid) but use a stop limit order to exit - mostly for premarket small cap crazy stocks
but when I try this script
CXL ALLSYMB;
$buyprice=Bid+0.01; // Adjust to buy at the bid price plus 0.01
I am indeed running version '5.8.0.5 x64' which I can't change because it's part of a training program, so I understand your hotkeys unfortunately don't work with this version?
Peter, I use the short with the oco 3r script. However, when I double-click and hit the hotkey, I don't see the short order entered, only the limit order. Do you know how to fix this?
When I run the below script using hot Button ($20 risk with 3x target ), I first double click on chart where I want the stop price and then click this Hot Button then I get the above error.
I have latest version of DAS 5.8.0.4 9 Nov 29th, 2024.
Hi Peter, is there a way to store and change a variable's value in just one place, so that you can include that variable in multiple hotkeys, but only have to change the value in the one place, instead of having to change the value in each individual hotkey?
hi EJ, sure there is a way. You can have a prompt for that if you need to change it often or use it as a switch between two values as i do in one of the later posts with the account switcher. Also you csn have it changed based on any calculated or measured indicator value.
love your work and just started following your blog for the scripts. Quick question: For the 'Static risk of $20 with automatic stop loss order,' how do I set up a fixed number of shares (like 100 shares) instead of having it automatically calculate the number of shares. Thanks.
Thanks for your reply, Peter. I did as you mentioned but the stop loss is not working. It is simply not stopping when the loss is over $20. Appreciate your suggestion.
yes that is quite easy to acomplish-one is to divide it to two orders. the disadvantage is that if you get stopped you pay double commissions. the other is by calling the partial hotkeys at the desired time which has the disadvantage of being complex and has its limitations but i can figure it out with the new timer scripts
I was testing the (Static risk with $20 and attached range (OCO) orders of 3R target) on DAS with a sim account. I have IBKR account by the way. It worked in buying the shares but didn't place any OCO orders for STOP or Take Profit at 3R. any idea why ?
Never mind. I was testing them yesterday in a Replay mode and it didn't work properly. Today I tested them when the market opened, and it worked flawlessly.
I need to tweak a little bit on the ($buyprice=Ask) to make me get filled faster.
Also, I tested a risk of $10 on AMZN, and the realized gain was $28.40, I was expecting it to hit exactly $30 as a 3R profit target.
Thank you very much for sharing. I am new here. I will test all those hotkeys in the Sim. How can I get your exact chart layout and parameters as shown in the videos? It is super clean and organized. Can you share it please?
Hey Peter, I tried these keybinds but I can't see the drag stop loss on my chart. I've setup the chart based on part 1 and enabled advanced hotkeys. I use version 5.8.0.6 x64 with Cobra
Helo,
probably this:
right click the chart -> chart area -> config area
check boxes for
-enable placing alert on chart
-show trades
-show orders
- enable order entry and order line movement
- hide order trype/qty
Is there a way to modify the fixed risk with oco target scripts to work with Das/Schwab?
anything specific? you probably need to change just the route
Hi Peter, thanks for the hot keys. I use the same script to exit partials but I’m trying to figure something out. For example, after a long position has progressed into profit I’d manually move the stop up. The issue I’m having is that when I take partial profits using the script the stop moves back to the initial location (double clicked location on chart). Do you know how the script could be modified to keep the stop from moving? Thanks
hi Jason, which script are we talking about?
50% Partial Exit (updates stop shares)
CXL ALLSYMB;Route=SMRTL;Share=Pos*0.50;Price=Ask-0.01;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=StopPrice;Share=Pos-share;TIF=DAY+;SELL=SEND
that does not seem to be a script from me... neither it is advanced hotkeys syntax. anyway you need to keep track of your original stop in a variable since the moment you entered the trade (only with advanced hotkeys enabled), or define a new stop by clicking on the chart and execute the hotkey that sets your stopprice to PRICE and position to POS
My apologies, sent the wrong script. I was referring to the script below to close partials.
CXL ALLSYMB;
ROUTE="SMRTL";
Price=BID-0.05;
Price=Round2;
Share=Pos*0.50;
TIF=DAY;
SELL=Send;
ROUTE="STOP";
StopType="Market";
StopPrice=AvgCost;
Share=Pos-share;
TIF=DAY+;
SELL=SEND;
that script sets the stop to average cost of your position not to original stop so i am confused
i you want the stop to remain where you set it, change the Stopprice=$Mystop; instead of StopPrice=AvgCost;
it expects that you entered with the hotkey i provided for the entry too which sets the variable $mystop to a clicked price on the chart.
The hotkey for a buy stop limit doesn't seem to work any longer. It sets a buy stop for the top limit price, but does not seem to trigger at the actual price you'd like to enter. So if I do a price of $1.00 - it crosses $1.00, but doesn't seem to trigger, so it doesn't do anything til the top of the limit at $1.05.
Using DAS 5.8.0.3 Any ideas to make it work with this version?
CXL ALLSYMB;
$MYRISK=Price-$MYSTOP;
$MYSHARES=20/$MYRISK;
Share=$MYSHARES;
TogSShare;
StopPrice=Price;
TIF=DAY+;
Route="STOP";
StopType="Limit";
Price=Price+0.05;
Buy=Send;
TriggerOrder=RT:STOP STOPTYPE:MARKET PX:$MYSTOP ACT:SELL STOPPRICE:$MYSTOP QTY:Pos TIF:DAY+;
Anyway, if you see the order placed then there is no issue your order just got skipped because of the lack of liquidity at the price you wanted
use 5.8.0.6 version
these are great, thank you. ive been trying to come up with a fixed risk hot key long/short but instead of using market to enter the order, been trying to do something like split the spread with a limit order. any idea?
hi Chris, these are limit orders entry hotkeys. What do you need to solve?
sorry, should've been a little more clear. instead of buying the ask with a limit order im wanting to fill closer to the bid. i guess i could do something like this?
CXL ALLSYMB;
$buyprice=Bid+0.01; // Adjust to buy at the bid price plus 0.01
$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+
Another one I've been struggling with is the same kind of order (fill slightly above bid) but use a stop limit order to exit - mostly for premarket small cap crazy stocks
but when I try this script
CXL ALLSYMB;
$buyprice=Bid+0.01; // Adjust to buy at the bid price plus 0.01
$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:LIMIT PX:$mystop ACT:SELL STOPPRICE:$mystop LIMITPRICE:($mystop-0.20) QTY:Pos TIF:DAY+
i get "invalid shares" as the error
you probably have not enabled advanced hotkeys in das trader pro settings or you are using version 5.8.0.5 which has a bug
I am indeed running version '5.8.0.5 x64' which I can't change because it's part of a training program, so I understand your hotkeys unfortunately don't work with this version?
Peter, I use the short with the oco 3r script. However, when I double-click and hit the hotkey, I don't see the short order entered, only the limit order. Do you know how to fix this?
hi Dan,
it will be placed only after your limit entry hotkey is fully filled as it uses the TRIGGER ORDER command which has this limit
I tested it on replay, I will try it on real-time tomorrow. Thank you very much
These are great!
Good day Peter,
When i use your Static risk of $20 with automatic stop loss order attached it pops up a message stating
"trigger order only work in montage window."
What should i do for this error?
Thanks
I get the following error.
Msg Box Script : Invalid operator
and this error in Montage Error:Invalid Shares!
When I run the below script using hot Button ($20 risk with 3x target ), I first double click on chart where I want the stop price and then click this Hot Button then I get the above error.
I have latest version of DAS 5.8.0.4 9 Nov 29th, 2024.
Please help.
CXL ALLSYMB;
$buyprice=Ask;
$risk=20;
$mystop=price;
$pricetostop=$buyprice-$mystop;
$target=3*$pricetostop+Ask;
$amount=$risk/$pricetostop;
SShare=$amount;
Share=$amount;
TogSShare;
ROUTE="SMRTL";
Price=$buyprice;
Price=ROUND2;
TIF=DAY+;
BUY=Send;
TriggerOrder=RT:STOP STOPTYPE:RANGEMKT LowPrice:$mystop HighPrice:$target ACT:SELL QTY:POS TIF:DAY+;
Forgot to mention that I am using Replay mode.
do not expect replay mode to work with advanced scripting as the data often does not exist
Hi Peter, is there a way to store and change a variable's value in just one place, so that you can include that variable in multiple hotkeys, but only have to change the value in the one place, instead of having to change the value in each individual hotkey?
hi EJ, sure there is a way. You can have a prompt for that if you need to change it often or use it as a switch between two values as i do in one of the later posts with the account switcher. Also you csn have it changed based on any calculated or measured indicator value.
love your work and just started following your blog for the scripts. Quick question: For the 'Static risk of $20 with automatic stop loss order,' how do I set up a fixed number of shares (like 100 shares) instead of having it automatically calculate the number of shares. Thanks.
you just place a static number at the shares part
Thanks for your reply, Peter. I did as you mentioned but the stop loss is not working. It is simply not stopping when the loss is over $20. Appreciate your suggestion.
how is it not working? has the order been placed or not?
Yes, order has been placed. I am using a simulator account. Do you want me to share a screenshot with you?
that would certainly help
https://postimg.cc/DW3Ppvvv
here is the script:
---------
CXL ALLSYMB;
$buyprice=Ask;
$risk=20;
$mystop=price;
$pricetostop=$buyprice-$mystop;
$amount=$risk/$pricetostop;
SShare=100;
Share=100;
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+
Hi Peter, For your entry hot keys, what is the reason or purpose for putting in the line SSHARE=$amount?
that was an old school habit to toggle show share. it is not necessary and you can omit that completely
Hi Peter, Love your scripts, good work, thank you.
I need to ask you if is it even possible,
Static risk with $20 and attached range (OCO) orders of 3R target - for this script,
can we have two different range orders at the end with 50% position out at 3R and rest of 50% at 4R? like two different targets?
yes that is quite easy to acomplish-one is to divide it to two orders. the disadvantage is that if you get stopped you pay double commissions. the other is by calling the partial hotkeys at the desired time which has the disadvantage of being complex and has its limitations but i can figure it out with the new timer scripts
Hi Peter,
I was testing the (Static risk with $20 and attached range (OCO) orders of 3R target) on DAS with a sim account. I have IBKR account by the way. It worked in buying the shares but didn't place any OCO orders for STOP or Take Profit at 3R. any idea why ?
hi, you probably missed some of the prerequisities or have a syntax error in the script
Advanced hotkey and double click to trade are both checked and Style is Stop. My other Kyle's hotkeys work fine.
I used the exact script in Replay Mode and selected the sim account on the montage. What should the route be?
Replay mode is very special. many things do not work there. always test in SIM not in Replay Mode
Never mind. I was testing them yesterday in a Replay mode and it didn't work properly. Today I tested them when the market opened, and it worked flawlessly.
I need to tweak a little bit on the ($buyprice=Ask) to make me get filled faster.
Also, I tested a risk of $10 on AMZN, and the realized gain was $28.40, I was expecting it to hit exactly $30 as a 3R profit target.
you can always get some slippage
-on calculation (spread)
-on entry
-on exit
-on commissions and fees
Hello Peter,
Is it possible to have a condition based on whether my position is a long or a short ?
If I currently hold a long : do this, but if it's a short : do that.
Thank you !
yes for example you can exit in a single button.hotkey like this
$MYPOS=GetAccountObj("TRIBT8888").getposition($MYSYMB).share;
if ($MYPOS==0)
{
MsgBox("No position to close");
}
else
{
CXL ALLSYMB;
ROUTE=SMRTL;
if ($MYPOS > 0)
{
Share=$MYPOS;
Price=Bid*0.99;
Price=ROUND2;
SELL=Send;
}
else
{
Share=$MYPOS;
Price=Ask*1.01;
Price=ROUND2;
BUY=Send;
}
}
Is it possible to not calling the account number ? So I can go easily from sim to real ?
you can create account number trigger into a variable then use that variable in the scripts
Great It works thank you.
Before that I was doing MYPOS=GetWindowObj("Montage").share;
but would only give me positive number whether it was long or short.
Now with your script it's fine ;)
Thank you very much for sharing. I am new here. I will test all those hotkeys in the Sim. How can I get your exact chart layout and parameters as shown in the videos? It is super clean and organized. Can you share it please?