Jump to content
Justin

DAS - Stop Limit Order for Future Entry with Dynamic Share Calculation - Using $Risk with a Stop Loss

Recommended Posts

 Hey @miked and @James00trades it might help if you attach some screenshots, but here is what is supposed to happen:

This is an example of when you are trying to go long

On QCOM I want my stop to be 164.13. So I double click on the chart at that price and hit the first hotkey:

StopPrice=Price

You will not see anything on the chart at this point.

The price is currently at 164.25 and I want my entry to be from 164.29. So I double click on the chart at that price and hit the second hotkey:

DefShare=BP*0.97;Price=Price-StopPrice;SShare=30/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare; SShare=Share;Share=Price*100; Price=StopPrice; DefShare=Price*100; Price=Share/100; Price=Price+StopPrice; StopPrice=Price; Share=SShare; TogSShare; Price=Price+.05;TIF=DAY+;Route=Stop;StopType=Limit; Buy=Send; Share=DefShare;Price=Share/100; StopPrice=Price; DefShare=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

This will show on the chart (below) as a range order, as the hotkey is set to do a 5 cent range (Price=Price+.05) - you can change this to whatever you're comfortable with. You will not see the stop loss on your chart until the price comes up and this range order is triggered.

image.png.56749c980f9fee839caea90b2775a6a9.png

 

As you can now see (below), the price has come up and entered me at 164.30 (as that price was in the 5 cent range of 164.29 - 164.34). You will also see that the stop loss has triggered upon entering the position at the original price I clicked on the chart - 164.13.

image.png.9bec0373d7130cc797045ebac6003e5a.png

 

Does this explanation help a bit? I think it might be seeing the range order that is confusing.

  • Like 2

Share this post


Link to post
Share on other sites

Evenin' @Justin Really appreciate the detailed walkthrough.  I'll take some screenshots tomorrow morning after the bell to demonstrate what I'm seeing, including the order & trigger windows.  I suspect my issue was that I was taking a reading immediately after the hotkey sequence without realizing that the the Primary Order trigger needed to hit before I could judge whether or not the script was working on my setup. 

In the meantime, have you discovered a workaround to allow you to play this hotkey script either pre-market or afterhours?  I suspect we'd need some sort of server side script to work around the FINRA rules, but I'm new to DAS and uncertain whether or not we have that level of customization with the program.

The bell will ring and fresh wisdom is up for grabs!!  Will report back soon.

Btw ... both you and @KyleK29 have given me such a positive experience with my first week at BBT that I've been recommending y'all like crazy to my co-workers / trading partners.  Feeling lots of gratitude that Uncle Google turned me on to your community.  Looking forward to paying it forward!

Edited by James00trades

Share this post


Link to post
Share on other sites

@Justin My suspicions were confirmed.  Before the order triggers my 'trigger window' shows the stop and the limit order at the same price level.  Once the order hits, the correct stop then shows up in my order window.  And it worked like a dream for managing risk across multiple tickers this morning!

A couple follow-up questions about your experience working with it:

  • Have you discovered any way to make this script work during extended hours?
  • Instead of the entry triggering a stop order, have you ever played with it triggering a range order?

Share this post


Link to post
Share on other sites

@Justin ahh, I think I understand now. The initial range is the range will be accepted to enter the order, then the stop loss gets added after the initial order is placed.

I didn't get chance to try it out today but I'll give it a shot tomorrow.

Thanks again!

Share this post


Link to post
Share on other sites
1 hour ago, miked said:

ahh, I think I understand now. The initial range is the range will be accepted to enter the order, then the stop loss gets added after the initial order is placed.

Yeah you got it @miked!

1 hour ago, James00trades said:
  • Have you discovered any way to make this script work during extended hours?
  • Instead of the entry triggering a stop order, have you ever played with it triggering a range order?
  1. Yeah, it's not really possible as stop orders will not execute during extended hours
  2. I haven't but it's probably possible. You'd like it so the bottom portion of the range is where your stop should be, and the top part of the range is exiting at say... 2R?
  • Like 1

Share this post


Link to post
Share on other sites
33 minutes ago, Justin said:

 

  1. Yeah, it's not really possible as stop orders will not execute during extended hours
  2. I haven't but it's probably possible. You'd like it so the bottom portion of the range is where your stop should be, and the top part of the range is exiting at say... 2R?

