Jump to content
KyleK29

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

Recommended Posts

I'm switching from my BBT 3 month DAS account to DAS PRO SIM account and am having some problems with my hotkeys. So far just the scaling out hotkeys which cancel my stop and replace it at B/E. Is there something that I need to change in the script1406297533_hotkeyissue1.png.069387382746fefdf2f6eb6b06fed6d7.png

The photo shows what happens when I try to scale out. It basically throws up a bunch of stop orders. but it doesn't do it all the time. it seems to be somewhat random from what I can tell. Also, anything else in the other hotkeys scripts that I need to change when switching from BBT DAS to DAS PRO? Thanks

Here are my scale out hotkeys for LONG

Long scale out 10%

CXL ALLSYMB;Route=LIMIT;Share=Pos*0.10;Price=Bid-0.05;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=DAY+;SELL=SEND

 

Long scale out 25%

CXL ALLSYMB;Route=LIMIT;Share=Pos*0.25;Price=Bid-0.05;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=DAY+;SELL=SEND

 

Long scale out 50%

CXL ALLSYMB;Route=LIMIT;Share=Pos*0.50;Price=Bid-0.05;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=DAY+;SELL=SEND

 

Long scale out 100% (this will also cancel any orders that you have)

;CXL ALLSYMB;Route=LIMIT;Share=Pos*1;Price=Bid-0.05;TIF=DAY+;SELL=Send

 

Share this post


Link to post
Share on other sites

in the hotkey setup page, should change the route in the "Stop Type" to SMRTM from MARKET?

The only options are LIMIT and MARKET in the drop down. But if I'm with IB, should I change this to SMRTM instead of MARKET for stop loss?

Share this post


Link to post
Share on other sites
On 7/20/2020 at 8:29 AM, Jared Barber said:

really having some trouble with hotkeys.  I've been trying to find the best set up with exiting positions.  I use Kyles hot keys for entering positions currently.  Love them....but I'm not understanding how to do two things......1. Add to positions on pull backs with same stop loss.  2. establish hotkeys that work for selling and covering positions I entered with Kyles hot keys.  the other hotkeys I've found on this forum under popular hotkeys do not work with Kyles hot keys.  I'd love any guidance anyone can offer. I need a hotkeys mentor! 

 

There's a few scale-in hotkeys on the Excel spreadsheet which can add additional risk to a position (e.g. "Add $10 risk"). There's also a few scale-out hotkeys you can use that will sell X% of the position at the current price action. I think there's also some take-profit limit order ones in there that will place Limit Orders for profit taking at certain R:R levels. You have to scroll down on the Hotkeys sheet to see any of these, so many users tend to miss them.

 

 

17 hours ago, hailchaser2 said:

Sorry if this has been covered before, but my order didn't get filled today, is it just because the price moved past my entry in the half second it takes DaS to put orders in? Could I change the hotkey to give me a bigger cushion in the future?

 

 

Yes, it most likely jumped the gap. This is more common with pricier stocks because they can move wider ranges quickly and the spreads are usually larger.  The value on the Excel spreadsheet that adjusts this gap is the "Order Bid/Ask Offset" .. you might want to try .10 if you're trading high-priced stocks. I find .03 to .05 works for most things under $100 with a spread of less than 0.05 cents.

 

3 hours ago, Casey Gates said:

I'm switching from my BBT 3 month DAS account to DAS PRO SIM account and am having some problems with my hotkeys. So far just the scaling out hotkeys which cancel my stop and replace it at B/E. Is there something that I need to change in the script1406297533_hotkeyissue1.png.069387382746fefdf2f6eb6b06fed6d7.png

The photo shows what happens when I try to scale out. It basically throws up a bunch of stop orders. but it doesn't do it all the time. it seems to be somewhat random from what I can tell. Also, anything else in the other hotkeys scripts that I need to change when switching from BBT DAS to DAS PRO? Thanks

Here are my scale out hotkeys for LONG

Long scale out 10%

CXL ALLSYMB;Route=LIMIT;Share=Pos*0.10;Price=Bid-0.05;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=DAY+;SELL=SEND

 

Long scale out 25%

CXL ALLSYMB;Route=LIMIT;Share=Pos*0.25;Price=Bid-0.05;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=DAY+;SELL=SEND

 

Long scale out 50%

