Jump to content
Julien Maisan

Add hotkey with same risk amount

Recommended Posts

Hello All,

I would like to have an Add hotkey calculating automatically my share size based on my actual size and my new stop loss to increase my existing position.

All that is based on Aiman trading style building up a position when the trade goes his way.

I think the script could be based on Thor's free-roll hotkey as he uses his unrealized to calculate automatically an add (see his script below) ; on my side, I would like to use my unrealized (potentially positive or negative depending on my initial entry) + my fixed R risk amount (let's say 10$) >> I think it should be possible tweaking a bit Thor's free-roll but I could not make it.

If anybody could help me, that would be very nice.

Thank you all !

Julien

Thor's free-roll for a long entry :

CXL ALLSYMB;StopPrice = Price;Share=Price*100;Price=AvgCost;SShare=Price*100;Share=Share-SShare;Price=Share;Price=Share/100;Share=Pos * Price;Price=Ask-StopPrice;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare;Price=Ask+0.02;TogSShare;TIF=DAY+;ROUTE=SMRTL;BUY=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

Share this post


Link to post
Share on other sites

If I understand you correctly .. it's this scenario:

1) You enter a position, 100 shares at 10.00, stop at 9.00 (100 $risk).
2) As time goes on, you move your stop up to 9.50 (your new risk is $50), you want it to calculate the shares necessary to add the missing $50 risk at the current Last Price to get your risk back to $100.

 

I have a hotkey that does this that I created around the same time I did Thor's. It just isn't out yet. I won't be releasing it until likely next month as it's still being tested. 


---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites

Hey guys,

I finally did it by myself and tested it the last 2 months (in SIM and then live) and it works pretty well ; here are the scripts :

 

To add 10$ risk LONG :
CXL ALLSYMB;StopPrice = Price;Share=Price*100*Pos;Price=AvgCost;SShare=Price*100*Pos;Share=Share-SShare+1000; Price=Share/100;Share=Price;Price=Ask-StopPrice;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare;Price=Ask+0.02;TogSShare;TIF=DAY+;ROUTE=LIMIT;BUY=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;
 
To ass 10$ risk SHORT :
CXL ALLSYMB;StopPrice = Price;Share=-Price*100*Pos;Price=AvgCost;SShare=-Price*100*Pos;Share=Sshare-Share+1000; Price=Share/100;Share=Price;Price= StopPrice-Bid;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare;Price=Bid-0.02;TogSShare;TIF=DAY+;ROUTE=LIMIT;SELL=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY+;
 
As usual, you have to change the route from LIMIT to SMRTL if you trade with IB, and the risk amount is multiplied by 100 in the hotkey script, so you just have to change the underlined and bold 10.
 
Just one additional important point, it only works when your new stop loss and your new entry are in the direction of your trade, which anyway corresponds to your add strategy. However, if you select a wider stop for your add (which is theoretically impossible if you want to keep the same R amount), it still calculates a nb of shares (because one of the field used in the script automatically transforms negative values in positive ones)
 
I hope it helps.
 
Do not hesitate to reach out if necessary.
  • Like 1

Share this post


Link to post
Share on other sites

@Abdul @Julien Maisan @Abdul Sultani  Hello Gentleman, did anyone get this working? I trade similar and scale into my positions, it is horribly inefficient for me to enter my position then have to use excel to figure out my adds and new stops lol I usually add 4 or 5 time to my short position (primarily short bias). Would appreciate all and any help, and will pay to get this script.

Share this post


Link to post
Share on other sites
On 12/10/2020 at 11:39 AM, KyleK29 said:

If I understand you correctly .. it's this scenario:

1) You enter a position, 100 shares at 10.00, stop at 9.00 (100 $risk).
2) As time goes on, you move your stop up to 9.50 (your new risk is $50), you want it to calculate the shares necessary to add the missing $50 risk at the current Last Price to get your risk back to $100.

 

I have a hotkey that does this that I created around the same time I did Thor's. It just isn't out yet. I won't be releasing it until likely next month as it's still being tested. 

Hello Has this script been released? I am looking for this one and will pay for it. I short stocks and I keep R fixed and add in the money  + move my stop, 3 to 4 times. It would be amazing if i could execute with the hot key instead of doing the calculations in excel then manually entering. Thank you!

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.