×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

GetAppInfo

1,048 bytes added, 11:33, 7 February 2012
no edit summary
The highest price on the Y axis (price scale) is 2438 and the lowest price on the same axis is 2411
</syntaxhighlight>
 
=== Using GetAppInfo to monitor an ATS ===
In the simplified example below, the GetAppInfo(aiStrategyAuto) is used to monitor the status of an [[:Category:AutoTrading|Automated Trading Strategy]]. If the ATS is turned off, a sound alert is given.
 
<syntaxhighlight>
// Example: using the GetAppInfo(aiStrategyAuto) to monitor for an Automated Trading
// Strategy that gets turned off.
 
Variables:
IntraBarPersist PrevATSStatus(0), // Holds the status of the ATS at the previous update
atsStatus(0); // Holds the current ATS status
 
if (LastBarOnChart_s = True) then begin
 
atsStatus = GetAppInfo(aiStrategyAuto);
// If the current ATS Status is different from the previous, and the previous
// status was ON, give an sound alert.
if (atsStatus <> PrevATSStatus) and (PrevATSStatus = 1) then begin
PlaySound("C:\Temp\atsTurnedOff.wav");
 
end;
 
PrevATSStatus = atsStatus;
 
RecalcLastBarAfter(15); // Update every 15 seconds, even if the data feed stops updating
end;
</syntaxhighlight>
 
[[Category:Environment Information]]