I Open a 5 minute chart and I set the strategy. On Initialize() I add a new time frame for the main symbol and I get data from another symbol:
Add(PeriodType.Second,5);
Add("$EURUSD", PeriodType.Minute, 60);
After Initialize() I retrieve market data:
protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.Ask)
Ask = e.Price;
if (e.MarketDataType == MarketDataType.Bid)
Bid = e.Price;
}
When doing this if I Print(Bid); I get the data from the EURUSD instead of the main instrument.
Even if I set this code I still get wrong data (in this case the value of Print(Bid); is always zero):
protected override void OnMarketData(MarketDataEventArgs e)
{
if (BarsInProgress == 1)
{
if (e.MarketDataType == MarketDataType.Ask)
Ask = e.Price;
if (e.MarketDataType == MarketDataType.Bid)
Bid = e.Price;
}
}
What I'm doing wrong?
Comment