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:
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:
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 bortz, 11-06-2023, 08:04 AM
|
47 responses
1,610 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
9 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
19 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
6 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
22 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment