Jump to content
KyleK29

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

Recommended Posts

Kyle,

    Thank you for everything you do for the community, it is truly amazing and much appreciated. I have been using your hotkeys for a few weeks now and i am trying to make some adjustments....

My current setup is as follows, I use the "Double Click" my stop then i use the follow hotkey for a long

StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=25/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.05 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

The following for a short..

StopPrice=Price+0;DefShare=BP*0.925;Price=Price-Bid+0.00;SShare=25/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price=Bid-0.05;TIF=DAY+;SELL=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.05 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

 

These hotkeys works great ! I am now looking to implement a 2:1 range order upon my entry instead of a stop. Have you dabbled into a script like this ? 

Any help with this would be much appreciated ! Or maybe someone already has a script built. 

 

          Thank you for your help all.

Share this post


Link to post
Share on other sites

I am trying a script generated from the spreadsheet. It does enter the stop order but the stop price is 0. I tried David's script above and got the same result. Any idea what's going on?

Also, I have had a problem using stop orders in teh past that I can't exit my position using the "Sell All" button. Instead f selling all it enters a short (took me a while to figure that out!) Is there any way around that?

Finally, what I would like is a auto-size order hot key that would enter the stop order as above, but also a partial order at 1R. The problem with range orders is that you're all out at the top or bottom (unless I'm missing something). I find that my fast-moving ORB's sometimes hit my 1R cover point and return and it happens too fast form me to catch it manually, or enter a limit order in the montage.


---------------------------------------------------------------------------------------------------------------------------------------------------------------------
People that spend their time telling others what can't be done only annoy those of us out there doing it.

 

Share this post


Link to post
Share on other sites

Hey Skye,

 

   I have a hotkey that you can double click the chart, hit a hotkey and it will buy the correct shares and set a stop. I also have a separate hotkey where you can double click your stop and it will put a range order in for 2:1. If you’re interested in either of these let me know. My biggest project now is trying to figure out how to combine the 2 hotkeys into one. I would like to double click my chart at the stop, hit one hotkey and that will enter the position and put a 2:1 range order in. Let me know if any other this would help you out.  

 

    Thanks ! 

  • Like 3

Share this post


Link to post
Share on other sites

Hey Lads and Lasses, apologize for the delay in replying .. I was on a vacation and then took some time to get back into the groove of things. I did find where they make those beautiful postcards (jk) ...

1350044205_MVIMG_20190925_102918(Large).thumb.jpg.c0d6ec3a32f2bb9afe7baee6c5b529dc.jpg

^^^ Beautiful location ... the swim back to the boat was a tad much though.

1348880992_IMG_20190927_175945(Large).thumb.jpg.eb389ea4264903b21f2828eb5be29164.jpg

 

Anyways ...

 

On 9/10/2019 at 7:18 AM, Konstantin M said:

Hi Kyle, 

Yes that fix worked fine, now the updated stop shows as SM. 

I have another issue though with the below hotkey. It is the one to scale in 10$ risk. When I try to scale in I get filled twice.. screenshots attached. 


;CXL ALLSYMB;DefShare=BP*0.98;Price=StopPrice-Bid-0.02;SShare=10/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price=bid-0.03;TIF=DAY+; SELL=Send;DefShare=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

 

 

 

I missed this earlier. When you scale-in, are you using the scale-in version of the hotkeys or the original risk management version? You should use the scale-in versions if you aren't already.

 

On 9/21/2019 at 11:45 AM, Yann said:

 

Hey Kyle, is there any way to incorporate "SwitchTWnd;" in the script so that it automatically highlights the montage window when pushing the hotkey?  I just hate it when I miss an entry because my montage window wasnt selected.  I tried adding it to the front of the script like so:

SwitchTWnd;StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.05 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

But it gives an error when using the hotkey.  Maybe the "SwitchTWnd;" command needs to be inserted at a specific place in the script for it to work but I wouldn't know where exactly.  Any idea?

