Hi,
I have written a piece of code, I would like to test an idea. This indicator should check the trend, there is a NonLagMA with filt, and then check if the trade done is correct or not.
I mean NonLagMa indicates up trend (color[period-59]=color.Up and color[period-60]=color.DN) then I suppose at period 59 to open trade, and then I check if current close price is > than the price at which I have opened the trade.
So the indicator at current period checks if 59 period ago there is a sign of changing in the trend and then checks if the current price is > than the price of opening. The opposite for short trades.
I don't open trade I just want to test if the direction supposed is correct. And I have to test for every period what happened a number (choosen by you, could be any number 59, 21, 74,...) of period before the actual.
Please check also if NonLagMa is repaint, It doesn't seems to be repainted, but I don't know exactly.
I have written the indicator but there is something not working.
Please, have a check.
The indicator should display the number of trades correctly supposed, and the number of trades wrong. If it is possible display entry, exit with arrow.