Hello,
I would like to get email notification for every filled order in auto trading. What is the best way to do this? I could use 'alert' at the same time when strategy places an entry order, but this is a limit order, and I need alerts only if order is actually filled. Same with exits. Is there a way to get alerts only for fills?
Thanks.
Strategy auto trading alerts [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Strategy auto trading alerts
Hello AAY,
That is possible to check the market position change and current contracts change to generate the alert only when there is an actual fill.
That is possible to check the market position change and current contracts change to generate the alert only when there is an actual fill.
Re: Strategy auto trading alerts
Just poking at this now.. I think this will work for you:
Code: Select all
//Alert
Inputs:
TradeAlert( "X Strategy Fill" ) ;
Variables:
IntrabarPersist MPos( 0 ),
IntrabarPersist LastMPos( 0 ) ;
MPos = I_MarketPosition ;
if MPos<>LastMPos then Alert( TradeAlert ) ;
LastMPos = MPos ;
Re: Strategy auto trading alerts
Another individual was asking about something similar so I wrote this piece up for them and thought maybe you'd have use for it as well:
Code: Select all
Inputs:
LE( 1 ), //0 = do not use. 1 = use
LX( 1 ), //0 = do not use. 1 = use
SE( 1 ), //0 = do not use. 1 = use
SX( 1 ) ; //0 = do not use. 1 = use
variables:
IntrabarPersist MPos(0),
IntrabarPersist LastMPos(0);
MPos = I_MarketPosition ;
if LE>0 and LastMPos<=0 and MPos>0 then
Alert( "Long Entry" ) ;
if LX>0 and LastMPos>0 and MPos<=0 then
Alert( "Long Exit" ) ;
if SE>0 and LastMPos>=0 and MPos<0 then
Alert( "Short Entry" ) ;
if SX>0 and LastMPos<0 and MPos>=0 then
Alert( "Short Exit" ) ;
LastMPos = MPos;
Last edited by MAtricks on 10 Feb 2014, edited 1 time in total.
Re: Strategy auto trading alerts
My code, based on your original reply, is already very similar to this. Thanks anyway!Another individual was asking about something similar so I wrote this piece up for them and thought maybe you'd have use for it as well: