Page 1 of 1

Alert -- If Realtime Data is Disconnected

Posted: 10 Jan 2013
by Henry MultiŠ”harts
Here is a sample code to check for absence of realtime data:

Code: Select all

[IntrabarOrderGeneration = true]
 
Vars: intrabarpersist counter(0);
Recalclastbarafter(5);
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.

Image