Jump to content

We have moved to Discord. Please click here to join us in the Trading Terminal Discord server.



These forums are read-only.

Lexie

DAS hotkeys for share size...

Recommended Posts

Lexie

Hi everyone! I was sifting through the forum checking out the codes for hot keys that calculates your share size based on the set risk we choose in DAS... automatically! From reading the threads it looks like there was a lot of trial and error and that it worked great for some people and others couldn't get the bugs fixed. I saw Kyle was going to make a video but it looks like that is still in the making.

Is anyone able to share the versions you are using? Writing out these scripts on my own hasnt gone well and isnt my strong suit. Thank you in advance,

 

Edited by Destiny

Share this post


Link to post
Share on other sites
Rob C
1 hour ago, Destiny said:

Hi everyone! I was sifting through the forum checking out the codes for hot keys that calculates your share size based on the set risk we choose in DAS... automatically! From reading the threads it looks like there was a lot of trial and error and that it worked great for some people and others couldn't get the bugs fixed. I saw Kyle was going to make a video but it looks like that is still in the making.

Is anyone able to share the versions you are using? Writing out these scripts on my own hasnt gone well and isnt my strong suit. Thank you in advance,

 

If you want to start with simpler script that calculate share size based on your planned risk, I have been using a simple one for a year and it has worked really well for me. Though it takes a little bit of explanation so I can't just simply paste it.

Kyle's scripts are way better than my simple one and I will be migrating to his. I just grew use to my setup (I haven't had a hot key mistake in 3 months - knock on wood) so it will take some time for me to train myself to use them efficiently in SIM.

But if you want to start with a simple to understand and implement script, let me know and I will post my DAS setup.

Edited by Rob C
  • Thanks 1

Share this post


Link to post
Share on other sites
Lexie

Yes! I love simple.

I’d love to test yours out for a while and check out Kyles at a later time.

 

thank you Rob!

Share this post


Link to post
Share on other sites
Snaps

I've been using Kyle's for over a month with no issues. I set a defined risk of $100 rather than a percentage of my equity. 

  • Like 1

Share this post


Link to post
Share on other sites
Lexie

@Snaps can you trade more than one stock at a time when you do it that way?

Share this post


Link to post
Share on other sites
Snaps

Yep

  • Thanks 1

Share this post


Link to post
Share on other sites
Rob C
21 hours ago, Destiny said:

Yes! I love simple.

I’d love to test yours out for a while and check out Kyles at a later time.

 

thank you Rob!

Hi Destiny, so this is the simple way of using risk/trade to determine share size. Again Kyle's method is much better, but maybe in the interim while you test Kyle's out this may work for you. I am still using this due to inertia and its a one mouse click (or one hot key) trade order. I commonly trade within 1 minute of the open so clicks count. But with practice I hope I can use Kyle's method just as fast and upgrade.

So there are two variables, risk per trade and the cost you are risking if you stop out. I currently use $30 risk per trade. So that will be written into the script. Every few weeks I change my risk/trade I rewrite the scripts. Your distance from entry to stop out (which I am calling the stop out cost) changes with each trade. So I simply have different buttons with the different stop out costs (10 cents, 20 cents, etc.). So as soon as I choose and click a button both variables are known and the share size is calculated.

image.png.5aec75e9bed666ea30eaee29e591d921.png

Yes that's a lot of buttons. But you can use hot keys instead. I find it to be quicker with buttons and less mistakes. Tommy has a picture of his setup with keys using stop out costs (see "Tommy's Journey" in the Trading Journal section of the BBT website).

So for example the script for Short 10c is:

ROUTE=SMARTL;Share=30/.1;Price=Bid-.05;TIF=DAY+;SELL=Send;

or even more simply:

ROUTE=SMARTL;Share=300;Price=Bid-.05;TIF=DAY+;SELL=Send;

Yes I do have to write the script 16 times with a different share amount for each button. And please use what ever route you want I just typed SMARTL as a placer. I don't even use SMARTL.

With Kyle's you can set your share size to your exact stop out cost. My method you have to choose the closest button to your stop out costs.

Let me know if you have any questions.

  • Like 1

Share this post


Link to post
Share on other sites
Lexie

@Rob C Thank you so much! This is great! I’ll test it out tomorrow afternoon and get back to you if I have questions.

Share this post


Link to post
Share on other sites
onlyjava

HOT BUTTONS INSTEAD OF HOT KEYS

 

Here's how the hot buttons on my montage looks like

image.png.d09aead8f53a0d7db183adc273871cdc.png

 

Adding buttons:

 

To enable Hot Buttons in the montage, right click on the montage and select "Layout Config" and add "Hot Button" to the selected list.

Right click in the area below the level 2 in montage and "Add Row" - you get to enter the number of buttons in a row.

You can then right click a button and "edit" - set the text on the button, color, script, button height, font.

Can also right click a button to delete button or delete row - to make changes.

 