SwitchTWnd is for switching the Trade Window. You'd probably want FOCUSWINDOW. If you right click the titlebar of the Montage you want --> config and then give it a name .. you can then focus it. So the hotkey would be   FOCUSWINDOW MYWINDOWTITLE;    Just put that at the front of any hotkey you want. The double-click already does this though.

 

On 9/22/2019 at 8:29 PM, Shaun said:

Hi Kyle,

Just wanted to let you know that in both v2.0 and v2.1 (only versions I've tried) selecting SSR in the drop down box under the DOLLAR RISK section on the Hot Keys tab doesn't update the formula. Selecting SSR for all the other sections in the tab works fine, just the DOLLAR RISK section is not working properly.

Ok, thanks. I'll take a look at it.

 

On 10/8/2019 at 8:44 AM, TommyK667 said:

I am not sure what went wrong from the DEMO to Pro version of the app...and I don't understand how they have became negatives.

I have also tried using the spreadsheet script but shares also appear in negatives in the messages.

Any help would be much appreciated! Thank you.

I am using the training/simulator account on Pro with these.

 

Usually the negative values are caused by the BP function not getting the correct equity for the calculation. If I had to guess, your Montage was set to the IBCO account that isn't funded yet (your LIVE account, which has $0 buying power). It begins with "U". Swap the Montage to the account that begins with "TR" and give it another try ... let me know if that fixes it for you.

 

22 hours ago, David Furlano said:

These hotkeys works great ! I am now looking to implement a 2:1 range order upon my entry instead of a stop. Have you dabbled into a script like this ? 

Any help with this would be much appreciated ! Or maybe someone already has a script built. 

 

You'd likely have to do it with two different hotkeys and the Spreadsheet has a few examples of Range Orders with a 2:1.  The *ideal* way would be to modify the TriggerOrder, but I just tested it and DAS doesn't like the math at all. DAS has a very simplistic mathing engine, so you can't do the proper sequence like you could if it allowed HighPrice=(AvgCost-StopPrice)*3+AvgCost .

4 hours ago, Skye said:

I am trying a script generated from the spreadsheet. It does enter the stop order but the stop price is 0. I tried David's script above and got the same result. Any idea what's going on?

Also, I have had a problem using stop orders in teh past that I can't exit my position using the "Sell All" button. Instead f selling all it enters a short (took me a while to figure that out!) Is there any way around that?

Finally, what I would like is a auto-size order hot key that would enter the stop order as above, but also a partial order at 1R. The problem with range orders is that you're all out at the top or bottom (unless I'm missing something). I find that my fast-moving ORB's sometimes hit my 1R cover point and return and it happens too fast form me to catch it manually, or enter a limit order in the montage.

If you're using the "StopType=Market" (as recommended), the Price will be 0. This is because DAS forces it to that value when you submit the order, the actual triggering price is stored in the "Type" column (e.g. "SM: 10.10"). It's also the reason the stop-order arrow doesn't show on the chart (because it's sitting at 0).

 

For the 2:1 partial. You'd be better off doing a second hotkey that sets a partial limit order. Like:
1) Double-click, hit normal "long" hotkey (for this example). It'll set the stop order when it's filled.
2) Hit second hotkey that sets the partial take-profit .. like (assuming 25% partial): 

SHARE=POS*0.25;SHARE=ROUND;ROUTE=LIMIT;PRICE=AVGCOST+AVGCOST-STOPPRICE;TIF=DAY+;Send=Reverse;

 

Edited by KyleK29

---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites

Thank you for your reply Kyle! It turns out when I installed the Pro version, all the BP in the TR account is reset to 0. I’ve sorted it out and it works fine now.

 

Share this post


Link to post
Share on other sites

Hi Kyle, quick question if you don't mind, where would I put my acct#, live or sim, in the scripts? I rather have 2 sets of hotkeys loaded separate for sim and live trading. 

 

Thanks!

BiG B

Share this post


Link to post
Share on other sites
On 10/10/2019 at 8:10 AM, KyleK29 said:

Hey Lads and Lasses, apologize for the delay in replying .. I was on a vacation and then took some time to get back into the groove of things. I did find where they make those beautiful postcards (jk) ...

