Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.



    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by llanqui, Today, 08:32 AM
    1 response
    5 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by lollers, Yesterday, 03:26 AM
    1 response
    52 views
    0 likes
    Last Post lollers
    by lollers
     
    Started by Salahinho99, 05-05-2024, 04:13 AM
    7 responses
    62 views
    0 likes
    Last Post Salahinho99  
    Started by knighty6508, 05-10-2024, 01:20 AM
    4 responses
    29 views
    0 likes
    Last Post knighty6508  
    Started by OllieFeraher, 05-09-2024, 11:14 AM
    6 responses
    19 views
    0 likes
    Last Post OllieFeraher  
    Working...
    X