CXL ALLSYMB;Route=LIMIT;Share=Pos*0.50;Price=Bid-0.05;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=DAY+;SELL=SEND

 

Long scale out 100% (this will also cancel any orders that you have)

;CXL ALLSYMB;Route=LIMIT;Share=Pos*1;Price=Bid-0.05;TIF=DAY+;SELL=Send

 

 

It's likely the STOP order in the hotkey conflicting with the Take Profit order, I don't recommend putting Stop Orders and primary orders in the same hotkey, you should do the Stop with a Trigger Order. 

Clear all current Open Orders, sell 10% of shares, set STOP to Breakeven at new position quantity:
CXL ALLSYMB;Route=LIMIT;Share=Pos*0.10;Price=Bid-0.05;TIF=DAY+;SELL=Send;StopPrice=AvgCost;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

Clear all current Open Orders, sell 25% of shares, set STOP to Breakeven at new position quantity:
CXL ALLSYMB;Route=LIMIT;Share=Pos*0.25;Price=Bid-0.05;TIF=DAY+;SELL=Send;StopPrice=AvgCost;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

Clear all current Open Orders, sell 50% of shares, set STOP to Breakeven at new position quantity:
CXL ALLSYMB;Route=LIMIT;Share=Pos*0.50;Price=Bid-0.05;TIF=DAY+;SELL=Send;StopPrice=AvgCost;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

Keep in mind, if the take-profit order fails for some reason it won't fire the trigger to set a new stop. I've never had this happen, but it's why I recommend always having a "Trigger Order", "Positions", and "Open Orders" window on your main screen at all times, so you can quickly glance to see what orders are there.

 

59 minutes ago, Thomas said:

in the hotkey setup page, should change the route in the "Stop Type" to SMRTM from MARKET?

The only options are LIMIT and MARKET in the drop down. But if I'm with IB, should I change this to SMRTM instead of MARKET for stop loss?

No, the route is actually "STOP" the only available types are LIMIT, MARKET, RANGE, TRAILING (the latter two weren't relevant for the hotkeys at the time). I know it can be confusing for many people.  

Edited by KyleK29
  • Like 1

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

Share this post


Link to post
Share on other sites

Hi Kyle,

I have a new challenge for you 🙂 (if it's not already existing)
Is it possible to trigger a new order or automatic adjust a existing order, when a order is hit? Here are a couple examples of what I mean by that.

For example

- When a target is hit (limit order) I want the share size of my existing stop market automatically adjusted for that symbol.
- When my stop market order is hit, I want it to cancel automatically all my existing limit orders for that symbol.
- When my first target is hit (limit order) I want it to automatically remove my stop market order and set a new stop market order at break even (or adjust the price and share size of the old one).

Share this post


Link to post
Share on other sites

Hu all, do you know if it's possible to add a target profit to this fantastic hotkey? thx 🙂

Share this post


Link to post
Share on other sites
On 7/25/2020 at 2:51 AM, Jens said:

Hi Kyle,

I have a new challenge for you 🙂 (if it's not already existing)
Is it possible to trigger a new order or automatic adjust a existing order, when a order is hit? Here are a couple examples of what I mean by that.

For example

A - When a target is hit (limit order) I want the share size of my existing stop market automatically adjusted for that symbol.
B - When my stop market order is hit, I want it to cancel automatically all my existing limit orders for that symbol.
C - When my first target is hit (limit order) I want it to automatically remove my stop market order and set a new stop market order at break even (or adjust the price and share size of the old one).

Don't we all. I've been slowly nudging DAS to add some features that would help us manipulate stops (specifically) a tad easier via hotkeys. 

A & B: Unfortunately this doesn't exist in hotkey form and you have to do it manually by setting up the trigger orders, it's a bit of a pain in the rear to configure .. I don't even bother doing it unless I'm going to walk away from the terminal for a bit. This would require a video to explain and I have it on my list to do for the channel.

C : This is doable in the latest beta, but it's a complicated hotkey script. When that beta reaches everyone (goes to production), I'll add it to the Configuration Tool.

 

22 hours ago, given81 said:

Hu all, do you know if it's possible to add a target profit to this fantastic hotkey? thx 🙂

You can add a profit-target (there is a configurable version in the Excel sheet on the Hotkeys tab if you scroll down), right now I recommend doing it on a separate hotkey as I find that two primary orders can sometimes mess up the Trigger and / or the route sometimes. In the latest beta you can do this properly with a Trigger Order .. I'll add that to the configuration tool once those features reach everyone.

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

Hi,

I am currently setting up my HKs using a streamdeck XL and thanks to Jason Hilton and Kyle Kimsey I have great icons and scripts to start testing in SIM before taking them live. I am not 'coding' savvy so I am not quite sure what I am reading here but I have a few concerns:

1) DefShare=BP*0.97. My concern with this is my account value, I have a large account value with IB and don't want to put 97% of it at risk. Can someone enlighten me on the syntax here?

2) DefShare=400. Not sure what is going on here either, I understand that by clicking on my proposed SL and then using this HK (buy $40) that the order will adjust to buy the amount of shares of ABC stock to only risk $40 between my buy price and the selected SL, is this correct or am I way off? Please explain the purpose of DefShare=400.

3) I would greatly appreciate a brief explanation of the entire script is someone has that in them.

StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=40/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=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.1 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

Share this post


Link to post
Share on other sites
4 minutes ago, OTC said:

Hi,

I am currently setting up my HKs using a streamdeck XL and thanks to Jason Hilton and Kyle Kimsey I have great icons and scripts to start testing in SIM before taking them live. I am not 'coding' savvy so I am not quite sure what I am reading here but I have a few concerns:

1) DefShare=BP*0.97. My concern with this is my account value, I have a large account value with IB and don't want to put 97% of it at risk. Can someone enlighten me on the syntax here?

2) DefShare=400. Not sure what is going on here either, I understand that by clicking on my proposed SL and then using this HK (buy $40) that the order will adjust to buy the amount of shares of ABC stock to only risk $40 between my buy price and the selected SL, is this correct or am I way off? Please explain the purpose of DefShare=400.

3) I would greatly appreciate a brief explanation of the entire script is someone has that in them.

StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=40/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=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.1 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

The most thorough explanation is in the Equity % / Risk Example sheets in the Excel workbook. But I wouldn't spend too much effort trying to understand the script as a whole, a lot of tomfoolery is done to get around limits in DAS. For example, DefShare is "Default Shares" (what the montage sets to on first load), I use this as an temporary variable in memory, you can change the value to whatever you want it to be after the Hotkey is completed (resetting it to your desired Default Share amount).

The buying power of 97% is only used for calculating your maximum affordable shares, so if you try to take a position that is larger than you can afford it'll take the lesser value. The only accounts that usually hit this are the smaller ones, large accounts would need to be taking a huge risk amount.

I'd recommend configuring a more personal script via the Excel Configuration workbook just so you can get an idea of everything and make sure it's exactly how you want it.


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

Share this post


Link to post
Share on other sites

Kyle,

Thanks for the explanation, to make sure I understand the 400. After DAS executes the syntax the montage gets a '400' in the shares window as a default amount and this is necessary as a work around to some of the not so strong points in DAS scripts?

As for the BP line, Since I am trading with well over 25K I do not have to worry about this syntax as its a protection for those with smaller accounts? I do not take "huge" risks so should I think of 97 as I am 97% protected? 

As for the excel workbook, my plan was to use yours and Jason's HK for a few weeks in SIM to get comfortable with the scripts, their execution, and the SD XL--then maybe (hard maybe at this point) I will attempt to write my own scripts (not a strong suite of mine), LOL. I guess I better learn.

Share this post


Link to post
Share on other sites

All,

What is the difference between these two codes, why does one have CXL ALLSYMB and the other one does not? I see that one is using Limit where as the other is using Market, is that because Thor is likely using the 25%  and 50% in the opening for ORBs and first 2-mins of trading - speed of execution? and the other is being used more for long-trend moves such as bottom reversals and using a more 'set it and forget' approach, taking smaller partials at key levels?

CXL ALLSYMB;ROUTE=SMRTL;Price=Bid-0.02;Share=Pos*.2;TIF=DAY+;SELL=Send;ROUTE=SMRTM;

ROUTE=SMRTM;Share=Pos*.25;Price=Bid-.01;TIF=DAY+;SELL=Send;

Share this post


Link to post
Share on other sites
37 minutes ago, OTC said:

Kyle,

Thanks for the explanation, to make sure I understand the 400. After DAS executes the syntax the montage gets a '400' in the shares window as a default amount and this is necessary as a work around to some of the not so strong points in DAS scripts?

