Unexpected behavior of set target
08/12/2017 at 5:09 PM #43093
I just noticed an unexpected behavior of the set target function.
I was writing a strategy with cumulateorders=true. The strategy bought a contract and afterwards set a target with set target pprofit 100. After the position was 20 points in profit another contract was bought, no change to the target. Then came the surprise, the positions were (at least in backtest) sold not at once like i expected (i expected that both contracts would be sold 100 points above the cumulated positionprice) but one contract at a time, each after 100 points profit. So this means PRT was actually closing the position only partially. I thought this was impossible.08/12/2017 at 7:29 PM #43096
Well, you are the expert here, but with cumulateorders I think each orders values are calculated on basis of the price where it is activated, so the second order would also have pprofit 100 which is then higher as the one of the first order and for closing also later. And I am not sure whether a cumulated order is viewed as one single position or as a set of several positions within the whole strategy. Just my 2c.08/12/2017 at 10:17 PM #43099
Well obviously it is so that PRT assigns different TP to the different contracts. I thought this is a little bit surprising since it is otherwise impossible to close a position partially.