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
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 FilesBrandon H.NinjaTrader Customer Service
-
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:
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.
Brandon H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Mestor, Today, 03:15 AM
|
1 response
7 views
0 likes
|
Last Post Today, 07:41 AM | ||
Started by RaygunWizzle, Yesterday, 08:52 PM
|
1 response
8 views
0 likes
|
Last Post Today, 07:40 AM | ||
Started by Mestor, 03-10-2023, 01:50 AM
|
13 responses
313 views
0 likes
|
Last Post Today, 07:29 AM | ||
Started by Lele2k24, Yesterday, 11:24 AM
|
7 responses
25 views
0 likes
|
Last Post Today, 07:25 AM | ||
Started by martini, Yesterday, 04:45 PM
|
2 responses
15 views
0 likes
|
Last Post
by martini
Today, 07:23 AM
|
Comment