As for the BP line, Since I am trading with well over 25K I do not have to worry about this syntax as its a protection for those with smaller accounts? I do not take "huge" risks so should I think of 97 as I am 97% protected? 

As for the excel workbook, my plan was to use yours and Jason's HK for a few weeks in SIM to get comfortable with the scripts, their execution, and the SD XL--then maybe (hard maybe at this point) I will attempt to write my own scripts (not a strong suite of mine), LOL. I guess I better learn.

The 400 (DefaultShare) would likely only ever populate on a symbol you load for the first time, I have my DefShare set to 10. 

The 97% is your buying power, so if you have $25k equity and 4:1 margin, your buying power is $100k. 97% of that would be $97k. It's important to note that the Dollar Risk is the more important number (e.g. $40, so you're only risking ~$40 per trade depending slippage), if you have a position that is using $97k of your buying power, you're holding an asset (a piece of a company) and it's only risked really if that company suddenly files bankruptcy.

As for configuring your own, it's quite easy. The Excel Configurator walks you through creating the entire script to how you want it, so scripting necessary (it's all dropdowns and selectors). It has some decent breakdowns and explanations as well. You just configure it, copy it, and paste it into DAS. There's also a bunch of other scripts on the Hotkey sheet of the workbook if you scroll down.

 

31 minutes ago, OTC said:

All,

What is the difference between these two codes, why does one have CXL ALLSYMB and the other one does not? I see that one is using Limit where as the other is using Market, is that because Thor is likely using the 25%  and 50% in the opening for ORBs and first 2-mins of trading - speed of execution? and the other is being used more for long-trend moves such as bottom reversals and using a more 'set it and forget' approach, taking smaller partials at key levels?

CXL ALLSYMB;ROUTE=SMRTL;Price=Bid-0.02;Share=Pos*.2;TIF=DAY+;SELL=Send;ROUTE=SMRTM;

ROUTE=SMRTM;Share=Pos*.25;Price=Bid-.01;TIF=DAY+;SELL=Send;

The CXL ALLSYMB; tells DAS to cancel all Open Orders (not filled orders that are pending). Those are scale out scripts to take profit (20% for one and 25% for the other). There's a configurator for those as well on the Hotkeys sheet.

I wouldn't use those as is because they're for IBCO users. DAS SIM users use the LIMIT / MARKET route.

 

 

There's a few older videos that WilliamH did, the few I did (linked in the OP), and the a special seminar in the Education Center for these scripts as well.  They walk through how to use them.

 

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

Kyle,

see quote: "As for configuring your own, it's quite easy. The Excel Configurator walks you through creating the entire script to how you want it, so scripting necessary (it's all dropdowns and selectors). It has some decent breakdowns and explanations as well. You just configure it, copy it, and paste it into DAS. There's also a bunch of other scripts on the Hotkey sheet of the workbook if you scroll down."

I looked through all the pages on this post and also searched(forum) for the Excel Configurator and did not see it, where do I locate this excel? You also stated that there a bunch of other hotkey scripts on the HK sheet of the workbook, are you referring to these being located on the same excel?

 

Edited by OTC

Share this post


Link to post
Share on other sites

Hi Kyle,

Is there a way to use your hotkeys without having to double click the chart to get the price?

Meaning --- is there a way to just hit the hotkey and it buys the correct # of shares based on my buying power, 1% or 0.5% of my account size without having to double click the chart?

This interests me for ORBs or quickly moving stocks and I don't have time to find the right spot to double click the chart so the current script can calculate shares. note --- I love your hotkeys for when the day is slower and I can set my stop and then hit the keys, but needed something quick for momentum trades and not needing 5 different buttons with share sizes based on the stock price range.

Is this possible to generate from your spreadsheet?

 

Share this post


Link to post
Share on other sites
  • Hi Kyle, Amazing hotkeys. I am testing your dynamic hotkey in the sim account. It is placing the long order but it is not placing/triggering the associated stop order. I set the send stop trigger to TRUE in your excel sheet. Here's the script generated
  • 0.pngFri @ 11:54 am
    StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=100/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=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;
     
     
    Found the solution: It is described in Kyle's troubleshooting guide: Have to change the montage style to specific type such as "stop order"
Edited by Alam
found solution

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.