1. Wasn't sure if DAS allowed some sort of 'server side' scripting so on my end it looks like a stop order, but only gets sent to the market as a limit order when triggered.

2. Yep, you got it!  I've got an open conversation with Kyle about this but figured I'd rope you into the idea as well.  What would be really great is the bottom = full sell of position and the top = a 2R partial exit of the position ... say 50% of my shares.  Fully automated 2:1 system until we've got a real winner on our hands worth managing as it climbs higher (or tanks lower for shorts)

Edited by James00trades

Share this post


Link to post
Share on other sites

@James00trades

You can definitely do a 2:1 range order in the same "part-2" hotkey, but it would be a full exit at the stop loss and 2R.

There is an alternative... But it's not great.

In a 3rd hotkey (after you've entered a position), you can have it recalculate your position and place multiple range orders down at different price levels. Have a look below - one hotkey takes your full position (118 shares) and splits it between 5 range orders at 1R-5R. It's hard to see (as they are stacked on each other) but all 118 shares should stop out at the same price of 123.48.

unknown.png

Now I said "should"; here is the real problem with the script (also the main reason it's not released). Because your stop is actually 5 separate orders, in more volatile stocks you can have some bad slippage. It also can increase your commissions a bit (mainly on smaller positions).

image.png.d8221a453c5c0d28024b2af81c3493b5.png

I know Kyle has been working with DAS, I've been working with DAS.... If they simple can provide us with a few more variables, this stuff would be easy.

  • Like 2

Share this post


Link to post
Share on other sites

Man that's exciting to hear y'all have the ear of the DAS team. Glad I made the decision to start a membership with BBT.

I appreciate you sharing some of your current work, too. In the meantime, I'm thinking the following flow would get me by just fine. Thoughts?

1. Once my 2R target is hit, a hotkey that sells half my position and cancels the stop order.

2. A second hotkey that sets a new stop at my original entry price. 

3. A third hotkey that behaves like #1, but sells my entire position and cancels the stop order from #2.

I'm certainly curious now - how do you manage your positions once this script has been triggered?

Edited by James00trades

Share this post


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

you can do 1 and 2 in the same hotkey with DAS 🙂 but do you realize that doing that effectively cancels your range order so you don't need it?

Yes, I think he's saying have this hotkey instead of the range. Like manually selling at 2R.

This will sell 50% of your position at whatever the current price is. It will cancel your current stop, and move it to break even with the remaining shares (so you can't lose any more than you've gained),

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

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Justin said:

Have a look below - one hotkey takes your full position (118 shares) and splits it between 5 range orders at 1R-5R. It's hard to see (as they are stacked on each other) but all 118 shares should stop out at the same price of 123.48.

@Justin, this hotkey would be perfect for how I'm trading right now.  Even though it isn't rubber-stamped yet, are you able to share?

  • Like 1

Share this post


Link to post
Share on other sites
6 hours ago, Justin said:

 

  1. Yeah, it's not really possible as stop orders will not execute during extended hours

I wonder if the alert-triggers-order functionality described in this video would serve as a workaround to automate orders during extended hours.  Thoughts?

 

 

Share this post


Link to post
Share on other sites
On 2/3/2021 at 4:58 PM, Justin said:

 


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

 

Mornin' @Justin I have some feedback on this script you shared.  When I hit the hotkey my previous stop did not cancel, 50% of my shares were not sold, and two stop orders were placed on the chart.  Check out the screenshots to see what happened.

Image 01 Execution Fired = Before hitting the hotkey
Image 02 LIZI Position = Total Position on LIZI after hitting the hotkey
Image 03 First Test of Script = The chart after hitting the hotkey

Ever seen this before?

01 Execution Fired.png

02 LIZI Position.png

03 First Test of Script.png

Share this post


Link to post
Share on other sites

Hmmm hard to say... it does look like it's trying to work 😛 The sell of 50% (28 shares) at the current price, the new stop at your average price for the remaining 50% (29 shares).... But the old stop should have cleared.

Did you remember to remove the + after DAY in the script?

Share this post


Link to post
Share on other sites
On 2/3/2021 at 4:16 PM, Justin said:

You can definitely do a 2:1 range order in the same "part-2" hotkey, but it would be a full exit at the stop loss and 2R.

How would you script this?  I have a hotkey for manual entry that does this, but I'd love to be able to pre-select my entry price.

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.