Thank you for your reply @JS
I have added your code and tested it.
Unfortunately, it is still not counting correctly.
I can best describe it with the screenshot I have attached.
Once Count = 0
StartSession=093000
EndSession=161500
If OpenTime >= StartSession and OpenTime <= EndSession then
Count=Count+1
xEven=Count/2 - Round(Count/2)
If Count > 0 and xEven=0 then
DrawText( "#Count#", BarIndex,Low-2*pipsize,SansSerif) COLOURED (153, 153, 153, 255)
EndIf
If Time = EndSession then
Count=0
EndIf
If IntraDayBarIndex = 0 then
Count = 0
EndIf
Endif
Return
JSParticipant
Senior
Hi GadeTrading,
The indicator works well for me…
I don’t see anything special on your screenshot either…
@JS
I apologize for my poor explanation.
It is because the first bar of every day needs to be bar 1 and then count from there.
I should have mentioned: In the screenshot, the days are seperated by the alternating color (grey/white). I have added some text in the screenshot to describe the problem.
@JS
Thank you for your code snippet. I found out changing count = 0 to count = 1 makes the first bar of the day bar 1 every day.
I appreciate it, as I am not good at coding.
Once Count = 0
StartSession=093000
EndSession=161500
If OpenTime >= StartSession and OpenTime <= EndSession then
Count=Count+1
xEven=Count/2 - Round(Count/2)
If IntraDayBarIndex = 0 then
Count = 1
EndIf
If Count > 0 and xEven=0 then
DrawText( "#Count#", BarIndex,Low-2*pipsize,SansSerif) COLOURED (153, 153, 153, 255)
EndIf
If Time = EndSession then
Count=0
EndIf
Endif
Return
It works like a charm now, even when are there are less bars in some days.