Alert -- If Realtime Data is Disconnected between time

Questions about MultiCharts and user contributed studies.
Tibouss
Posts: 31
Joined: 26 May 2022
Has thanked: 7 times
Been thanked: 1 time

Alert -- If Realtime Data is Disconnected between time

Postby Tibouss » 13 Mar 2024

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

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

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

Postby TJ » 14 Mar 2024

Why are you using intrabarpersist ?

Tibouss
Posts: 31
Joined: 26 May 2022
Has thanked: 7 times
Been thanked: 1 time

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

Postby Tibouss » 15 Mar 2024

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.

Tibouss
Posts: 31
Joined: 26 May 2022
Has thanked: 7 times
Been thanked: 1 time

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

Postby Tibouss » 02 Apr 2024

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;


Return to “MultiCharts”