1350044205_MVIMG_20190925_102918(Large).thumb.jpg.c0d6ec3a32f2bb9afe7baee6c5b529dc.jpg

^^^ Beautiful location ... the swim back to the boat was a tad much though.

1348880992_IMG_20190927_175945(Large).thumb.jpg.eb389ea4264903b21f2828eb5be29164.jpg

 

Anyways ...

 

I missed this earlier. When you scale-in, are you using the scale-in version of the hotkeys or the original risk management version? You should use the scale-in versions if you aren't already.

 

SwitchTWnd is for switching the Trade Window. You'd probably want FOCUSWINDOW. If you right click the titlebar of the Montage you want --> config and then give it a name .. you can then focus it. So the hotkey would be   FOCUSWINDOW MYWINDOWTITLE;    Just put that at the front of any hotkey you want. The double-click already does this though.

 

Ok, thanks. I'll take a look at it.

 

Usually the negative values are caused by the BP function not getting the correct equity for the calculation. If I had to guess, your Montage was set to the IBCO account that isn't funded yet (your LIVE account, which has $0 buying power). It begins with "U". Swap the Montage to the account that begins with "TR" and give it another try ... let me know if that fixes it for you.

 

 

You'd likely have to do it with two different hotkeys and the Spreadsheet has a few examples of Range Orders with a 2:1.  The *ideal* way would be to modify the TriggerOrder, but I just tested it and DAS doesn't like the math at all. DAS has a very simplistic mathing engine, so you can't do the proper sequence like you could if it allowed HighPrice=(AvgCost-StopPrice)*3+AvgCost .

If you're using the "StopType=Market" (as recommended), the Price will be 0. This is because DAS forces it to that value when you submit the order, the actual triggering price is stored in the "Type" column (e.g. "SM: 10.10"). It's also the reason the stop-order arrow doesn't show on the chart (because it's sitting at 0).

 

For the 2:1 partial. You'd be better off doing a second hotkey that sets a partial limit order. Like:
1) Double-click, hit normal "long" hotkey (for this example). It'll set the stop order when it's filled.
2) Hit second hotkey that sets the partial take-profit .. like (assuming 25% partial): 


SHARE=POS*0.25;SHARE=ROUND;ROUTE=LIMIT;PRICE=AVGCOST+AVGCOST-STOPPRICE;TIF=DAY+;Send=Reverse;

 

Hi There. for this script above, can you set is to work for covering as well on short. or what do i need to change for it to work this way? thanks for your time.

 

Share this post


Link to post
Share on other sites

I'm curious for those of us who has CMEG, what relevant hotkeys have been working for you and that you can recommend?   Thank you!

Edited by Ed

Share this post


Link to post
Share on other sites
On 10/10/2019 at 11:10 AM, KyleK29 said:
On 10/10/2019 at 7:13 AM, Skye said:

I am trying a script generated from the spreadsheet. It does enter the stop order but the stop price is 0. I tried David's script above and got the same result. Any idea what's going on?

Also, I have had a problem using stop orders in teh past that I can't exit my position using the "Sell All" button. Instead f selling all it enters a short (took me a while to figure that out!) Is there any way around that?

Finally, what I would like is a auto-size order hot key that would enter the stop order as above, but also a partial order at 1R. The problem with range orders is that you're all out at the top or bottom (unless I'm missing something). I find that my fast-moving ORB's sometimes hit my 1R cover point and return and it happens too fast form me to catch it manually, or enter a limit order in the montage.

If you're using the "StopType=Market" (as recommended), the Price will be 0. This is because DAS forces it to that value when you submit the order, the actual triggering price is stored in the "Type" column (e.g. "SM: 10.10"). It's also the reason the stop-order arrow doesn't show on the chart (because it's sitting at 0).

 

For the 2:1 partial. You'd be better off doing a second hotkey that sets a partial limit order. Like:
1) Double-click, hit normal "long" hotkey (for this example). It'll set the stop order when it's filled.
2) Hit second hotkey that sets the partial take-profit .. like (assuming 25% partial): 


