Is it possible to generate an alert when autotrading drops?
When "SA" is selected and goes green I want to be able to generate an alert when it gets disconnected i.e goes back to grey from green. Is this possible?
I am using MC7.0 Release4953
Alert when Autotrading Drops?
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Alert when Autotrading Drops?
see thisIs it possible to generate an alert when autotrading drops?
When "SA" is selected and goes green I want to be able to generate an alert when it gets disconnected i.e goes back to grey from green. Is this possible?
I am using MC7.0 Release4953
viewtopic.php?f=5&t=9890
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Alert when Autotrading Drops?
And with MC 8.0 beta 2, it's also possible to code the Alert directly into the signal, so that the additional indicator isn't necessary any more:
Source: MC BlogAlerts in Signals (Strategies)
There are now alerts available for signals (strategies). You can use sounds, visual or email alerts to get notified about orders and position changes. More info here -https://www.multicharts.com/pm/viewissue.php?issue_no=MC-319.
Re: Alert when Autotrading Drops?
Here is what I have used (Code referred to by TJ and I have an added an email Alert use a custom dll and BLAT - search for BLAT on these forums to find out where you can get it)
Code: Select all
if (LastBarOnChart_s = True) then begin
atsStatus = GetAppInfo(aiStrategyAuto);
//mp = MarketPosition(0) * CurrentContracts;
{ If your broker (IB, ZF, Pats) supports it, you might want to replace the line above with the
line below. However, keep in mind that:
"If Automated Trading was manually turned off by the user, the value returned
by the keyword stops changing, and may remain unequal to '0'." (Source: Helpfile)
mp = MarketPosition_at_Broker;
}
// If the current ATS Status differences from the previous, and the previous
// status was ON, give an alert
if (atsStatus <> PrevATSStatus) and (PrevATSStatus = 1) then begin
// If there was a MarketPosition on the previous update, we need to raise a big alarm
//if (PrevMP <> 0) then
PlaySound("C:\Temp\atsOffWithOpenMP.wav");
text_to_write = getsymbolname +", AutoTrading Has been disconnected! ";
subj = "Alert! : "+getsymbolname +", AutoTrading Has been disconnected! ";
msg = " START c:\blat -to "+TraderList+" -subject "+DoubleQuote+subj+DoubleQuote+" -body "+DoubleQuote+text_to_write+DoubleQuote;
//Print(msg);
value1 =callShell(msg);
// ... else a lighter alert would be needed
//else
// PlaySound("C:\Temp\atsOffNoMP.wav");
end;
PrevATSStatus = atsStatus;
//PrevMP = mp;
RecalcLastBarAfter(RecalcAfter);
end; //: LastBarOnChart_s = True