Set a target profit x% from the average position price.
Note: the % profit is calculated and placed individually for each order with IG or PRT-CFD.
Syntax:
1 |
SET TARGET %PROFIT x |
Example :
1 2 3 4 5 6 7 8 9 |
myMACD = MACD[12,26,9](close) long = myMACD crosses over 0 IF NOT LongOnMarket AND long THEN BUY 1 CONTRACTS AT MARKET ENDIF //set a target profit at 2% from the average position price SET TARGET %PROFIT 2 |
About the note above: “Note: the % profit is calculated and placed individually for each order with IG or PRT-CFD.”
Do I understand it correctly that it works like this:
CUMULATEORDERS = trueSET TARGET %PROFIT 2
One position is bought at 1000. Take profit level to this position will be 1020.A new position is bought at 1010. Take profit level to this position will be 1030,2.
Price reaches 1020. The first position is closed with profit 20.Price reaches 1030,2. The second position is closed with profit 30,2.
Is this correctly understood?
Yes this is the behaviour of this specific instruction with IG trade protocol.
nicolas so using %profit with cumulative orders you will see different results in backtesting vs live ig trades??
I think it has been changed since, but you can easily test the %profit of each order in a backtest and see how it behaves now.