If so, what would be the most efficent way to calculate the number of trades that occured at the bid price and ask price?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
how to calculate trades at bid or ask price
Collapse
X
-
how to calculate trades at bid or ask price
I assume GetCurrentBidVolume and GetCurrentAskVolume simply are a measure of the number of "booked" trades at that the respective price, not the volume/quantity traded at the respective price...is this correct?
If so, what would be the most efficent way to calculate the number of trades that occured at the bid price and ask price?Tags: None
-
tulanch,
That is correct. To get the actual trades at certain prices would be complicated. You would need to keep track of your own variable that tracks every single tick and categorizes them for each different price. You would likely need to create some Array or maybe a Hashtable of sorts to store this information. Unfortunately this is outside the scope of what we can offer support for as it is much more involved C# programming.Josh P.NinjaTrader Customer Service
-
thanks for the clarificaiton...
then it looks like the MarketDataEventArgs method will make this data available...init some variable, then ...see if last was = ask/bid or outside...accumulate the totals...then on updatebar plot the current values, reset, and repeat..sounds possible...
This being the way to proceed, One more question...
Will the system make MarketDataEventsArgs calls during an UpdateBar call or is there some inheriant timing factor that makes this not an issue? Meaning, do I need to be concerned about the value in a global value that gets updated in MarketDataEventsArgs at the instant it gets reset to 0 in UpdateBar?
Is this or is this not an issue?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
574 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
333 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment