m_BreakoutStopOrder = ExitLongStop(0, true, m_BreakoutOrderQty, m_MMLow, "StopOut", "Breakout");
Later in the program, I want to move the price of my stop, so I use the following two commands:
CancelOrder(m_BreakoutStopOrder);
m_FirstCashOutStopOrder = ExitLongStop(0, true, stopQty, m_MMHigh, "FirstCashOutStop", "FirstCashOut");
Print(m_FirstCashOutStopOrder);
When I print m_FirstCashOutStopOrder, it is null immediately after calling ExitLongStop(). My error log says, "Error on calling the 'OnExecution' method: Object reference not set to an instance of an object".
Why is it not creating the new order? I've tried 100s of variations at this point.

Comment