Jump to content
KyleK29

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

Recommended Posts

Posted (edited)

I have am having with WIlliam's hot key from the video on BBT's youtube channel named William: Ultimate DAS HotKey - Aug. 20 2020. I am currently in SIM and I showed a photo of the issue. Basically when going Long or short I get a fill and the lines show up and even a sell order or a Buy back order at my 1R target. but no stop out order (where my stop would  be). Ironically enough the even when I hit my 1R target the sell or the buy back order don't work. I will show the scripts down below, they are straight from the video, I have tried finding a solution and am having trouble, and help would be greatly appreciated. 

 

For Long Entries and a $10 risk, stop order attached, and Target order of 1:1

CXL ALLSYMB;StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=10/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;Price=Ask-StopPrice*1+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS TIF:DAY+

For Short Entries and a $10 risk, stop order attached, and Target order of 1:1

CXL ALLSYMB;StopPrice=Price+0;DefShare=BP*0.925;Price=Price-Bid+0.00;SShare=10/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;Price=StopPrice-Bid*1;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS TIF:DAY+

 

 

Screenshot 2021-05-17 195451.png

Edited by SamuelRice

Share this post


Link to post
Share on other sites

thanks, do you know why its sending a sell order at my target and not my stop though?

Share this post


Link to post
Share on other sites
On 5/18/2021 at 2:29 PM, SamuelRice said:

thanks, do you know why its sending a sell order at my target and not my stop though?

have you tried it in normal trading hours and still facing the same problem?

Share this post


Link to post
Share on other sites
Posted (edited)
On 5/17/2021 at 5:01 PM, SamuelRice said:

I have am having with WIlliam's hot key from the video on BBT's youtube channel named William: Ultimate DAS HotKey - Aug. 20 2020. I am currently in SIM and I showed a photo of the issue. Basically when going Long or short I get a fill and the lines show up and even a sell order or a Buy back order at my 1R target. but no stop out order (where my stop would  be). Ironically enough the even when I hit my 1R target the sell or the buy back order don't work. I will show the scripts down below, they are straight from the video, I have tried finding a solution and am having trouble, and help would be greatly appreciated. 

 

For Long Entries and a $10 risk, stop order attached, and Target order of 1:1

CXL ALLSYMB;StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=10/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;Price=Ask-StopPrice*1+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS TIF:DAY+

For Short Entries and a $10 risk, stop order attached, and Target order of 1:1

CXL ALLSYMB;StopPrice=Price+0;DefShare=BP*0.925;Price=Price-Bid+0.00;SShare=10/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;Price=StopPrice-Bid*1;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS TIF:DAY+

 

 

Screenshot 2021-05-17 195451.png

 

The open order circled is a Buy order, not a sell. I'd caution using them for such a stock with a stop only .02 cents away from the entry, it's enough to slip you out immediately via the spread. Also, if you're not with Interactive Brokers you need to change all the SMRTL; to Limit; and SMRTM; to Market;

As for the order colors on the chart flags, those are user configurable and differ for Long or Short positions. Mine are Green/Red and Blue/Orange.

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
Posted (edited)
On 4/4/2021 at 6:08 AM, Asbjorn said:

Hi, great script! I wonder if its possible to add a limit cover order 50 cents below the bid with the same amount of shares that you get fill at the same time with the script? Such that you end up with a stop market and limit cover order with the same amount of shares when you press the hotkey

 

Short with $20 risk per trade WITH Stop sent to the market: StopPrice=Price+0;DefShare=BP*0.925;Price=Price-Bid+0.00;SShare=20/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+;

 

 

As in send a corresponding take-profit ahead of the price action on entry? You'd just need to add another TriggerOrder to the end of the script .. like this:

TriggerOrder=RT:LIMIT PX:AvgCost-0.5 ACT:BUY  QTY:Pos TIF:DAY;

 

On 4/5/2021 at 5:26 AM, Akari said:

I am having the exact same issues in Replay mode in DAS free trial regarding the Stop orders.. Also with the equity based hotkeys when double clicking on the chart it buys very limited shares and when clicking on the montage it just randomly buys thousands of shares, I am confused. I am also going to try again when market opens to see what happens. 

@zak let me know if you found the solution! 🙂 

 

On 4/2/2021 at 8:12 AM, zak said:

Checking on this also. Montage is set to Stop Order, but the stop orders are not being sent in with the hotkeys. Does anyone know if the stop orders work in replay mode (Das free trial)?

Scripts:

Equalized risk $40, Long:

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

Equalized risk $40, Short:

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

Edit: I found an earlier post in this topic that says stop orders do not work in replay mode. I will try again when markets open!

 

On 4/18/2021 at 9:19 AM, bdshepherd said:

Re: using the hotkey to enter a position in Replay mode and not getting a stop, my understanding is that trigger orders don't work in Replay mode.  Since the script uses a trigger to set the stop, the stop will not be placed.

 

