Partial close of position possible?!
Forums › ProRealTime English forum › ProOrder support › Partial close of position possible?!
- This topic has 29 replies, 10 voices, and was last updated 4 years ago by
UkDownUnder.
-
-
10/19/2017 at 2:40 PM #49955
I made a surprising discovery. As we all know it is not possible to close a position partially with proorder. This is at least what I thought.
But now I noticed that under special circumstances proorder DOES close positions partially – at least in backtest. I don’t know what will happen in live trading though.
In backtest PRT closes a position partially IF it is a cumulated position and you have a set profit target like SET TARGET PPROFIT 20. This will close just always the part of your position that reaches 20 pips profit and leaves the rest unaffected.
Have a look at the attached picture. You see the strategy accumulating orders and coming up to 11 contracts maximum. And now look at the closes! I thought the whole 11 contracts would be closed at once BUT very wrong. In the backtest 4 contracts close on 14th may (all 4 at different price levels!!), on 15th close another 3, on 16th 2 more and the remaining 2 are closed on 27th because price drops under the trailing SL.
This was EXTREMELY unexpected for me and I’m still unsure what to expect in live trading.
10/19/2017 at 3:43 PM #4997210/19/2017 at 3:55 PM #49974So I guess you could BUY or SELLSHORT several positions using STOP or LIMIT orders at the same price? You can then close out one position at a time which is almost like partially closing out some of one larger position. Obviously your minimum stake would be higher than the minimum for that market.
10/19/2017 at 4:28 PM #49979So I guess you could BUY or SELLSHORT several positions using STOP or LIMIT orders at the same price?
Possible..
You can then close out one position at a time
How?
10/19/2017 at 4:34 PM #49980I also don’t see yet how one can make use of this fact but i thought it is interesting und it was definitely unexpected for me.
So basically we can summarize one can set individual targets and stops for every accumulated part of an order but using standard buy/sell orders will always close the whole position.
10/19/2017 at 4:44 PM #4998110/19/2017 at 4:59 PM #49982I think it should work if you set target and stop always directly after opening a position. When cumulating is activated PRT obviously takes the set target and stop only for the last addition to the cumulated position.
Then I see no possibility to influence this stops or targets for the different parts of a cumulated order. You always can only manipulate the stop and target for the last part that you opened at tradeindex(1). So one can set this stops and targets and leave them in the market and can have an additional SL for the whole position (or what is left).
10/19/2017 at 5:13 PM #49983I remember writing strategies in probacktest with the defparam cumulate orders = true and going for partial closure before being able to use the “graph” function, imagine the nightmare trying to debug rebuilt acpu’s corrected of partial gains without graphing it, to go around the prt position centric entry price… Partial close was working then with “at market” and pending “at stop” and “at limit” orders, it even worked with a stored variable rather than a number for contract numbers (as long as it was an integer, haven’t tried again since decimal orders are possible), but we never could choose which one was closed, we could only manage a total number of opened positions varying with all the adding and substracting and re-adding of contracts. Imagine the disappointment when first going live without knowing yet partial close doesn’t work live, and going back to semi-manual trading from indicators at the time…
10/19/2017 at 5:21 PM #4998410/20/2017 at 9:51 AM #50033When cumulating is activated PRT obviously takes the set target and stop only for the last addition to the cumulated position.
No. If you SET TARGET, it will affect all opened positions, sorry 😐
10/20/2017 at 10:44 AM #5004310/20/2017 at 11:13 AM #50050I now eliminated all SET instructions (both SET TARGET and SET STOP) from the code and the result changes significantly.
Please have a look at the attached picture. The lower code (blue and orange symbols) utilizes the set command while the upper (turkos and pink symbols) does not. Beginning with march 8th both strategies accumulate long contracts BUT the set version closes at four different days parts of the position (with set target).The pink/turkos strategy without set command can’t do so and closes the whole position (5 contracts) on april 10th. The orange/blue strategy has the same stop loss and also closes the position on 10th april but has at this time only 2 contracts left because of closing 4 contracts in-between (and actually also buying a new contract because falling under max positionsize).
Anyway Nicolas, I think this is only explainable with the set command only selling the last addition to a position. If you have another explaination I’m keen to hear it.
10/20/2017 at 12:22 PM #50061Yes, these are positions with the same take profit in points from their opened prices which is fully compliant with what I have in mind 🙂 But Set target will give the same take profit for each order (from their opening prices).
10/20/2017 at 1:06 PM #5006410/20/2017 at 1:47 PM #50070 -
AuthorPosts
Find exclusive trading pro-tools on