Jump to content
KyleK29

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

Recommended Posts

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
23 hours ago, Alam said:
  • 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

Are you in replay mode? Stop orders do not work in replay So just checking 

Share this post


Link to post
Share on other sites

No, Just the regular sim on real time around 10AM, i.e. regular market hours

Share this post


Link to post
Share on other sites

Thank you Kyle for the hotkeys.

When I use it, it's requiring me to close stop order before I can sell/cover. Is there a solution to sell/cover while stop order is in place?

Share this post


Link to post
Share on other sites

Kyle,

If I am using the following buy and short scripts, is the a way to add a 'double click' SL to sell full position at desired SL calue?

LONG:  ROUTE=SMRTL;Share=300;Price=Ask+0.05;TIF=DAY+;BUY=Send

SHORT:  ROUTE=SMRTL;Share=200;Price=Bid-.05;TIF=DAY+;SELL=Send

Here is something the guys at DAS put together for me but it doesn't adjust the share amount if you partial. Do you know if we can make the following code readjust the share amount and possibly move the stop to breakeven?

StopPrice=Price;ROUTE=SMRTL;Share=300;Price=Ask+0.05;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:LIMIT STOPPRICE:StopPrice PX:StopPrice ACT:SELL QTY:POS TIF:DAY+

Edited by OTC

Share this post


Link to post
Share on other sites
On 7/30/2020 at 11:03 PM, Thomas said:

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?

 

Ok, I answered my own question below and found the script. It's pretty simple, but the challenge with this is the amount of shares (risk) is perfectly fine for a $60 stock, but using the same buying power % of 25%, or even 15% at $15-30 gives me too many shares and the risk is a lot tighter and no room for movement.

25% BP in this script is awesome, and equates to a $100 risk when playing AMD, but can not be used for anything in the lower price ranges, and I found having a 10% BP hotkey needed, or else the risk is closer to $350-$500 for any kind of small up or down.

--- is there anyway to have a dynamic share hotkey based on $ risk without having to double click the chart?

BUY with BP of 15% (simple based on BP and round2 price -- no need to double click chart)
ROUTE=SMRTL;PRICE=ASK+0.04;PRICE=Round2;SHARE=BP*0.15;TIF=DAY+;BUY=SEND

 

Share this post


Link to post
Share on other sites
On 8/1/2020 at 10:51 PM, Alam said:

No, Just the regular sim on real time around 10AM, i.e. regular market hours

ok, I have to ask. Did you change the montage style to Stop Order? and enable double click on the chart to trade?

Also, if you have IB account use SMRTL or SMRTM. If you are using the BBT simulator version, you have to use LIMIT and MARKET as ROUTE=

Here are the scripts I use and they work: keep us posted

BUY $100 with stop loss

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

Short $100 with Stop Loss

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

 

  • Like 1

Share this post


Link to post
Share on other sites

I'm testing out this hotkey and I've noticed a strange behavior when I try to partial out or close out my position. Under my trades window, it shows up as a short sell (SS) rather than simply a sell. I'm concerned that if I try to partial out on a stock that doesn't allow shorts, it won't let me close. Has anyone seen this?

 

Update: Nevermind! I read through the initial post again and realized this is a known issue.

Edited by drodz

Share this post


Link to post
Share on other sites

Hey Kyle,

I am having a really difficult time with setting up my hot keys. I followed a BBT Youtube tutorial on your hot keys and watched your webinar but for some reason my keys are not working the way I thought they would.

One example: Long $100 Risk - 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=MARKET;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

When I tried this morning and yesterday morning I found that the stop loss order never showed up on the queue. What am I missing? Thank you for all your help and dedication on this. I've learned a ton already.

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.