Jump to content
KyleK29

DAS - Dynamically Calculate Shares on %Risk or $Risk - Hot Key + Configuration, Updated 9/10/19, v2.1

Recommended Posts

Hey guys just a quick question, I have the hot key script for equalized risk, I'm trying to apply it in my Sim account but my stop orders don't seem to be filling and I'm losing more then my determined risk amount. I corrected the STYLE in my montage to stop order, but again the stop orders don't seem to be getting filled, any suggestions ?

Edited by JdWil92

Share this post


Link to post
Share on other sites
19 minutes ago, JdWil92 said:

Hey guys just a quick question, I have the hot key script for equalized risk, I'm trying to apply it in my Sim account but my stop orders don't seem to be filling and I'm losing more then my determined risk amount. I corrected the STYLE in my montage to stop order, but again the stop orders don't seem to be getting filled, any suggestions ?

If you are in replay mode, then stop order is not going to work (unless newer version is available with update).  For me equalized risk script work with stop order during market hours.

Share this post


Link to post
Share on other sites

 

13 minutes ago, JdWil92 said:

Yes I am in replay mode. Okay thank you very much

Okay.

Newer version of DAS will support Trigger Orders as of Beta 5.6.4.15 in replay mode.

Edited by zulkafil

Share this post


Link to post
Share on other sites

is it possible to modify the code for the short to only set a stop order for the number of shares that it shorts? So it doesn't take your whole position? Usually I already have some orders in on a stock, and wants to add when it confirms, so I use the hotkey to short x number of shares. Problem is now that I already have range orders in for covers, and now also get a stop market order for the whole position, so if the stock goes against me fast, I suddenly cover to much such that I'm long the stock.

Ex: current position 100 shares. Using hotkey, it shorts 55 shares and place a stop order market order with 55 shares, and not 155 shares like it does today.

Share this post


Link to post
Share on other sites

I don't have any other hotkeys than this, so no problem. 

Question is, what do I replace the share=pos with?

What would be the best, is that it set out a range order for the number of shares I just shorted. I know its possible to set a limit order together with the stop market order, however its kind of risky as the stock often has a wick taking out my stop order, then it tanks to my cover and I'm suddenly long x number of shares. Benefit with range orders is that the limit order disappear when u get stopped out.

 

Edited by Asbjorn

Share this post


Link to post
Share on other sites

Hi thank you for the reply! 😊  I'v talked with DAS support now, seems like its only possible to either set % of POS or number of shares, and not the last shorted position. 

I went back a few pages, this script of you seems to do what I'm looking for anyway. Is there a way to spread these cover to 3 times, 4 times, 5 times and 6 times, the risk? Now its set to 3 times the risk for all of 4 of them:

 

CXL ALLSYMB;StopPrice=Price+0;DefShare=BP0.99;Price=Price-Bid+0.00;SShare=3/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price=Bid-0.1;TIF=DAY+;SELL=Send;DefShare=200;Price=StopPrice-Bid*3;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*0.25 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*0.25 TIF:DAY++;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*0.25 TIF:DAY++;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*0.25 TIF:DAY+

 

Share this post


Link to post
Share on other sites

Thank you, yes I'm aware 3/Price defines the target, but I'm unsure how to implement it into 4 range orders. Now with the script above it sends 4 range orders, (25% each of the posititon), all with 3R.

I want it for range order #1 (25%) to send a 3/R

range order #2 (25%) send a 4R and so on

 

Share this post


Link to post
Share on other sites

Thanks, I think it would work just having it like this. I usually short small side frontside, then when it seems to reject and found the top, I go short one more bullet (the script from this thread) then I cover partially, 4 covers below. I see I can just drag them lower, it was just for those times it drop so fast I don't have time to drag them, that I saw after a script to spread them, but I just do it manually for now.

Thanks for the headsup about marketstop 🙂

Edited by Asbjorn

Share this post


Link to post
Share on other sites
On 9/24/2021 at 3:48 AM, peterB said:

CXL ALLSYMB;StopPrice=Price-0;DefShare=BP0.99;Price=Ask-Price+0.00;SShare=3/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price=Ask+0.1;TIF=DAY+;BUY=Send;DefShare=200;Price=Ask-StopPrice*3+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS TIF:DAY+

this will open a 3 dollar risk LONG position with stop loss and 3R target OCO range order
it will work only if you have enabled click to trade and montage style STOP
you doubleclick on the chart where you want the stop to be and hit the hotkey/hotbutton once you want to enter
works for Interactive Brokers only

same for SHORT with 3R target


CXL ALLSYMB;StopPrice=Price+0;DefShare=BP0.99;Price=Price-Bid+0.00;SShare=3/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price=Bid-0.1;TIF=DAY+;SELL=Send;DefShare=200;Price=StopPrice-Bid*3;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS TIF:DAY+

 

hi PeterB, have scoured around but not sure how to change the above " 3 dollar risk LONG position with stop loss and 3R target OCO range order" to a stop limit order for entry instead of market, is it possible to include parameter to change?

this is the current one that i'm using but i would like to add a 1:1 TP for my trade.

based on $50 risk, and after double clicking on stop level i will enter the following stop limit order:

DefShare=BP*0.97;Price=Price-StopPrice;SShare=50/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare; SShare=Share;Share=Price*100; Price=StopPrice; DefShare=Price*100; Price=Share/100; Price=Price+StopPrice; StopPrice=Price; Share=SShare; TogSShare; Price=Price+.05;TIF=GTC;Route=Stop;StopType=Limit; Buy=Send; Share=DefShare;Price=Share/100; StopPrice=Price; DefShare=400;TriggerOrder=RT:STOP STOPTYPE:Market PX:StopPrice-0 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:GTC;
 

thank you for your help

Share this post


Link to post
Share on other sites

apologies, currently to use the formula  " 3 dollar risk LONG position with stop loss and 3R target OCO range order" first i would double click the SL level, then when i click the hotkey assigned to the formula, it will go long at the current market price.

what i would like to change it to would be the following:

1. double click for SL level (no change)

2. double click for entry level (Stop limit). Order will trigger upon reaching the level.

That's how i have been using the formula below, but i am unsure how to add 1:1  target to it, so i was thinking of modifying the formula that you provided to a Stop Limit order.

DefShare=BP*0.97;Price=Price-StopPrice;SShare=50/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare; SShare=Share;Share=Price*100; Price=StopPrice; DefShare=Price*100; Price=Share/100; Price=Price+StopPrice; StopPrice=Price; Share=SShare; TogSShare; Price=Price+.05;TIF=GTC;Route=Stop;StopType=Limit; Buy=Send; Share=DefShare;Price=Share/100; StopPrice=Price; DefShare=400;TriggerOrder=RT:STOP STOPTYPE:Market PX:StopPrice-0 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:GTC;

 

hope this is clearer

Share this post


Link to post
Share on other sites

thanks Peter! that's the 2 part script that i'm using, this is the second part that i have been referencing, just unsure of how to add in the 1:1 target part

 

DefShare=BP*0.97;Price=Price-StopPrice;SShare=50/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare; SShare=Share;Share=Price*100; Price=StopPrice; DefShare=Price*100; Price=Share/100; Price=Price+StopPrice; StopPrice=Price; Share=SShare; TogSShare; Price=Price+.05;TIF=GTC;Route=Stop;StopType=Limit; Buy=Send; Share=DefShare;Price=Share/100; StopPrice=Price; DefShare=400;TriggerOrder=RT:STOP STOPTYPE:Market PX:StopPrice-0 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:GTC;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.