kimfarr83
-
Content Count
13 -
Joined
-
Last visited
Posts posted by kimfarr83
-
-
-
Hello All,
Just an update, managed to make the hotkey work as I needed but only for entering a new short position.
1. To Close the current long trade, workout the the new amount of shares/fixed risk to go short, and execute, I am using the following. Basically I just added the bold part to Kyle's hotkey:
StopPrice=Price+0.01;DefShare=BP*0.97;Price=Price-Bid+0.01;SShare=75/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share+Pos;TogSShare;ROUTE=SMRTL;Price=Bid-0.05;TIF=DAY+;SELL=Send;DefShare=0;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.05 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY+;
2. I have a problem though when covering the short and opening a long trade, as current Pos would be a negative value and it actually subtracts instead of adding to the total. Would be nice to have an ABS(Pos) function, or another way to do it maybe in DAS.
Thanks a lot to everyone. Maybe there is a simple solution.
Kim
-
5 hours ago, pjjsfv said:Hi Kim,
if you're looking to flip your short position to a long position (i wouldn't recommend it) but here is the code for it:
Flip SHORT to LONG position
CXL ALLSYMB;ROUTE=SMRTL;Share=Pos*2;Price=Ask+.05;TIF=DAY+;BUY=Send
Flip LONG to SHORT position
CXL ALLSYMB;ROUTE=SMRTL;Share=Pos*2;Price=Bid-.05;TIF=DAY+;SELL=Send
I hope this helps.
Peter
Hello Peter,
Thanks for your reply but no I do not want to just flip the position with same amount of shares, as the stop (according to my fixed risk) would not be a technically good one.
Let say I am left with 100 shares from a previous short trade, and now my strategy is giving me a signal to go long.
The hotkey to go long, with particular fixed risk,(which I have and works great) calculates that it needs to buy 250 shares.
Now, I need one hotkey (which would be 2 of Kyle's hotkeys but merged) which takes the 250 shares long and adds another 100 shares so that it covers the current open short trade too.
This way, apart from opening the long position, based on my strategy, the short position is also closed automatically.
Thanks a lot in advance, all the help is greatly appreciated.
Thanks
Kim
-
Hello All,
Hope all of you are well.
I've got a hopefully easy fix question for those who might have it already. I would like to have a close and flip position hotkey please.
Scenario:
Step 1: Lets say I am short and want to cover my position and therefore I use the following hotkey from Kyle:
CXL ALLSYMB;Route=SMRTM;Share=Pos;Price=Ask+0.05;TIF=DAY+;BUY=Send;
Step 2: Now I would like to enter a long position with fixed risk, therefore I double click my stop loss price on the chart and use the following Kyle's hotkey:
StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=75/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=0;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.05 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;
Question: Is it possible to have the above 2 steps in one single hotkey please?
Basically, I just need to get the amount of shares held in the current short, and add that number to the result of the long entry hotkey (step 2), before it is actually executed. That way the short is covered and a fixed risk long is opened.
Appreciate all the help.
Thanks in advance and good day,
Kim
ProRealTime and IBKR
in Day Trading Hardware, Software and Tools
Posted
Cool I see, thanks lot for the quick reply