Alert -- If Realtime Data is Disconnected

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
User avatar
Henry MultiСharts
Posts: 9047
Joined: 25 Aug 2011
Has thanked: 1250 times
Been thanked: 2905 times

Alert -- If Realtime Data is Disconnected

Postby Henry MultiСharts » 10 Jan 2013

Here is a sample code to check for absence of realtime data:

Code: Select all

[IntrabarOrderGeneration = true]
Vars: intrabarpersist counter(0);
counter = IFF(getappinfo(aicalcreason) = calcreason_timer, counter + 1, 0);
if counter > 6 then alert("No realtime > 30 sec");

Create a new signal, paste this code and compile it or import the attached pla file.
Once you add it to your chart make sure you have alerts enabled in Format->Strategy properties->Alerts tab.
Set the Alert Conditions Check selector to Every Tick. More info on the strategy alerts in the Wiki.
The code will generate an alert of the selected type intrabar if there is no realtime data for more than 30 seconds.

No realtime data alert.png
No realtime data alert.png (5.15 KiB) Viewed 4335 times
No realtime data alert.pla
(1.5 KiB) Downloaded 537 times

Return to “User Contributed Studies and Indicator Library”