Scripts for the buttons:

 

You can use your hot key scripts

 

CANCEL ORDERS

  CXL ALLSYMB;

 

PANIC

  CXL ALLSYMB;PANIC;

 

SELL 100%

  CXL ALLSYMB; ROUTE=SMRTL;Price=Bid-0.10;Share=Pos;TIF=DAY+;SELL=Send;

 

COVER 50%

  CXL ALLSYMB;ROUTE=SMRTL;Price=Ask+0.10;Share=Pos*.5;TIF=DAY+;BUY=Send;

 

COVER 100%

  CXL ALLSYMB;ROUTE=SMRTL;Price=Ask+0.10;Share=Pos;TIF=DAY+;BUY=Send;

 

100-200 BUY 100

ROUTE=SMRTL; Share=100; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.20 ACT:SELL QTY:POS TIF:DAY

**this also sets a STOP MARKET for 20 cents below entry**

see these 2 cases where the STOP fill was not exactly at 20 cents below entry - varies with market movement

you could set a Range or Trailing stop - but they also become market orders at execution - so this is unavoidable

image.png.5690844d8a9fd81bd20c690fb6a70e5f.png

 

SHORT 100

ROUTE=SMRTL; Share=100; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.20 ACT:BUY QTY:POS TIF:DAY

**this also sets a STOP MARKET for 20 cents above entry**

 

SSR SHORT 100

ROUTE=SMRTL; Share=100; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.20 ACT:BUY QTY:POS TIF:DAY

**this also sets a STOP MARKET for 20 cents above entry**

               (When SSR  [short selling restriction] is on, your SELL order has to sit at ASK for it to be filled for shorting.

               In this case you are selling stocks that you do not own)

 

For the other buttons, change the Share numbers.

 

In the scripts above, the Account is not set.

If you have multiple accounts, make sure that you set the right default account from the "Setup" | "Order Templates"

 

DAS support says that " STOP orders may or may not execute during pre/post market hours "

Also,  STOP orders does not work in replay mode either

 

IF YOU WANT TO SET STOPS AT A FIXED VALUE OF $100 LOSS

STOPPRICE = (AvgCost2*Pos-100)/Pos = AvgCost2-100/Pos

 

Scripts for the BUY buttons

**this also sets a STOP MARKET for $100 below entry**

 

ROUTE=SMRTL; Share=100; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-1 ACT:SELL QTY:POS TIF:DAY

ROUTE=SMRTL; Share=200; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.5 ACT:SELL QTY:POS TIF:DAY

ROUTE=SMRTL; Share=300; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.33 ACT:SELL QTY:POS TIF:DAY

ROUTE=SMRTL; Share=400; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.25 ACT:SELL QTY:POS TIF:DAY

ROUTE=SMRTL; Share=500; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.2 ACT:SELL QTY:POS TIF:DAY

ROUTE=SMRTL; Share=600; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.17 ACT:SELL QTY:POS TIF:DAY

ROUTE=SMRTL; Share=800; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.13 ACT:SELL QTY:POS TIF:DAY

ROUTE=SMRTL; Share=1000; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.1 ACT:SELL QTY:POS TIF:DAY

ROUTE=SMRTL; Share=1300; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.08 ACT:SELL QTY:POS TIF:DAY

ROUTE=SMRTL; Share=2000; Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2-.05 ACT:SELL QTY:POS TIF:DAY

 

Scripts for the SHORT buttons

**this also sets a STOP MARKET for $100 above entry**

 

ROUTE=SMRTL; Share=100; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+1 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=200; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.5 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=300; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.33 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=400; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.25 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=500; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.2 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=600; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.17 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=800; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.13 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=1000; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.1 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=1300; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.08 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=2000; Price=Bid-0.10;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.05 ACT:BUY QTY:POS TIF:DAY

 

Scripts for the SSR SHORT buttons

**this also sets a STOP MARKET for $100 above entry**

 

ROUTE=SMRTL; Share=100; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+1 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=200; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.5 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=300; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.33 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=400; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.25 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=500; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.2 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=600; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.17 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=800; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.13 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=1000; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.1 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=1300; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.08 ACT:BUY QTY:POS TIF:DAY

ROUTE=SMRTL; Share=2000; Price=Ask+0.01;TIF=DAY+;SELL=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:AvgCost2+.05 ACT:BUY QTY:POS TIF:DAY

 

Price range and the number of shares matrix:

 

I plan my trades with a max of $20000

SHARE PRICE RANGE  NUMBER OF SHARES

 

  0 -  10 2000

 10 -  15 1300

 15 -  20 1000

 20 -  25  800

 25 -  30  600

 30 -  40  500

 40 -  50  400

 50 -  65  300

 65 - 100  200

100 - 200  100

 

Edited by onlyjava

Share this post


Link to post
Share on other sites

[[Template core/front/global/mobileNavigation is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

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.