the problem is your indicator, it has lag
don't waste your time, forget this indicator.
all indicators have this problem
and it is impossible to solve this
I really don't know how to help you see this indicatory weakness,
I can see in the chart, I wonder why u can not notice it
if u had problem with backtest: remove this part:
/* if(accountEquity/accountBalance<=DrawDown && closeAll==false)
{
closeAll=true;
Print("Equity Drawdown is over the limit and closed all orders");
} */