I installed the EmailTrades indicator from the download forums here, made some modifications (just around the data included in the email), but I am having an issue getting lots of e-mails sent on single transactions. All the logic happens within OnExecution and the conditionals I have set up are pasted below.
The problem being, when I get filled on an order it sends me 5 to 10 e-mails instantly instead of just 1. The message is identical in each. I would understand if this were the case for partial order fills but I should be restricting it to only filled orders. Any idea why I will get up to 10 e-mails on a single transaction?? What else could I use to make sure it only sends 1 per transaction?
thanks!!
private void OnExecution(object sender, ExecutionUpdateEventArgs e)
{
if (e.Execution.Order != null)
{
if (e.Execution.Order.OrderState == OrderState.Filled)
{
//generate email etc etc
}
}
}
Comment