There are options such as Ask, Bid and Last
On the Time and sales sheet, How do I know program if it was a Ask Price or a Bid Price.
Does the Last indicate if it was a sale? If so how do I know if it is a bid sale or an ask sale?
This is what I have.
double price = 0;
long volume = 0;
price = e.Price;
volume = e.Volume;
if (e.MarketDataType == MarketDataType.Ask)
{
return;
}
if (e.MarketDataType == MarketDataType.Bid)
{
return;
}
if (e.MarketDataType != MarketDataType.Last || price == 0)
return;
if (volumeList.Count == 0 && price
!= 0)
{
volumeList.Add(new PricetPoint(price, volume));
}
else
{
if (price != 0)
{
bool bPriceFound = false;
for (int x = 0; x < volumeList.Count; x++)
{
if (price == volumeList[x].AskPrice)
{
bPriceFound = true;
volumeList[x].AskVolume = volumeList[x].AskVolume + volume;
}
}
if (bPriceFound == false)
{
volumeList.Add(new PricetPoint(price, volume));
}
}
}
if (e.MarketDataType == MarketDataType.Ask)
{
return;
}
if (e.MarketDataType == MarketDataType.Bid)
{
return;
}
Comment