Reply To: Backtest – Dynamic Trailing Stop

Optuma Forums Optuma Scripting Backtest – Dynamic Trailing Stop Reply To: Backtest – Dynamic Trailing Stop

#54431
AvatarMerrilee
  • Topics: 6
  • Replies: 14
  • Posts: 20

Hi Matthew and thanks for your reply.

Yes, I have tried to apply the ATRTSCAN script as above to a Show Plot and it shows nothing – I seem to remember reading somewhere that ATRTSCAN will only work in the Stops section of the Backtester.

Below is the working script I use on my charts for the trailing stop:-

a30 = ATR(BARS=10, MULT=1.00);

a10 = ATR(BARS=10, MULT=5.00);

a1 = if(ROC(BARS=52) > MA(ROC(BARS=52),BARS=8, CALC=Close, STYLE=Exponential), a10, a30);

c1 = HIGH() – a1;

RATCHET(c1, START=2019-02-08)

But, the trailing stop is dependent on the START date, so how do I code the START date to automatically reflect the different dates of entry in the Backtester?

Many thanks

Merrilee

 

 

Pin It on Pinterest