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.

bjaffry

Having hotkey issues related to scaling out and updating stop

Recommended Posts

bjaffry

Hello,

I am trying to create a hotkey button which sells/covers x% of my position, cancels my stop loss order, and sends a new stop loss order for break even and updates new position size. 

 

Here is an example of the script that I am using for selling 30% of my position.

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

 

The issue with this script is when I press the button, it works once. The second time I press it, it doesn't update my position size. 

 

Can anyone correct my script or share a script that does the same function? 

 

Thank you

Edited by bjaffry

Share this post


Link to post
Share on other sites
Paul aka Aurbano

hello @bjaffry, that scripts achieve several targets in the process :

  1. Deletes all orders for the ticker.
  2. Opens a new limit order for 30% of the position @ bid-0.05 (DAY+)
  3. Opens a new market stoploss order for the position @ avg price (GTC)

I'd check 3 things :

  • Share = Post-share >> are you sure that calculation is right ?
  • TIF ... double check if you need to make them both "DAY" or "GTC".
  • Mouse or focus position. Check if you need to click in your chart before pressing the hotkey.
Edited by Paul aka Aurbano
check

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.