SHARE=POS*0.25;SHARE=ROUND;ROUTE=LIMIT;PRICE=AVGCOST+AVGCOST-STOPPRICE;TIF=DAY+;Send=Reverse;

Thanks for your response Kyle. Back from vacation & trying this out.

Using this script to order with fixed $ risk & set stop and it appears to be working:

StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=12/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY;BUY=Send;DefShare=50;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY;

Then using this script to partial out 1/3 at 1R:

SHARE=POS*0.33;SHARE=ROUND;ROUTE=LIMIT;PRICE=AVGCOST+AVGCOST-STOPPRICE;TIF=DAY;Send=Reverse;

First, as I said above it enters the order as a short instead of a sale (because there is a stop in place, if I'm not mistaken) but the result appears to be the same so I don't need to be concerned with that?

Second, it seems to be defaulting to 100 shares instead of .33 of my position as would be indicated in the script. I have no idea why, 100 is not even the default in my montage.

Edited by Skye

---------------------------------------------------------------------------------------------------------------------------------------------------------------------
People that spend their time telling others what can't be done only annoy those of us out there doing it.

 

Share this post


Link to post
Share on other sites
On 10/10/2019 at 6:27 PM, David Furlano said:

Hey Skye,

 

   I have a hotkey that you can double click the chart, hit a hotkey and it will buy the correct shares and set a stop. I also have a separate hotkey where you can double click your stop and it will put a range order in for 2:1. If you’re interested in either of these let me know. My biggest project now is trying to figure out how to combine the 2 hotkeys into one. I would like to double click my chart at the stop, hit one hotkey and that will enter the position and put a 2:1 range order in. Let me know if any other this would help you out.  

 

    Thanks ! 

Hi David, could you share your hotkey script please for a 2:1 range order.

 

thanks and  much appreciated

 

Anthony

  • Like 1

Share this post


Link to post
Share on other sites

I think this can be helpful for those who may need to leave their station and can't monitor the trade if it is a longer hold. But as traders we really need to be interactive to progress. Stopping out can be tough but scaling out at the proper r/r levels should be easier and something we all need to master and be interactive on. Kyle's stop out script prevents us from blowing up accounts and he has accomplished that. Too much auto pilot can be a handicap. But I definitely am in favor of trying this out and having the option for different types of trades or taking multiple trades at once!! 

Share this post


Link to post
Share on other sites
Hey guys, 
 
Below is the script I use for 2:1 range orders on both long and short positions. Sorry for the delayed response. I have been away for a few weeks,
 
2:1 Range order on Long position
 
ROUTE=STOP;StopType=Range;LowPrice=Price;HighPrice=AvgCost-Price*2+AvgCost;Share=Pos;TIF=DAY+;SELL=Send
 
2:1 Range Order on Short Position
 
ROUTE=STOP;StopType=Range;HighPrice=Price;LowPrice=AvgCost*2-Price-Price;Share=Pos;TIF=DAY+;BUY=Send
  • Thanks 1

Share this post


Link to post
Share on other sites
6 hours ago, Brendon said:

I think this can be helpful for those who may need to leave their station and can't monitor the trade if it is a longer hold. But as traders we really need to be interactive to progress. Stopping out can be tough but scaling out at the proper r/r levels should be easier and something we all need to master and be interactive on. Kyle's stop out script prevents us from blowing up accounts and he has accomplished that. Too much auto pilot can be a handicap. But I definitely am in favor of trying this out and having the option for different types of trades or taking multiple trades at once!! 

Have you seen the config options for drawing RR using Fibonacci lines on your chart to help with scale outs and stop losses?

20191113_174831.png.275ac29276bf560da04b8a51d3d68ad8.png

Share this post


Link to post
Share on other sites

Hey Kyle, This might be difficult to do and kind of dangerous to rely upon but do you think it would be possible to implement having it only execute and round to the nearest and smallest board lot (100shares) so you don't execute in odd lots? Obviously and shares <100 (mixed) would have to be executed as 100. 
 

I don't believe it would be possible given what I know of DAS' hotkeys but I thought it would be worth a shot. Would help save on fees. Thx. 

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.