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!
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
NinjaTrader
Identify largest volume level
Collapse
X
-
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
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
10 responses
1,768 views
0 likes
|
Last Post
by Leafcutter
Today, 03:01 AM
|
||
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, 04-23-2024, 07:51 PM
|
2 responses
30 views
0 likes
|
Last Post
by Max238
Today, 02:25 AM
|
||
Started by Shansen, 08-30-2019, 10:18 PM
|
24 responses
943 views
0 likes
|
Last Post
by spwizard
Today, 01:29 AM
|
||
Started by Max238, Today, 01:28 AM
|
0 responses
10 views
0 likes
|
Last Post
by Max238
Today, 01:28 AM
|
||
Started by rocketman7, Today, 01:00 AM
|
0 responses
7 views
0 likes
|
Last Post
by rocketman7
Today, 01:00 AM
|
Comment