Jump to content
rinran

Kyle's hotkey question

Recommended Posts

So Kyle's HKs work very well, except for a little issue. When the stop loss is initially set for the position, lets say for 1000 shares, it doesn't update after partials are taken. So if the stock goes in my direction, and I take a 25% partial, I have 750 shares left. BUT the stop loss is still stuck at 1000 shares. So if it comes back and tags me, it also buys me in for 250 shares. Any way to fix this? I'm using DAS Trader Pro simulator with real-time data, the $150/month package.

This is the script I'm using for the long side:

StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY;BUY=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.05 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY;

Short side:

StopPrice=Price+0;DefShare=BP*0.925;Price=Price-Bid+0.00;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price=Bid-0.05;TIF=DAY;SELL=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.05 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY;

Short side SSR:

StopPrice=Price+0;DefShare=BP*0.925;Price=Price-Bid+0.00;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price=Bid+0.01;TIF=DAY;SELL=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.05 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY;


IF YOU FOUND MY COMMENT HELPFUL 👍, PLEASE HEART IT 🤎, IT MEANS A LOT 🙂

Share this post


Link to post
Share on other sites

When you partial you need to reset your stop loss. Most people will reset their stop loss to breakeven (where you entered) so that you can't lose your gains.

This will cancel your stop loss and reset it to breakeven with the remaining position:
CXL ALLSYMB;Route=Stop;StopType=MARKET;STOPPRICE=AvgCost;StopPrice=Round2;Price=StopPrice-0.3;Share=Pos;TIF=DAY+;REVERSE=Send;

You can also add it on the end of a partial to do it automatically. This is selling 50% of your long position and then resetting your stop loss with the remaining shares:
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=GTC;SELL=SEND

Same thing but for a short position:
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=GTC;BUY=SEND

 

  • Like 2

Share this post


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

When you partial you need to reset your stop loss. Most people will reset their stop loss to breakeven (where you entered) so that you can't lose your gains.

This will cancel your stop loss and reset it to breakeven with the remaining position:
CXL ALLSYMB;Route=Stop;StopType=MARKET;STOPPRICE=AvgCost;StopPrice=Round2;Price=StopPrice-0.3;Share=Pos;TIF=DAY+;REVERSE=Send;

You can also add it on the end of a partial to do it automatically. This is selling 50% of your long position and then resetting your stop loss with the remaining shares:
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=GTC;SELL=SEND

Same thing but for a short position:
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=GTC;BUY=SEND

 

Thanks Justin, that's what I was looking for!

  • Like 1

IF YOU FOUND MY COMMENT HELPFUL 👍, PLEASE HEART IT 🤎, IT MEANS A LOT 🙂

Share this post


Link to post
Share on other sites
On 3/12/2020 at 1:24 PM, rinran said:

So Kyle's HKs work very well, except for a little issue. When the stop loss is initially set for the position, lets say for 1000 shares, it doesn't update after partials are taken. So if the stock goes in my direction, and I take a 25% partial, I have 750 shares left. BUT the stop loss is still stuck at 1000 shares. So if it comes back and tags me, it also buys me in for 250 shares. Any way to fix this? I'm using DAS Trader Pro simulator with real-time data, the $150/month package.

This is the script I'm using for the long side:

StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY;BUY=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.05 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY;

Short side:

StopPrice=Price+0;DefShare=BP*0.925;Price=Price-Bid+0.00;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price=Bid-0.05;TIF=DAY;SELL=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.05 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY;

Short side SSR:

StopPrice=Price+0;DefShare=BP*0.925;Price=Price-Bid+0.00;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price=Bid+0.01;TIF=DAY;SELL=Send;DefShare=200;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.05 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY;

Hey guys - Thank for you to both of you for sharing this in the forum as this has been an issue on my end as well?  That said, what hotkey are you using to exit a position completely?  When I try to use the below hotkeys they do not work with Kyle's hotkey -

ROUTE=SMRTL;Price=Bid-0.05;Share=Pos;TIF=DAY+;SELL=Send

ROUTE=SMRTL;Price=Ask+0.05;Share=Pos;TIF=DAY+;BUY=Send

Do you have a hotkey to exit the entire position and also cancel the stop?  Right now, I have to manually adjust the montage from a limit order to a market order, then change position, then sell/buy.  And I have to manually cancel my stop as well.

Thanks,

Mike

Share this post


Link to post
Share on other sites

@peterB @Justin

Hi Peter, Justin

I'm bringing this to the surface again. I'm currently in the trading simulator and I'm having the same issue as Rinran above. When I take partials either to the long/short side, my stop loss doesn't update with the number of remaining shares I have (in other words I don't want to go short/long in the opposite direction if the price goes back and hits my stop).

I've scouted the forums and can't seem to find the solution. Justin's hotkey above doesn't work for me, it just completely deletes the stop loss altogether. This is the script i'm currently using:

Long (sell 50%)
Route=LIMIT;Share=Pos*0.5;Price=Bid-0.05;TIF=DAY+;SELL=Send

Short (cover 50%)
Route=LIMIT;Share=Pos*0.5;Price=Ask+0.05;TIF=DAY+;BUY=Send

Any suggestions would be great!

Thanks,
Adrian 

 

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.