When I try to use “PRC_ATR Trailing Stop v2.1” as part of a backtest using simplified creation (i.e. Buy/Sell when slow trail crosses under/over price or alternatively under/over fast trail) I receive the following error message:
“The function “PRC-ATR Trailing stop v2.1″ returns 2 values but your code needs 3”
I am using PRT v11 on IG. What am I doing wrong I’m wondering? Any light appreciated.
Thank you.
That happens because the indicator uses DRAWCANDLE to paint empty space in between the two lines.
If you don’t mind that colouring you can comment out line 62:
//drawcandle(trail1,trail2,trail1,trail2) coloured(rtrail,gtrail,0,50)bordercolor(0,0,0,0)
or, if you need it, manually modify the created code, removing the second IGNORED from the variables left to the “=” operator with the CALL:
indicator1, ignored, ignored = CALL "PRC_ATR Trailing Stop v2.1"(close) //before
indicator1, ignored = CALL "PRC_ATR Trailing Stop v2.1"(close) //after