I spend the whole day trying something simpler than the difficulties experienced above and I didn't get it right. (Btw, anyone an idea how to significant reduce the incredible NinjaScript learning curve? )
Anyway, I've created an indicator which draws an arrow above the bar when the high is higher than the MAX(High, 9) value. So with every new high for an period, there is an visual signal. My problem/question is: how can I calculate the numbers of bars between two signals? (i.e. between two tops)
I've searched this forum and read the various discussions regarding 'counting' of bars, but I'm even more confused than when I started.
Here's what I have so far:
if (CurrentBar < 5)
return;
if( High[1] >= MAX(High, 9)[1] && High[0] < MAX(High, 9)[0])
{
DrawArrowDown("TopSignal" + CurrentBar, true, 0, High[0] + (Range()[0] / 3), Color.Red);
}
I've tried to initialize an new variable in which to store the currentbar value, and in such a way tried to calculate the numbers of bars between that variable and the CurrentBar value. I didn't get that to work.
Anyone perhaps have an idea which can help me out?
Regards,
Comment