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.

Jason Brumm

Hot Key Question

Recommended Posts

Jason Brumm

Here is my Buy 1:3 risk $1 hot key script:

ROUTE=SMRTL;Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:AvgCost2-1.0 HighPrice:AvgCost2+3.0 ACT:SELL QTY:POS TIF:DAY+

So what I am trying to do is configure this to be a 1:2 range order which is easy and I can do that but I want it to only sell half my POS at 2r but if it stops me out the whole POS is liquidated.  When I change the current ACT: SELL QTY: POS to *.5 it sets the whole range order to half of my default position size so it sell 50% at the target profit but if it goes against me it only sells 50% of the position when I want it to stop out the full position set in the range.

Any ideas would be great

 

 

 

Share this post


Link to post
Share on other sites
Jason Brumm

OCO Is what DAS said Thanks

Share this post


Link to post
Share on other sites
KyleK29
2 hours ago, Jason Brumm said:

ROUTE=SMRTL;Price=Ask+0.10;TIF=DAY+;BUY=Send;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:AvgCost2-1.0 HighPrice:AvgCost2+3.0 ACT:SELL QTY:POS TIF:DAY+

In the latest versions (5.5.2.1 and above) of DAS you can do this with a hotkey. Test this in your SIM account:

ROUTE=SMRTL;Price=Ask+0.10;TIF=DAY+; OCO=RT:STOP STOPTYPE:MARKET PX:AvgCost-1.0 STOPPRICE:AvgCost-1.0 ACT:SELL QTY:Pos TIF:DAY+; BUY=Send; TriggerOrder=RT:STOP STOPTYPE:RANGE PX:AvgCost-1.0 LowPrice:AvgCost2-1.0 HighPrice:AvgCost2+3.0 ACT:SELL QTY:POS*0.5 TIF:DAY+;

This would create an order setup like this:

  • Open a position 
  • When the position opens, create two Open Orders pending with:
    • STOP Order for 100% out at the StopPrice of AvgCost-1.00
    • STOP RangeOrder for 50% out at the LowPrice of AvgCost-1.0 and HighPrice of AvgCost+3.0
  • These STOP orders are linked together, if either triggers it will cancel the other one. Keep in mind that if the RangeOrder for 50% triggers it will cancel out the other STOP order, and you'll need to create a new STOP order for your remaining position.

 

Alternatively, you can do it this way as well:

ROUTE=SMRTL;Price=Ask+0.10;TIF=DAY+; BUY=Send; TriggerOrder=RT:STOP STOPTYPE:RANGE PX:AvgCost-1.0 LowPrice:AvgCost2-1.0 HighPrice:AvgCost2+3.0 ACT:SELL QTY:POS*0.5 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:RANGE PX:AvgCost-1.0 LowPrice:AvgCost2-1.0 HighPrice:AvgCost2+5.0 ACT:SELL QTY:POS*0.5 TIF:DAY+;

This would create an order setup like this:

  • Open a position
  • When the position opens, create two Open Orders pending with:
    • STOP Range Order for 50% out at the LowPrice of AvgCost-1.0 and HighPrice of AvgCost+3.0
    • STOP Range Order for 50% out at the LowPrice of AvgCost-1.0 and HighPrice of AvgCost+5.0
  • If one of these orders is hit, the other still remains for the remainder of the position.
  • As an important note, keep an eye on the Position Qty for these orders. Rounding errors doing Pos*0.5 could cause the two orders to not add up to exact 100% of your positions (e.g. if your position is 51 shares, both maybe qty: 25, you'd have 1 share unaccounted for). To move a STOP up the chart, you'd need to drag both orders.

 

When I finish the new Dynamic Hotkey configurator tool, it'll take these rounding errors into account and adjust the script accordingly. 

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
Jason Brumm

Thanks KYLE I need to make sure I have the latest version it's doing the same thing as before.  Ill get back to you on this after lunch.  Seriously thanks for responding with a possible solution!!!
 

Share this post


Link to post
Share on other sites
Jason Brumm

Kyle I updated to the latest version and I am getting this. hen when I click ok it sets a range order of 50% of the default share size on my TMP

image.png.6f56d04624a596a3925a1dfa68659e59.png

Edited by Jason Brumm

Share this post


Link to post
Share on other sites
KyleK29
55 minutes ago, Jason Brumm said:

Kyle I updated to the latest version and I am getting this. hen when I click ok it sets a range order of 50% of the default share size on my TMP

image.png.6f56d04624a596a3925a1dfa68659e59.png

I made a tweak to the scripts above, I forgot about that bug. 

If a Trigger Order doesn't have a PX value defined, it causes this error .. even if it doesn't use the PX value (you only use it with Limits and Stop Limits).

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
Jason Brumm

Hey Kyle, sorry for the delayed response did you edit the scripts above or is there a thread I am missing.  Got the ole Covid Vaccine on thursday and I have been a little under the weather since.   Thanks for your help here

Share this post


Link to post
Share on other sites
Jason Brumm

KYLE! ok so I read back through your notes and found the edited script.  So it sets 2 range orders both of which sell at your 1r risk if its goes against you and fills and subsequently cancels the high end of the range.  If you go ITM, the first range order sells at 2r and clears leaving the 2nd range order that is 4r with the remaining 50% of your position set to sell all out if hit.  It's a beauty because you can then slide up the low range of your R to wherever you want it and it keeps your final tp set(which can also slide too).I have an active trade going with it so very interested to see how it performs and will report back but so far its amazing!  Thank you

 

Edited by Jason Brumm

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.