Bdshepherd is correct, DAS does not emulate TriggerOrders in Replay Mode so the Stop isn't created.

 

On 4/22/2021 at 9:48 AM, jeremyjohnolson said:

Hey BBT community, I need help!  I am using the fixed dollar risk hot key from Kyle (thanks Kyle!) where I double click the chart to add where I want to put my stop and it auto calcs the shares.  I had a very odd thing happen to me two days in a row.  After double clicking the chart to set my stop and then hitting the hotkey button on my StreamDeck to execute, DAS immediately bought the shares and then immediately stopped me out and sold them at market in less than 1 second.  I recorded the trade this morning, so I was able to take screen shots to show how the problem looked in real time in DAS (see below).  Does anybody have a clue why this is happening???

Another very odd thing about it all, this problem has only happened to me twice, once yesterday morning, and then again this morning and I have been using this hotkey for nearly 1 year now without ever having had this problem in the past.  On both occasions the problem only happened on the very first trade of the morning, when trying to go long on a 1 min ORB.  Both mornings I continued to trade immediately afterward utilizing the exact same hotkey without any issue.  So apparently it only happens on my first trade of the day right at market open.

Another thing, if I calculate the dollar amount the hotkey risked, I am coming up with $13.78 (price 28.24, stop 28.11, risk 0.13 X 106 shares = $13.78), but it should have only risked $8.  Normally the hotkey risks the correct amount, so I do not know why it would have risked too much this time.  The hotkey next to that one will risk $16.  Potentially I could have clicked the wrong hotkey and said to risk $16, but I serious doubt it as I am always very careful to only risk $8 on the 1 min ORB since I am still in the "testing it out/learning" phase.  Someday I will risk hundreds, even thousands :), but that day is not today.  So even if I clicked the wrong key, it still wasn't risking the right amount as it was only $13.78, not $16 (or $8).  I don't know, the price action was pretty fast, so I chalk it up to that somehow getting a bad fill or something like that.  I am more concerned about my first question of why it is immediately stopping me out.

If there is anyone that can help me diagnose this problem, I would greatly appreciate it!  Let me know if there is any more information you would like to know and if I can I will provide it.

Here is the script I used:

FocusWindow M1;ACCOUNT=my account number goes here, deleted for privacy;CXL ALLSYMB;StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=8/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=1;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.1 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+

1. trades & trade log.png

2. Stop selected.png

3. Buy submitted.png

4. Buy Order Filled.png

5. Executes market order stop loss sale.png

6. Sell Order Filled.png

 

From looking at the screenshot the Stop Price is roughly the same as the price you got in at, not 28.11. That would get you almost immediately.  

On 5/16/2021 at 9:30 AM, Korey R. Snead said:

 

*Ignore this quote, forum software won't let me remove it on mobile.

On 3/2/2021 at 4:30 AM, FlyOrSwim said:

 

Understood about BP...

Regarding the error message: I tried messing around with all types of "Round" and it doesn't work. But even if it worked, in your example would be perfect for prices with 3 decimals. But if I would use the same script for 0.0022 Bid and 0.0023 Ask, I would be screwed. It would be great if there was a function of "Round" to round always the last decimal ( NOT "Round2", "Round3", "Round4", etc.), so I don't have to make a lot of hotkeys differentiated by decimals. I was wondering maybe there is an easier solution to that or maybe there is a bug I should sort. Anyway... Thank You for your contribution Peter... Much appreciated...

*Ignore this quote, forum software won't let me remove it on mobile.

On 3/9/2021 at 2:34 PM, MIGS said:

Hi, I've been using the hotkeys for some time, but lately the "Stop - Update Position ..." hotkeys don't want to work for me....I get the error message in DAS "Replace:Order is not Open!"....

I'm sure I'm using the right hot key (Long-Replace code for a long trade).  My procedure is like this for say a long trade:  

-Add shares to an existing position  (position has a corresponding stop-limit order generated by a hot key)   

-Click on the existing stop limit order

-Hit the hotkey.

