Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Block trade identification
Collapse
X
-
Hello torch2k,
Thank you for your post.
To determine the position of orders made you could use the Account class and loop through your account positions to print the position Quantity, MarketPosition, and AveragePrice.
See the attached example script demonstrating how this could be accomplished.
Also, see the help guide documentation below for more information.
Account class - https://ninjatrader.com/support/help...ount_class.htm
Positions - https://ninjatrader.com/support/help...ns_account.htm
Let us know if we may assist further.Attached Files<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
Sorry, i don't think I was clear enough in my initial question..
I am using an indicator that I found supplied on here called TnSVolumeExample. It draws orders on the chart based on a certain block size using "OnMarketData". I'd like to know if it is possible to determine if these large blocks are sell orders, or buy orders.
Attached Files
Comment
-
Hello torch2k,
Thank you for the clarification.
You could do something similar to the BuySellVolume indicator that comes default with NinjaTrader. The BuySellVolume indicator uses OnMarketData() to check if the price is greater than or equal to the Ask to determine the number of buys made and it also checks if the Price is less than or equal to the Bid to determine the number of sells made.
I see the TnSVolumeExample already checks if the Price is >= the Ask and checks if the Price is <= Bid within OnMarketData(). You could consider simply changing the text of the Draw.Text() methods so that they draw something like "Buys" or "Sells".
For example, see below:
See the BuySellVolume indicator that comes with NinjaTrader for an example of determining buys and sells. To view the BuySellVolume indicator code, open a New > NinjaScript Editor window, open the Indicators folder, then locate and select the BuySellVolume indicator.Code:Draw.Text(this, "My text 1" + marketDataUpdate.Price.ToString() + CurrentBar, true,[B] "Buys: " + priceLevelsAsk[marketDataUpdate.Price.ToString()].ToString()[/B], -1, marketDataUpdate.Price + offset, 0, Brushes.Green, new SimpleFont("Arial", 11), TextAlignment.Center, Brushes.Transparent, Brushes.Black, 100);
Also, see the help guide documentation below for more information about using OnMarketData().
OnMarketData() - https://ninjatrader.com/support/help...marketdata.htm
Draw.Text() - https://ninjatrader.com/support/help...tsub=Draw.Text
Let us know if we may assist further.
<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
Hello torch2k,
Thank you for your note.
That is correct. Buys would be considered as the price above the Ask. Sells would be considered as the price below the Bid.
Please let us know if you have further questions.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
597 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment