Jump to content
Ákos Maróy

update hard stop when partialing out

Recommended Posts

1 hour ago, Gforce1 said:

 

@JustinI tried your hotkey to sell x% of shares that you posted above.  However I'm getting a problem. So I changed your hotkey code to 0.75 to sell 25% of my shares and move my stop to break even.  It works perfectly the first time I use the hotkey but when I want to sell another 25% and move stop to break even it doesn't work.  When I use it the second time it sells my whole position. Do you know what I'm doing wrong?

Hey Gforce, you would want to set it to 0.25 to sell 25% of your shares. And you're saying you hit the same hotkey twice and it exists your position? Unless you have only 1 share remaining... I'm not quite sure why.

If you had 100 shares to start and you hit the hotkey below twice, it should go to 75 then 56 (rounded down).

CXL ALLSYMB;Route=LIMIT;Share=Pos*0.25;Price=Ask+0.05;TIF=DAY+;BUY=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos+share;TIF=DAY+;BUY=SEND

Share this post


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

Hey Gforce, you would want to set it to 0.25 to sell 25% of your shares. And you're saying you hit the same hotkey twice and it exists your position? Unless you have only 1 share remaining... I'm not quite sure why.

If you had 100 shares to start and you hit the hotkey below twice, it should go to 75 then 56 (rounded down).

CXL ALLSYMB;Route=LIMIT;Share=Pos*0.25;Price=Ask+0.05;TIF=DAY+;BUY=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos+share;TIF=DAY+;BUY=SEND

Is the above script to Buy?  I just tried it and it added to my position.

Share this post


Link to post
Share on other sites
12 minutes ago, Gforce1 said:

Is the above script to Buy?  I just tried it and it added to my position.

No, the above script was if you were short a position and wanted to cover.

You can tell by the end of the script when it says "BUY=Send" that will buy shares (because you are short). You want it to say "SELL=Send" when you are long to sell.

This is for long partial 25%:

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

Share this post


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

No, the above script was if you were short a position and wanted to cover.

You can tell by the end of the script when it says "BUY=Send" that will buy shares (because you are short). You want it to say "SELL=Send" when you are long to sell.

This is for long partial 25%:

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

Ok so I tried this 25% partial, it worked on the first partial.  For example I went long 230 shares, then it brought me down to 172 shares.  When I pressed the same hotkey again it sold my whole position. Not sure why this is happening. Have any Ideas?

 

Thanks.

Share this post


Link to post
Share on other sites

Unfortunately I don't... I just tried the hotkey, and it works like it should. Do you have any risk controls set up? Could be useful to see your log to see what is being executed and any messages it may give.

Unless someone else can figure it out, I might try asking DAS support.

Share this post


Link to post
Share on other sites
On 5/26/2020 at 4:47 PM, Justin said:

Unfortunately I don't... I just tried the hotkey, and it works like it should. Do you have any risk controls set up? Could be useful to see your log to see what is being executed and any messages it may give.

Unless someone else can figure it out, I might try asking DAS support.

Well my first buy order is with Kyle's hotkey. I use a $30 risk to enter a trade.

Share this post


Link to post
Share on other sites

Hey Gforce, 

 

I'm new to this but believe had the same issue. The problem stems from the fact that when you hit the button second time and the price has not moved enough away from your stop, it basically stops you out. Make sure you try the second press when there is a sufficient price gap, that you don't get stopped out. 

  • Like 1

Share this post


Link to post
Share on other sites
On 5/20/2020 at 9:07 AM, Justin said:

Hey Akos,

This is what you're looking for - It will move your stop loss to break even. Let me know if you don't want that for some reason though. You'll need to change the bolt parts to suit you; Route= for your own broker and the Share=Pos* for how much you want to scale out.

Short Scale Out 50%
CXL ALLSYMB;Route=LIMIT;Share=Pos*0.5;Price=Ask+0.05;TIF=DAY+;BUY=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos+share;TIF=DAY+;BUY=SEND

Long Scale Out 50%
CXL ALLSYMB;Route=LIMIT;Share=Pos*0.5;Price=Bid-0.05;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=DAY+;SELL=SEND

What would be the correct route for centerpoint ?  not updating the stop for me.  thanks 

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.