Alert -- If Realtime Data is Disconnected
Posted: 10 Jan 2013
Here is a sample code to check for absence of realtime data:
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.
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");
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.