Jump to content
bjaffry

Having hotkey issues related to scaling out and updating stop

Recommended Posts

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

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.