Jump to content
KyleK29

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

Recommended Posts

it depends on how you want to exit the trade (the panic button works allways) but usually it is because you have the existing order present and the stock is not shortable or your buying power is depleated so you need to add the CXL ALLSYMB; to your exiting/partialling hotkey/hotbutton at the start of your script

Share this post


Link to post
Share on other sites
Posted (edited)
On 12/25/2020 at 4:01 PM, ChrisReath said:

Does anyone know if the Stop Orders attached to the Buy orders work in Replay mode in the Das Demo Simulator Version 5.5.2.1?  No stop orders are created. Montage Style is set to 'Stop'

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!

Edited by zak

Share this post


Link to post
Share on other sites
Posted (edited)
On 4/1/2021 at 3:14 AM, peterB said:

it depends on how you want to exit the trade (the panic button works allways) but usually it is because you have the existing order present and the stock is not shortable or your buying power is depleated so you need to add the CXL ALLSYMB; to your exiting/partialling hotkey/hotbutton at the start of your script

 

Can you give me the whole script with the "CXL ALLSYMB;" in it? I just want to double check and see if I did it right

Edited by koreanwon97

Share this post


Link to post
Share on other sites

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+;

 

Share this post


Link to post
Share on other sites
Posted (edited)
On 4/3/2021 at 3:56 AM, koreanwon97 said:

Can you give me the whole script with the "CXL ALLSYMB;" in it?

just add it at the start of your partial/exit script lik this 25% partial

CXL ALLSYMB;ROUTE=LIMIT;Price=BID-0.05;Price=Round2;Share=Pos*.25;TIF=DAY;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-hare;TIF=DAY;SELL=SEND

 

Edited by peterB

Share this post


Link to post
Share on other sites
Posted (edited)

don't know if this was for my question or not? If so, it didn't answer my question 🙂

 

48 minutes ago, peterB said:

check this topic on the OCO orders

 

Edited by Asbjorn

Share this post


Link to post
Share on other sites

yes it is and afaik it is the only solution if you want to have 2 orders co-exist at the same time for the same stock you have position opened for

Share this post


Link to post
Share on other sites
Posted (edited)
4 hours ago, peterB said:

yes it is and afaik it is the only solution if you want to have 2 orders co-exist at the same time for the same stock you have position opened for

its not an order after an order (OCO). Its only one order, a range order, where it insert a stop market loss and a limit cover at the same time. Using the script from Short with $20 risk per trade WITH Stop sent to the market

as seen here, or is that not possible? I might be wrong and misunderstand how these orders works, if that so, thank you for your time 🙂 

 

Edited by Asbjorn

Share this post


Link to post
Share on other sites
Posted (edited)

imagine you have $120 dollars and you buy 1 stock of AAPL for $120. now your buying power is 0

you set a stop loss to sell 1 stock of AAPL to be protected at $119

now if you want to put another order of selling AAPL at $122 you can not beacuse you do not have money for that as you are already in a position and you have an order to sell already

so the only chance is to cancel the stop loss and put the profit taking order instead

if you want both stop loss and profit taking orders to coexist they need to be OCO - one cancels other otherwise byexecuting one order you willstillbe in a risk a new positionwillbe opened once the price action reaches your order price level

 

Edited by peterB
  • Like 1

Share this post


Link to post
Share on other sites
On 4/2/2021 at 5:12 PM, 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!

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! 🙂 

Share this post


Link to post
Share on other sites

you click where you want to set your stop loss then you press the hotkey.

stop loss orders do not work in premarket

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
On 10/11/2018 at 10:27 AM, KyleK29 said:
On 9/28/2018 at 2:37 PM, KyleK29 said:

 

8/8/2019
- New version 2.0, download the .zip file and unzip it.
- Fixed an issue with some hotkey configurations that may have caused them to be inaccurate in vary rare situations. Recommend recreating your hotkeys in this new version, just to be sure.
- Added Profit Target hotkeys.
- Added % Scale-In Hotkeys
- Added $ Risk Scale-In Hotkeys
- Added Short-SSR to Long/Short dropdown for SSR hotkeys (DAS Simulator)
- Added Range Order hotkeys
- Added Y-Margin Scale Increase hotkey, Y-Margin Decrease, and Y-Margin Reset
- Added new sheet "Example - Equity%" and "Example - $Risk" to give a more workflow outlook on what is happening.
- Included a ScaleOut worksheet to manually simulate what different scale percentages / scenarios look like (instructions will be in the video).
 

What is the difference between the 'SSR Short' script and the normal 'Short' scrip? I used a 'bid+0.10' for my SSR key, should this work?  

 

 

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.