in the OnBarUpdate method, I have the following code:
if (MarketData!=null)
{
if (MarketData.Bid!=null)
{
Print(MarketData.Bid.Time.ToString()+" "+MarketData.Bid.Price.ToString()+" "+MarketData.Ask.Price.ToString()+" "+MarketData.Bid.Volume.ToString()+"x"+MarketData. Ask.Volume.ToString());
Log(MarketData.Bid.Time.ToString("MMddyyyy"),Marke tData.Bid.Time.ToString("yyyy/MM/dd")+","+MarketData.Bid.Time.ToString("HH:mm:ss")+ ","+MarketData.Bid.Price.ToString()+","+MarketData .Ask.Price.ToString()+","+MarketData.Bid.Volume.To String()+","+MarketData.Ask.Volume.ToString());
}
if (MarketData.Last!=null)
{
Print(MarketData.Last.Time.ToString()+" "+MarketData.Last.Price.ToString()+" "+MarketData.Last.Volume.ToString());
Log(MarketData.Last.Time.ToString("MMddyyyy"),Mark etData.Last.Time.ToString("yyyy/MM/dd")+","+MarketData.Last.Time.ToString("HH:mm:ss") +","+MarketData.Last.Price.ToString()+","+MarketDa ta.Last.Volume.ToString());
}
}
The Log method will just write to a file.
My problem is this:
I've noticed that the bid/ask does not always agree with my esignal "Time and Sales" window which issupposed to show the same thing. I also noticed that in esignal, all changed bid/sales (without any previous price traded) will be displayed, but I think the OnBarUpdate() filters these changes and only returns the final bid/ask. Is this correct?
The other problem I'm seeing is that the Last traded object does not add up with esignal. Also when I am inspecting the Bid object, it seems like the Last object may have been from a previous trade and not a part of this "tick" data (i.e., the bid/ask data). Is that correct? And if so, how can I insure that the Last object that I'm inspecting is really a new trade that occurred and not from a previous trade?
Thanks.
Comment