I use the SendMail() command to provide Emails and Texts for my Trade signals. But I'm uncertain how to do this with a Stop Loss and Profit Targets. Here is what I use for "regular" initiated trades.
SendMail("My Email or Phone Number", "TRADE ALERT", "ENTER LONG " + TradeInstrument);
From other posts, I have added the OnExecutionUpdate to print the signals.
protected override void OnExecutionUpdate(Cbi.Execution execution, string executionId, double price, int quantity,Cbi.MarketPosition marketPosition, string orderId, DateTime time)
{
Print(execution.Order.ToString());
Print(String.Format("executionId: {0}, price: {1}, quantity: {2}, marketPosition: {3}, orderId: {4}, time: {5}", executionId, price, quantity, marketPosition.ToString(), orderId, time));
}
Can I use this with the SendMail command? If so, how would I go about doing this for just the executed Stop Loss and Profit Target Exits?
Thank you,
Ray

Comment