thankz at all
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
high and low choice ?
Collapse
X
-
Hello faustf, thanks for your note.
The Swing indicator does a similar calculation. You can look at the source code of Swing through the NinjaScript editor. There is also a MAX and MIN methods. This post has a lot of information on getting the highest high over a period of bars:
The same concept can be applied for the lowest low.Chris L.NinjaTrader Customer Service
-
Hi I am looking for the sound alert option for this Swing Indicator. I wonder how may i be able to request some one to enable the Swing High / Low alert? Very much appreciated.
Comment
-
Hello Chris,
I am not sure how that is to be done to add the sound alert? It is something that I have to code it myself?
Comment
-
Hello cyberjames2019,
Thanks for your reply and welcome to the NinjaTrader forums!
If you wish to add a sound alert into the indicator itself, yes you would have to open the code and add the PlaySound() method. We do not provide coding services so if you would like that done for you we can provide a link to 3rd party programmers who can provide that service.
An alternative you might want to test first would be to use "Chart Alerts" in NinjaTrader8 which allow you to configure alerts for the chart based on the applied price bars and indicators on the chart. In the case of the Swing Indicator, you could test to see if the current swing high value is not equal to the previous swing high value meaning the swing had changed which is what I suspect you are looking for. I'll post an example screenshot below of the alerts condition builder which is very similar to the strategy builder's nonprogramming interface.
Here is the link to the Help guide for chart alerts: https://ninjatrader.com/support/helpGuides/nt8/?alerts.htm You'll want to review all of that section for help in understanding how to configure the alerts and the choices that you have.
The example condition: Is the current bar of the SwingHigh not equal to the previous bar of the SwingHigh. The Swing low alert would be very similar except change the "indicator plot: to swing low.
Paul H.NinjaTrader Customer Service
Comment
-
Thank you for your input. I am testing and exploring the chart alert.
I came into a very strange situation that the alert will be disabled automatically? Each time I checked the enable box after awhile it will be disabled automatically. Could you please let me know why? and how to resolve it?
Comment
-
Comment
-
Thank you every one I am able to test out some alerts. However for the alert on the Swing Low and Swing High I think I am not getting the correct alert. Hence I think the best is to code the PlaySound() method. Is there any source code reference that i can refer to?
Comment
-
Hello, thanks for your reply.
This code uses the swing indicator to find the swing high values:
Code:namespace NinjaTrader.NinjaScript.Indicators { public class SwingAlert : Indicator { Swing MySwing; double prevSwingHigh = 0; protected override void OnStateChange() { if (State == State.SetDefaults) { ... //setup code here } else if (State == State.DataLoaded) { MySwing = Swing(5); } } protected override void OnBarUpdate() { if(CurrentBar < 5) return; if(MySwing.SwingHigh[0] != prevSwingHigh) { prevSwingHigh = MySwing.SwingHigh[0]; Draw.Dot(this, CurrentBar + "NewSwing", false, 0, prevSwingHigh, Brushes.Purple); PlaySound(@"C:\mySound.wav"); } } } }
Chris L.NinjaTrader Customer Service
Comment
-
Hi I would like to add the following into the attached CS file
PlaySound(@"\sounds\SwingHighEstablished.wav");
PlaySound(@"\sounds\SwingLowEstablished.wav");
May I know which lines are appropriate to add this code to alert the sound when a Swing High or Swing Low is drawn? I am not sure where exactly to insert. Thank you for your advice.
Attached Files
Comment
-
-
Hi fellas ,
How can i set up an chart alert for the Swing Indicator to get notified when the current swing High is higher than lets say 5 prior swing high´s after the current swing high indicator prints on my chart. Which is the correct set up? . Thank you in advance and my appreciation for any help.SEE Picture
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Kaledus, Today, 01:29 PM
|
0 responses
3 views
0 likes
|
Last Post
by Kaledus
Today, 01:29 PM
|
||
Started by PaulMohn, Today, 12:36 PM
|
1 response
16 views
0 likes
|
Last Post Today, 01:23 PM | ||
Started by yertle, Yesterday, 08:38 AM
|
8 responses
37 views
0 likes
|
Last Post
by ryjoga
Today, 01:22 PM
|
||
Started by rdtdale, Today, 01:02 PM
|
1 response
6 views
0 likes
|
Last Post Today, 01:13 PM | ||
Started by alifarahani, Today, 09:40 AM
|
3 responses
19 views
0 likes
|
Last Post Today, 12:47 PM |
Comment