I was wondering if there is a way for the stop and target share size get updated if I take a partial before my RR target is reached? Let's say I bought initially 100 shares and took 25 off at a partial, I would like my stop and target orders to be updated to 75 as the share size.
Hey Peter. I have a question. When using the hotkey to enter a position with determined $ risk and OCO, is there a way to set up future orders to keep on adding into the position and the risk stays the same $? For example I entered the position and I want to risk $20 then I want a future order for if the price is as X it adds into the position for another $20 to the original risk. I’ve been searching for a hotkey like this! Looking forward to your answer!
what you described is a either 1. price alert that executes the hotkey to add. the only thing to solve is where you want to put your stop after the add, or 2. the what i call future entry hotkey. you are contradicting the risk in your questions. first time you mentioned you want it the same, while second time you want to add another $20 to the tisk. That is quite a difference.
Yeah maybe I didn’t explain my self correctly. Let’s say I enter the stock long at 4 I want my stop with an OCO order at 2 and 6 but if the price drops to 3 and/or climbs to 5 it adds into the position. Each add for $20 each so if all 3 adds happen the amount won/lost is $60
Is there a way to know in a script if you are currently in a long or short position? I've checked the documentation but I can't find anything.
The Pos variable is always positive, so i can't use that.
I need this info because I want to implement checks in the hotkeys.
It already happened to me that while I am in two different trades with two different montages opened, one long and one short, I click the wrong buy or sell key.
So I'd like to add a check: if the script is dedicated to a short, then it must run only when i'm in a short position, and vice versa for a long.
To do this I just want to add something like if (short) and if (long) at the start of the script.
The problem is that I don't know how to read from the script if i am in a long or short position
Thank you really for your quick answers. Where do you find this information? I tried to search the getposition on the documentation and can't find anything.
Also, another thing. I assume that $MYSYMB is the ticker. Is there a way to get this information automatically? I just want to select the ticker already selected in the montage. Possibly without having to name the montage window, because the same script needs to work on two different montages.
I'd usually try to do it alone, but detailed info on Das scripts is almost non existent, even the official guide is hardly useful at all. I'm really glad to have found this website
and regarding finding the info it is hard work of trial and error and communication with das support that is failing to provide usable documentation for years
Hello Peter. I have a problem with the script to take partials and move the stop loss to BE. The partial gets taken correctly, but for the stop loss the montage window tells me " Error: invalid shares". I really can't get it to work, and it's the same both live and in replay mode. Can you help me. Thanks. I don't know what i'm doing wrong, the montage is already in stop order style
Hello Peter, thank you for your answer. The script was fine and there was no error. I found that these scripts that work well live, fail in replay mode.
For example in replay mode, if I have 100 shares and sell 10% while placing a new stop loss at break even, the stop loss is set for 100 shares instead of 90. Trading live instead it set the stop loss to 90.
It seems that in replay mode it does not update some variables like the position size inside the same script
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
Thank you so much for replying, I managed to get it to work. It was placing a stop order where I expected and I could actually drag it but it never gets triggered and I guess that's because I'm testing it during extended hours?
yes the traditional stops work only during market hours. if you need premarket working stops there are different solutions with more advanced scripting syntax
ah right, I think that's one of the ones from your more recent posts. It's a shame das doesn't support this out the box and we have to resort to scripts :)
Peter have I understood this post part 2 and part 8 correctly in that for part 8 to work I still have to enter my positions via the script on this part 2 first?
Also I get the error that many others get where by there is an error on line 7.
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?
Hi.
I work with das trader pro /ibkr and I have several dificulties to put a hot key for a stop loss order 10cent below my entry price.
Please can you help me?
Thanks
David
if you open the hotkeys window your exact hotkey is somewhere at the top
otherwise be more specific what are those difficulties please
Sorry.
I Have some hotkeys however I want to create one hotkey that allows me to sell immediatly 10 cent below the entry price.
that is no new information
I believe you are not understanding me . Is not possible to you to help me?
i am trying, what do you need to help with? the hotkey you asked for is by default in every das trader pro installation so what is your actual need?
Sorry but I Haven´t. I ´m using ross cameron hotkeys and I havn´t those hotkeys by default. Can you send me please?
thanks
david
Hi Peter,
I was wondering if there is a way for the stop and target share size get updated if I take a partial before my RR target is reached? Let's say I bought initially 100 shares and took 25 off at a partial, I would like my stop and target orders to be updated to 75 as the share size.
Thank you so much,
Emanuel
that can be done in several ways depending on the best solution for your case you can do that
1. with an alert which does not care about the shares and willl exit everything you got
2. with a dedicated rebuild oco order script
3. add the logic to your partial hotkey to place a new oco order
4. update the existing oco order position manually
5. update the existing oco order with a hotkey (in certain situations it cann be done)
Hey Peter. I have a question. When using the hotkey to enter a position with determined $ risk and OCO, is there a way to set up future orders to keep on adding into the position and the risk stays the same $? For example I entered the position and I want to risk $20 then I want a future order for if the price is as X it adds into the position for another $20 to the original risk. I’ve been searching for a hotkey like this! Looking forward to your answer!
what you described is a either 1. price alert that executes the hotkey to add. the only thing to solve is where you want to put your stop after the add, or 2. the what i call future entry hotkey. you are contradicting the risk in your questions. first time you mentioned you want it the same, while second time you want to add another $20 to the tisk. That is quite a difference.
Yeah maybe I didn’t explain my self correctly. Let’s say I enter the stock long at 4 I want my stop with an OCO order at 2 and 6 but if the price drops to 3 and/or climbs to 5 it adds into the position. Each add for $20 each so if all 3 adds happen the amount won/lost is $60
🙂 lets make it clear. if you add $20 risk at 3 with stop at 2 then at 5, after it reaches 6 you are at +$86.66
anyway it is possible to add as you described
thank you Peter. how can use the above hotkeys for long or short with limiting the buying power to 25% for example?
or like this
https://open.substack.com/pub/traderpeter/p/das-advanced-hotkeys-part-4?r=1wujo4&utm_campaign=post&utm_medium=web&showWelcomeOnShare=false
with a BP check function https://open.substack.com/pub/traderpeter/p/das-trader-pro-advanced-hotkeys-part-a22?r=1wujo4&utm_campaign=post&utm_medium=web&showWelcomeOnShare=false
Hello Peter, I have a question.
Is there a way to know in a script if you are currently in a long or short position? I've checked the documentation but I can't find anything.
The Pos variable is always positive, so i can't use that.
I need this info because I want to implement checks in the hotkeys.
It already happened to me that while I am in two different trades with two different montages opened, one long and one short, I click the wrong buy or sell key.
So I'd like to add a check: if the script is dedicated to a short, then it must run only when i'm in a short position, and vice versa for a long.
To do this I just want to add something like if (short) and if (long) at the start of the script.
The problem is that I don't know how to read from the script if i am in a long or short position
yes you can read it with the getposition() function like this
$MYPOS=GetAccountObj($MYACCOUNT).getposition($MYSYMB).share;
Thank you really for your quick answers. Where do you find this information? I tried to search the getposition on the documentation and can't find anything.
Also, another thing. I assume that $MYSYMB is the ticker. Is there a way to get this information automatically? I just want to select the ticker already selected in the montage. Possibly without having to name the montage window, because the same script needs to work on two different montages.
I'd usually try to do it alone, but detailed info on Das scripts is almost non existent, even the official guide is hardly useful at all. I'm really glad to have found this website
and regarding finding the info it is hard work of trial and error and communication with das support that is failing to provide usable documentation for years
yes just read the ticker from the montage object like $MYSYMB=$MONTAGE.SYMBOL or from the chart window object like $MYSYMB=$MY1MINWINDOW.SYMB
Is there a way to use percent of account for risk variable?
https://open.substack.com/pub/traderpeter/p/das-advanced-hotkeys-part-4?r=1wujo4&utm_medium=ios
Hello Peter. I have a problem with the script to take partials and move the stop loss to BE. The partial gets taken correctly, but for the stop loss the montage window tells me " Error: invalid shares". I really can't get it to work, and it's the same both live and in replay mode. Can you help me. Thanks. I don't know what i'm doing wrong, the montage is already in stop order style
that would mean a syntax error in the order after the partial or POS being 0
Hello Peter, thank you for your answer. The script was fine and there was no error. I found that these scripts that work well live, fail in replay mode.
For example in replay mode, if I have 100 shares and sell 10% while placing a new stop loss at break even, the stop loss is set for 100 shares instead of 90. Trading live instead it set the stop loss to 90.
It seems that in replay mode it does not update some variables like the position size inside the same script
the replay mode is a bad joke for scripting
Yeah. Unfortunately I didn't know that and I thought that every single script that I found online was wrong, as I was testing them in replay mode.
What can I do to adapt these to work with Schwab's OCO's/
you need to edit the route names for your entries
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
Thank you so much for replying, I managed to get it to work. It was placing a stop order where I expected and I could actually drag it but it never gets triggered and I guess that's because I'm testing it during extended hours?
yes the traditional stops work only during market hours. if you need premarket working stops there are different solutions with more advanced scripting syntax
ah right, I think that's one of the ones from your more recent posts. It's a shame das doesn't support this out the box and we have to resort to scripts :)
Peter have I understood this post part 2 and part 8 correctly in that for part 8 to work I still have to enter my positions via the script on this part 2 first?
Also I get the error that many others get where by there is an error on line 7.
yes you enter the usual way. i do not know about the error until you say exactly what you are doing and what error you get
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