I'm trying to scale into my positions and am having some problems on or after the 3rd entry.
The following code snippet yields the below output.
At first I thought this might be the sim101 account running out of trading capital, but that doesn't seem to be the problem as I cut the trading size down to 50% of the account size and that didn't help.
Entries per direction is set to 4....any help GREATLY appreciated!
John
entryCount++;
Print("Attempting to scale in EnterShort " + signalname);
Print("entryCount is: " + entryCount);
Print("shareSize is: " + shareSize);
Print("Should be submitting " + shareSize*(entryCount+1) + " shares");
entryOrder = EnterShort(shareSize*(entryCount+1), signalname);
Print("Order Token is: " + entryOrder.Token);
Print("Setting lastEntryPrice to 0");
lastEntryPrice = 0.0;
Attempting to scale in EnterShort [4165] Short_VRSI2_Extreme
entryCount is: 1
shareSize is: 51
Should be submitting 102 shares
Order Token is: cd09352bd9304c58bc8f6279e8fdb6c9
Setting lastEntryPrice to 0
Checking a fill
entryOrder.Token is: cd09352bd9304c58bc8f6279e8fdb6c9
execution.Order.Token is: cd09352bd9304c58bc8f6279e8fdb6c9
Token matched
Setting lastEntryPrice to: 0
Attempting to scale in EnterShort [4165] Short_VRSI2_Extreme
entryCount is: 2
shareSize is: 51
Should be submitting 153 shares
7/27/2009 1:21:00 PM Catch 2 block error System.NullReferenceException: Object reference not set to an instance of an object.
at NinjaTrader.Strategy.SpyIntraday6.OnBarUpdate()
Attempting to scale in EnterShort [4165] Short_VRSI2_Extreme
entryCount is: 3
shareSize is: 51
Should be submitting 204 shares
7/27/2009 1:22:00 PM Catch 2 block error System.NullReferenceException: Object reference not set to an instance of an object.
at NinjaTrader.Strategy.SpyIntraday6.OnBarUpdate()
Comment