Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Alert on new bar?
Collapse
X
-
You say "saved the file." How? Did you compile the indicator?Originally posted by Volcom View PostI simply changed "Alert1.wav" to "Alert2.wav", saved the file and re-started NT. However, sound file still plays "Alert1.wav".
Alert("Bar CLOSED!", NinjaTrader.Cbi.Priority.High, "Bar CLOSED!", "Alert2.wav", 10, Color.Red, Color.Yellow);
Comment
-
Is it possible to have this formula tweaked to trigger alert
ONLY when the CLOSED bar was DIFFERENT from the previous bar?
By DIFFERENT I mean different color.
I basically do not want the alert to trigger when the trend continues only when it is reversing.Last edited by zdzich; 09-23-2015, 06:11 AM.
Comment
-
Hello zdzich,
Thank you for your post and welcome to the NinjaTrader Support Forum!
You would change the code in the OnBarUpdate() method to the following:
Code:protected override void OnBarUpdate() { if((Close[0] > Open[0] && Close[1] < Open[1]) || (Close[0] < Open[0] && Close[1] > Open[1])) { Alert("Bar CLOSED!", NinjaTrader.Cbi.Priority.High, "Bar CLOSED!", "Alert1.wav", 10, Color.Red, Color.Yellow); } }
Comment
-
Ok my bad! It does work with regular minute graph.
Is it possible to make it work with Heiken Ashi and Renko chart?
Heiken Ashi bar always opens in the middle of a previous bar. Heiken Ashi Formula:
Close = (Open Price + High + Low +Close) / 4
Open = (Average of Open Price and Close Price of the previous bar)
High = (Maximum value of the (High, Open, Close))
Low = (Minimum value of the (Low, Open, Close))Attached FilesLast edited by zdzich; 09-23-2015, 11:37 AM.
Comment
-
Hello zdzich,
With a Renko chart it should be fine, but with the Heiken Ashi the logic would need to be changed. The Heiken Ashi is an indicator and would need to be what we compare against.
For information on the Heiken Ashi indicator method please visit the following link: http://ninjatrader.com/support/helpG...eiken_ashi.htm
Comment
-
Dear Patrick,
For some reason now it stopped working altogether. I keep getting error message in log:
[Error on calling 'OnBarUpdate' method for indicator 'CloseBarAlert' on bar 0: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.]
but it does trigger the error at the right times. Any ideas? I'm not a coder just so you know =]
In case its needed I'm also attaching log file.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
574 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
333 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment