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.
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.
Warning: Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced clients who have sufficient financial means to bear such risk. The articles, codes and content on this website only contain general information. They are not personal or investment advice nor a solicitation to buy or sell any financial instrument. Each investor must make their own judgement about the appropriateness of trading a financial instrument to their own financial, fiscal and legal situation.