Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

On market data, time and sales, bid, ask, last

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    On market data, time and sales, bid, ask, last

    I need to understand about MarketDataType

    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;
    }

    #2
    Hello ballboy11,

    Thanks for your post.

    A Last tick would indicate a completed buy/sell. To determine if the trade was a buy or sell, you can compare the price to the bid/ask price (MarketDataEventArgs.Bid/MarketDataEventArgs.Ask)

    Please see the BuySellVolume indicator which comes with NinjaTrader for an example on how you can identify a buy/sell from a Last tick.

    We look forward to assisting.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    574 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X