Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Alert on new bar?
Collapse
X
-
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 Waxavi, 04-19-2024, 02:10 AM
|
4 responses
54 views
0 likes
|
Last Post
by sonia0101
Today, 04:02 PM
|
||
Started by cmtjoancolmenero, Today, 03:58 PM
|
0 responses
5 views
0 likes
|
Last Post Today, 03:58 PM | ||
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
11 responses
1,777 views
0 likes
|
Last Post
by aligator
Today, 03:54 PM
|
||
Started by trilliantrader, Today, 03:01 PM
|
1 response
9 views
0 likes
|
Last Post Today, 03:16 PM | ||
Started by geddyisodin, Today, 05:20 AM
|
6 responses
37 views
0 likes
|
Last Post
by geddyisodin
Today, 03:14 PM
|
Comment