If I wanted to print something when an order is submitted to enter a trade, but not any other time, what would you recommned?
Here is what I'm currently doing, but it's printing at entry and exit. I think the problem is, I dont' fully understand when an order is = null, or != null.
protected override void OnOrderUpdate(IOrder order)
{
if (print == true && LE != null)
{
Print(Time[0] + " TICK Trade entered LONG position with the TICK @ " + Closes[1][0] + " and the S&P at " + Closes[0][0]);
print = false;
}
if (print == true && SE != null)
{
Print(Time[0] + " TICK Trade entered SHORT position with the TICK @ " + Closes[1][0] + " and the S&P at " + Closes[0][0]);
print = false;
}
}
Comment