Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to Compare & Alert when Different Contracts Volume Change?
Collapse
X
-
How to Compare & Alert when Different Contracts Volume Change?
I want to be able to use Market Analyzer in NT7_Beta18 to Compare the Volume of two different Contact Months (ex. Compare ES 09-10 with ES 12-10) and Alert me with both Audio & Visual Alerts when the Forward Month Volume (ES 12-10) becomes Greater than the Current Month (ES 09-10). Can someone Please tell me if this can be done and if so, Specifically how to do this?
Tags: None
-
Hello JMCA2000,
Welcome to the NinjaTrader forums!
Unfortunately there's no way this can be setup in the market analyzer. Alerts can only test for value changes for one row, and you'd like to make comparisons across multiple rows. (multiple instruments)
See here for more information on alerts in the market analyzer.Ryan M.NinjaTrader Customer Service
-
Hi MXASJ,
Thank you for your reply.
I tried creating this with the Strategy Wizard but I could not do it. I don't know where to select the instruments to compare and I'm not sure on how to build the Test Condition using Inst1 = Front Month etc. I understand your if statement, but can not create this because there's no example like this in the Help Manual.
Would it be asking to much if you could PLEASE Create this for me as an example (Compare ES 09-10 with ES 12-10) so I have something to go by? I don't even know where I would run this Strategy from the background only, for this example and the other nine instruments I compare.
Thank You for Considering doing this.
Comment
-
You can't create multi instrument strats with the Wizard I believe. Here are some basic guts to work with:
You would add it to the Stratgies tab, Instrument ES 09-10, Daily bars. If it is running than once a day it should print to the output window "Greater Volume is in the ES-09 contract." If you add it via the Strategies tab you don't need a chart open, which is what I meant by running it in background.PHP Code:/// <summary> /// Multi-Instrument sample strategy. /// </summary> [Description("Multi-Instrument sample strategy.")] public class SampleMultiInstrumentMod : Strategy { // Variables protected override void Initialize() { Add("ES 12-10", PeriodType.Day, 1); CalculateOnBarClose = true; } protected override void OnBarUpdate() { if (Volumes[0][0] > Volumes[1][0]) { Print(DateTime.Now + " Greater Volume is in the ES 09-10 Contract"); } if (Volumes[0][0] < Volumes[1][0]) { Print(DateTime.Now + " Greater Volume is in the ES 12-10 Contract"); } }
You could also set that up to email you, or pop up an alert in the alerts window.
I haven't really tested that code but it should get you started.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
94 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
49 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
31 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
34 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
70 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment