1. send a rejection signal (for testing purposes)
2. redirect the rejection signal to a method
3. send a text/email
4. continue with the strategy termination (presumably with CloseStrategy())
I have code in OnOrderUpdate to recognize the rejection like the following code snippet but it doesn't seem to work as I have not seen my Print statement in the output window. I am unsure if this will ever get triggered or will the strategy have already terminated before it gets there.
if (error == ErrorCode.OrderRejected
|| error == ErrorCode.OrderRejectedByRisk)
{
string msg = string.Format("**** {0} Order Rejected: {1} with stop {2}",time, order.OrderType, order.StopPrice);
Print(msg);
// I would add MySendText(msg) here //
CloseStrategy(terminateSignal);
}
I'm also presuming that CloseStrategy closes any existing trades and cancels any existing orders for that instrument. If incorrect, please let me know.

Comment