protected override void OnBarUpdate()
{
EnterPosition(entryOrder_1, ENTRY_ONE, T1_positionQuantity);
}
private void EnterPosition(IOrder entryOrder, int entryTag, int positionQuantity)
{
if (entryOrder == null and some other condition)
entryOrder = EnterLongLimit(0,true, positionQuantity, lowerBandEntry, "Long_" + entryTag);
}
The problem I am having is that once I have entered the position, my if-statement continues to always evaluate to true. In other words, my entryOrder(IOrder) variable remains null. However, if I print out the entryOrder.Token just after entering the position, then there is a value there. When the OnOrderUpdate fires, it fires with the same Token value. But if I print out the explicit variable that was passed into the EnterPosition method(entryOrder_1), then it is blank.
Is it possible that the entryOrder_1 variable that is passed into EnterPosition method is passed "By Value" and not as an object reference??

Comment