Nothing happens (# shares in stop order is not updated) and I get the mentioned error....

....What else do I need to check?, thanks!

 

Miguel

*Ignore this quote, forum software won't let me remove it on mobile.

On 3/31/2021 at 9:35 PM, koreanwon97 said:

I'm having an issue where I can't exit a trade unless I remove the stop that's sent to the market. How do I fix this?

That's a bug with the DAS DEMO Broker for when a stock has an SSR status - it won't happen with a real broker. 

Edited by KyleK29
  • Thanks 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 believe you are correct in identifying the problem on my trade as the stop being set at or very near the entry price, but what is strange is that's not what I did.  So I do not know why the software or hotkey set the stop at my entry price when that's not what I instructed it to do when I clicked $28.11 to be my stop.  I just went back and re-watched the video I saved of this trade and it seems clear to me that I clicked the correct stop level at $28.11.  I can even see $28.11 being loaded into the price field of the montage when I double clicked the chart to set that as my stop.  But then when I hit the hot key to enter the trade, for some reason it set my stop not at the $28.11 which I clicked previously but instead at the same as my entry price.  I have no idea why this would happen.  Normally the hotkey and DAS software do not behave in this way for me, it normally works as expected, so I am not too worried about it.  I will just chalk it up to some unknown fluke, unless it keeps happening, then I will have to do more digging to try and figure out what's going on.  I am not totally writing off the possibility it could be user error (i.e. something I accidentally did, without knowing, which caused it), but it seems unlikely to me since I can clearly see on the video my stop being clicked and loaded, then entering the trade and I didn't click anything else in between those steps, at least not to my knowledge, but who knows, maybe I did.  Like I said, I will just write this one off and see if it happens again.  That being said, it did happen to me twice already, but again, it still could be user error, so I will just be extra careful and see if it stops happening.

Share this post


Link to post
Share on other sites

post screenshot hotkeys used or log from DAS and your broker. this happens when your routes are set incorrectly in your hotkeys.

risking $100 per trade on your first day is not very wise

Share this post


Link to post
Share on other sites
16 hours ago, Jeremy said:

I clicked a stop level on the chart, then clicked my equalized risk button in the montage. My risk was set at $100. An order executed shorting only 2 shares and immediately covering 2 shares at the same price. 

In my opinion there are two possible (simple) reasons. 

1. The double-click on the chart did not take the price. Did you activate it in the chart configuration? When you double-click on the chart the price should instantly appear on the montage in the "price" window.

2. You clicked a price closer then your "Minimal Stop Buffer" value.

Share this post


Link to post
Share on other sites

I have been using these hotkeys and they have helped a lot. I wanted a slight variant to get into a trade. At present the hotkey picks the price from mouse click as stop loss level and then gets into the trade with $X risk. 

I want to send a Limit order to buy at a specific price (selected by clicking on the chart) and then setting up the stop loss accordingly to have $X risk.  (sort of reverse of existing setup).

Would be really helpful if I can get these for Long and short position. 

The rationale to use is that when watching multiple charts, I sometimes miss the movement on chart A when focusing on chart B. But I have levels marked at the point where I expect to take a trade. With trades pre set with limit orders, this will become easier to manage. 

Share this post


Link to post
Share on other sites

Hi Kyle,

I have been using your scripts for a while.  They are very helpful!  To make sure that you know what I'm referring to, I'm posting Short sell script below.  This is the one with $25 fixed risk, and price target of 1.25R for full position.

CXL ALLSYMB;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=100;Price=StopPrice-Bid*1.25;Price=Round2;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS TIF:DAY+

Is it possible to have 2 separate price targets.  Let's say, first one (60%) at 1R and second one (40%) at 2Rs?  That will be very helpful if possible.  Thank you very much!

Henry

 

 

 

 

Share this post


Link to post
Share on other sites
3 hours ago, tamago168 said:

Hi Kyle,

I have been using your scripts for a while.  They are very helpful!  To make sure that you know what I'm referring to, I'm posting Short sell script below.  This is the one with $25 fixed risk, and price target of 1.25R for full position.

CXL ALLSYMB;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=100;Price=StopPrice-Bid*1.25;Price=Round2;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS TIF:DAY+

Is it possible to have 2 separate price targets.  Let's say, first one (60%) at 1R and second one (40%) at 2Rs?  That will be very helpful if possible.  Thank you very much!

Henry

 

 

 

 

not with a (truly working) stop loss. you can put 2 separate limit orders for that though

Share this post


Link to post
Share on other sites

Hi Peter,

Ok, I'll workaround it by changing the script to send 60% at 1R, and manually send another 40% at 2Rs.  Thank you for your time.

 

Share this post


Link to post
Share on other sites
On 6/1/2021 at 3:03 PM, Girish Kumar said:

I have been using these hotkeys and they have helped a lot. I wanted a slight variant to get into a trade. At present the hotkey picks the price from mouse click as stop loss level and then gets into the trade with $X risk. 

I want to send a Limit order to buy at a specific price (selected by clicking on the chart) and then setting up the stop loss accordingly to have $X risk.  (sort of reverse of existing setup).

Would be really helpful if I can get these for Long and short position. 

The rationale to use is that when watching multiple charts, I sometimes miss the movement on chart A when focusing on chart B. But I have levels marked at the point where I expect to take a trade. With trades pre set with limit orders, this will become easier to manage. 

When I get a moment I am going to build a script for this exact set up myself as I often want to get into a trade but once it breakouts and not immeidately..  unless someone already has a script for this scenario please?

Share this post


Link to post
Share on other sites

Newbie here 🙂 First of all, thank you so so much for all the great tips here! Especially this one which I have been studying for today! Is it possible for me to add HOT BUTTON in my montage for the scripts? If yes, do I do asf:

1) I double click the stop price I want

2) I click the hot button for Long or Short 

image.png.f5399472e9b31384b0c948d5c071ed9c.png

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.