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

Identify largest volume level

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

    Identify largest volume level

    Hi I would like to know how to identify the price level of the largest volume traded in the prior bar.

    #2
    Hello brucelevy,

    Thank you for the post.

    As far as I am aware, there is nothing built in to detect this and would require some logic to complete. You would very likely need to store this information yourself after calculating it and then reference it after the bar closes.

    For this idea, you would likely need to use either a combination of adding a secondary tick series and logically using BarsInProgress to accumulate volume at various price levels or using OnMarketData and OnBarUpdate for the same purpose.

    Using a Dictionary would likely be easiest to manage price levels. For example, you could check if a price key is in a dictionary or not, if it is not you would add it as a key to the dictionary with the value being the current volume. If it is in the dictionary, you could check if the current volume is greater than the volume stored in the dictionary at that level, if so increase the volume in the dictionary to match and if not, do nothing.

    After the accumulation process described above, on the next bar you could access the dictionary and check specific price levels (keys) for their value (volume) which should be the accumulated MAX at that point for each level.

    I am unaware of a specific sample that includes this type of logic to attach to this post. I would suggest reviewing the Dictionary samples on MSDN for some ideas on how to use dictionaries if that is not clear. There are a few samples near the bottom of the following page: https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks, I will research it.

      Bruce.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      4 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      40 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      19 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X