Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Gap Up/Down Alert
Collapse
X
-
Hello aktrdr071,
Thanks for posting and welcome to the NT forums. This type of alert requires custom programming to create for the market analyzer. You can setup alerts and filters there, based on the indicators plot value. A common approach is setting a plot value of 1 when your condition is true and 0 otherwise. You can then be alerted when the column (indicator) value == 1.
One way to do this with your condition in NinjaScript is with the snippet below:
The indicator is created using Tools > New NinjaScript > indicator menu and then configured in the market analyzer. See here for help working with columns there:Code:if (CurrentDayOHL().CurrentOpen[0] > PriorDayOHLC().PriorHigh[0] || CurrentDayOHL().CurrentOpen[0] < PriorDayOHLC().PriorLow[0]) Value.Set(1); else Value.Set(0);
See here for help working with alert, filter, and cell conditions.
Last edited by NinjaTrader_RyanM1; 01-17-2012, 04:31 PM.Ryan M.NinjaTrader Customer Service
-
Yes, that's it. To create a new indicator Click Tools > New NinjaScript > Indicator. Click Next to advance through the wizard to customize its name, plots and input parameters if needed.
Click Generate to have it create the basic indicator structure. The snippet can be pasted exactly as it is, inbetween the two brackets { } of OnBarUpdate, like:
If you want to get started with indicator development in NinjaTrader, the following tutorials are helpful for explaining the structure and introducing the basics.Code:protected override void OnBarUpdate() { if (CurrentDayOHL().CurrentOpen[0] > PriorDayOHLC().PriorHigh[0] || CurrentDayOHL().CurrentOpen[0] < PriorDayOHLC().PriorLow[0]) Value.Set(1); else Value.Set(0); }
Ryan M.NinjaTrader Customer Service
Comment
-
Forgive me.... here is the code.
Code:[Description("")] public class DonchianChannelSDLongScan : Indicator { #region Variables #endregion protected override void Initialize() { Overlay = false; } protected override void OnBarUpdate() { if (Close[0] >= MAX(High, 504)[1]) Value.Set(1); else Value.Set(0); } #region Properties #endregion } }
Comment
-
Thanks for posting that. A few things you would want to check:
The bars to load setting for the indicator needs to be enough, greater than 504.
You are using a lookback greater than 256, so also need to make sure you have Maximum Bars Looback set to Infinite.
Check the Row filter is enabled from the Right Click context menu. - From the main Market Analyzer screen.Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
144 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
71 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
125 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
79 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment