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 NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment