So what is your question exactly
Hi
IsNewSession() should return [true] value only once when
if(cATS.checkTimeCross(vHour,vMinute,vCurrTime,vPrevTime))
returns true for a given timeStamp for example Asian Session started at [2024.02.01 01:01:00] and it was crossed at vCurrCross[2024.02.01 01:02:00] should return true.
Next cPrevCross would be now set at [2024.02.01 01:02:00] and when London session open [2024.02.01 10:00:00] and is crossed at [2024.02.01 10:01:00] should return true.
Next cPrevCross would be now set at [2024.02.01 10:01:00] and when New York session open [2024.02.01 15:00:00] and is crossed at [2024.02.01 15:01:00] should return true.
Hope this make my requirements clearer.
UPDATE ...
Hi I am having some success with OnTimer() functions to get NewSession detection.
Please ignore this thread for time being. If I fail with OnTimer() too, I will restart the thread again.
Thanks.
I use bool.
Assign Asian = 0.
if (Asian Flag ==0 && New Asian Session) then Asian = 1.
Then after a few hours , or when vHour=0, you can reset the Asian Flag back to 0.
I use bool.
Assign Asian = 0.
if (Asian Flag ==0 && New Asian Session) then Asian = 1.
Then after a few hours , or when vHour=0, you can reset the Asian Flag back to 0.
Thanks Chijioke
Its seems good workaround way :) Will give it a try if OnTimer() does not work well.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Wishing all a happy weekend.
I have coded a IsNewBarSession, which is supposed to return true at first cross of timeStamp with cATS.checkTimeCross(vHour,vMinute,vCurrTime,vPrevTime).
I could not apply a proper logic/condition to return [false] if timeStamp have been crossed.
For Asian Session start multiple [true] are marked with "IsNewSession[true] ... Should not detect this".
The next [true] should be when LON session starts and next when [NYC] session starts.
Thanks in advance and looking for solution from Gurus :)
Regards.