Alert on strategy order filled

Questions about MultiCharts and user contributed studies.
DaveAronow
Posts: 72
Joined: 20 Apr 2014
Has thanked: 9 times
Been thanked: 8 times

Alert on strategy order filled

Postby DaveAronow » 20 Jan 2016

Can MultiCharts be configured to send an email alert when a strategy order is filled (similar to what TS does)? By filled I mean when the strategy engine reports a new fill (not necessarily a live fill with a broker).

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Alert on strategy order filled

Postby TJ » 20 Jan 2016

Can MultiCharts be configured to send an email alert when a strategy order is filled (similar to what TS does)? By filled I mean when the strategy engine reports a new fill (not necessarily a live fill with a broker).
Getting MC to send an email alert
viewtopic.php?f=5&t=9890

DaveAronow
Posts: 72
Joined: 20 Apr 2014
Has thanked: 9 times
Been thanked: 8 times

Re: Alert on strategy order filled

Postby DaveAronow » 20 Jan 2016

So it seems you need to code this yourself in an indicator, this is not something MC can do on it's own like TS?

As an example, say my strategy is running 30 minute bars of ESH6, and the code says Buy At Stop Close * 1.02 (buy stop 2% above the last bar's close). Multicharts would trigger a stop order, but is there any way to have the alert sent when the 2% stop is hit?

Is there an OnOrderFilled event or something similar I can trap?

I tried testing this last night and was able to send test email alerts, but when I set up a simple system to buy at market then sell next bar at market and ran it on 1 minute bars I never got a trade filled alert. Do the alerts only go out if autotrading is enabled (I did not enable autotrading but I did enable email alerts)?

DaveAronow
Posts: 72
Joined: 20 Apr 2014
Has thanked: 9 times
Been thanked: 8 times

Re: Alert on strategy order filled

Postby DaveAronow » 25 Jan 2016

I found this post:

viewtopic.php?f=1&t=48626

which gets me part way there. I can configure that to send an alert when the position changes -- but how do I configure it to only do that when a new bar comes in?

1. My understanding is that the alert will only be triggered on the last bar.
2. How do I determine in the script if the last bar is a new bar (from live data) or is just the last bar from historical data (say when I open the chart before market open)?

Any assistance is appreciated!
Dave

DaveAronow
Posts: 72
Joined: 20 Apr 2014
Has thanked: 9 times
Been thanked: 8 times

Re: Alert on strategy order filled

Postby DaveAronow » 29 Jan 2016

OK so I got alerts going and my custom SMTP host (based on C# code from the internet) is working perfectly, I can do what I want with the email alerts.

However, MC thinks the email send failed. The same SMTP server works fine with TS, how can I suppress the email alert error popups that pop up on the screen? Or is there some way to determine what it is MC doesn't like that my custom SMTP server? Is it not giving some response code it should be?

Thanks.
Dave

andrei
Posts: 30
Joined: 24 Jan 2013
Has thanked: 3 times
Been thanked: 4 times

Re: Alert on strategy order filled

Postby andrei » 11 Mar 2016

Hi Dave,

I think in TS things are similar ... you need to configure an indicator to generate an alert (that can be an email), but you cannot do the same from a Strategy, isn't it?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Alert on strategy order filled

Postby JoshM » 12 Mar 2016

(..) you need to configure an indicator to generate an alert (that can be an email), but you cannot do the same from a Strategy, isn't it?
Alerts for a strategy can be configured in the same way as indicator alerts are set. There's a wiki page about that here: strategy alerts.


Return to “MultiCharts”