Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketDataEventArgs To keep a List of transaction on the bid or ask.

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

    MarketDataEventArgs To keep a List of transaction on the bid or ask.

    Hello,

    I'm using the attached code to keep a list of trades that happened on the bid or ask during a bar period. For some reason I cannot get my script to match up with the Volume series. It is very close in many cases but does not actually match up. Below is examples of my prints on the bar close. Actual volume is Volume[0] and "we show" is the sum of the trades on the bid and ask as I'm calculating them. Any ideas why I am off?

    sold into bid is 17161
    bought into ask is 18377
    unknown 0
    Actual Volume is 35353
    we show 35538
    -----------------------------
    sold into bid is 22753
    bought into ask is 18985
    unknown 0
    Actual Volume is 41662
    we show 41738
    -----------------------------
    sold into bid is 37206
    bought into ask is 38434
    unknown 0
    Actual Volume is 75638
    we show 75640
    -----------------------------
    sold into bid is 70606
    bought into ask is 71293
    unknown 0
    Actual Volume is 141711
    we show 141899
    -----------------------------
    sold into bid is 41050
    bought into ask is 42687
    unknown 0
    Actual Volume is 83736
    we show 83737
    -----------------------------
    Attached Files

    #2
    Hello evanp90, thanks for your post.

    Regrettably, I can't go over the code and find specifically what is wrong, it would take Print methods placed throughout the script to see where the deviation is coming from. We have an indicator called "BuySellVolume" that you can review in the NinjaScript editor. That indicator matches the Volume series through my test, and by storing the buy/sell volumes in a series, its basicaly the same as saving to a list.

    Kind regards.



    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    670 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    379 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    111 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    582 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X