Page 1 of 1

Alert -- If Realtime Data is Disconnected between time

Posted: Mar 13 2024
by Tibouss
Hello

I have some trouble to make this code active only during a certain stime slot.

Actually i'm using session time between 15h to 22h but when i activate the code before 15h alerts are triggered.

I tried to add some conditions but it doesn't change anything (code below).

Code: Select all

[IntrabarOrderGeneration = true] Inputs : starttime (1500), endtime(2200); Vars: intrabarpersist counter(0); If time >= starttime and time<= endtime then begin Recalclastbarafter(5); counter = IFF(getappinfo(aicalcreason) = calcreason_timer, counter + 1, 0); if counter > 6 then alert("No realtime > 30 sec"); end;

Can someone let me know what's wrong with the code to activate it only between 15h to 22H?

Many thanks in advance

Re: Alert -- If Realtime Data is Disconnected between time

Posted: Mar 14 2024
by TJ
Why are you using intrabarpersist ?

Re: Alert -- If Realtime Data is Disconnected between time

Posted: Mar 15 2024
by Tibouss
Actually i was using the code in the thread below :

viewtopic.php?f=5&t=11715

I'm using intrabarpersist because the alert is supposed to be triggered after 30 seconds of connections loss while i'm using a 5 minutes timeframe chart.

I'm getting trouble to get this script working by code only during a certain time slot.

Re: Alert -- If Realtime Data is Disconnected between time

Posted: Apr 02 2024
by Tibouss
I found a solution, here is the code if someone is interested :

Code: Select all

[IntrabarOrderGeneration = true] Input: stime(1100), etime(1800); Vars: intrabarpersist counter(0), ii(0); Recalclastbarafter(5); counter = IFF(getappinfo(aicalcreason) = calcreason_timer, counter + 1, 0); if counter > 6 and time > stime and time <etime then begin if ii=0 then ii+=1; alert("No realtime > 30 sec"); end;