Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Block Orders
Collapse
X
-
Block Orders
In the T&S windows, there is a "B" called out whenever there is block order. In ninjascript, how do I reference this block order? I am looking to draw a circle on the bar where the block order happened. How would I go about doing that? How do I also grab the size of the block order?Tags: None
-
Chelsea,
See below for the code I am using. FYI, my indicator is set to Calculate = Calculate.OnEachTick.
See below when a block order shows up on the T&S:
I am confused by the results I am getting on the output window. See below. I only want it to print when I get this block order > 80. Why am I getting all these other values on my output window?
Also, is there a way to print if it is block order hitting the bid or a block order hitting the ask?
Thanks
Comment
-
Hello algospoke,
That is unexpected and I am not reproducing this on my end testing the ES 12-24 on a 1 minute chart.
May I have you test the original TnSVolume example without making any modifications?
Is this also producing values that do not match the Time & Sales window?Chelsea B.NinjaTrader Customer Service
Comment
-
Chelsea,
I ran the TnSVolume without making any modifications and it worked just fine.
I created a new indicator and just printed the Volume. See below for the code. Please try this code and let me know if you are getting the same results as the below pic.
It seems that when I use marketDataUpdate.Volume, it is showing the current bid size and ask size instead of the volume at the last trade event. See below pic circled in red and blue. Also, it is showing some weird number randomly that I circled in pink. I am using the volumetric bars 1000 tick on ES 12-24.HTML Code:#region Using declarations using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.SuperDom; using NinjaTrader.Gui.Tools; using NinjaTrader.Data; using NinjaTrader.NinjaScript; using NinjaTrader.Core.FloatingPoint; using NinjaTrader.NinjaScript.DrawingTools; #endregion //This namespace holds Indicators in this folder and is required. Do not change it. namespace NinjaTrader.NinjaScript.Indicators { public class TEST2 : Indicator { protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Indicator here."; Name = "TEST2"; Calculate = Calculate.OnBarClose; IsOverlay = false; DisplayInDataBox = true; DrawOnPricePanel = true; DrawHorizontalGridLines = true; DrawVerticalGridLines = true; PaintPriceMarkers = true; ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right; //Disable this property if your indicator requires custom values that cumulate with each new market data event. //See Help Guide for additional information. IsSuspendedWhileInactive = true; } else if (State == State.Configure) { } } protected override void OnBarUpdate() { } protected override void OnMarketData(MarketDataEventArgs marketDataUpdate) { Print(Time[0].ToString() + " Block " + marketDataUpdate.Volume); } } } #region NinjaScript generated code. Neither change nor remove. namespace NinjaTrader.NinjaScript.Indicators { public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase { private TEST2[] cacheTEST2; public TEST2 TEST2() { return TEST2(Input); } public TEST2 TEST2(ISeries<double> input) { if (cacheTEST2 != null) for (int idx = 0; idx < cacheTEST2.Length; idx++) if (cacheTEST2[idx] != null && cacheTEST2[idx].EqualsInput(input)) return cacheTEST2[idx]; return CacheIndicator<TEST2>(new TEST2(), input, ref cacheTEST2); } } } namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns { public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase { public Indicators.TEST2 TEST2() { return indicator.TEST2(Input); } public Indicators.TEST2 TEST2(ISeries<double> input ) { return indicator.TEST2(input); } } } namespace NinjaTrader.NinjaScript.Strategies { public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase { public Indicators.TEST2 TEST2() { return indicator.TEST2(Input); } public Indicators.TEST2 TEST2(ISeries<double> input ) { return indicator.TEST2(input); } } } #endregion
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
607 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
353 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment