For example, this code is from the NT7 help guide,
protected override void Initialize() { // assume the primary bar series is MSFT on a 1-Minute chart Add(PeriodType.Minute, 3); Add("AAPL", PeriodType.Minute, 1); }
to work properly. Obviously, OnBarUpdate has a BarsInProgress context, for example, this is
from the NT7 help guide,
protected override void OnBarUpdate() { // Checks to ensure all Bars objects contain enough bars before beginning if (CurrentBars[0] <= BarsRequired || CurrentBars[1] <= BarsRequired || CurrentBars[2] <= BarsRequired) return; // Checks if OnBarUpdate() is called from an update on the primary Bars if (BarsInProgress == 0) { // Submits a buy market order for MSFT EnterLong(); } // Checks if OnBarUpdate() is called from an update on AAPL 1 minute Bars object if (BarsInProgress == 2) { // Submits a buy market order for AAPL EnterLong(); // Submits a buy market for MSFT when OnBarUpdate() is called for AAPL EnterLong(0, 100, "BUY MSFT"); } }
the order was submitted against?
If the inside of OnExecution references Close[0], there must be a BarsInProgress context for that, right?
Will the BarsInProgress context be for the value barsInProgressIndex if the Advanced Order
Handling method,
EnterLong(int barsInProgressIndex, int quantity, string signalName)
I mean, if I Add() 5 additional time-frames (same instrument) then obviously the BIP used for the EnterLong
all refer to the same instrument -- but the BIP specified in the EnterLong() call, will that exact same BIP
carryover as the "BarsInProgress context" for OnExecution, such that Close[0] references the
correct close price of the same BIP as specified by the EnterLong(BIP, ...) call?
Is the answer the same for OnOrderUpdate?
Is the answer the same for OnPositionUpdate?
Is the answer the same for OnMarketData?
Is the answer the same for both managed and unmanaged mode?
Is the answer the same for both NT7 and NT8?
As you can see, I'm trying to determine how deep and prevalent the "BarsInProgress context" really is,
especially, where it can be relied upon and where it is absent.
Thanks
Comment