thanks
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
Divergence strategy with some oscillator and the swing indicator
Collapse
X
-
Divergence strategy with some oscillator and the swing indicator
Hello, I want to do a divergence strategy with some oscillator and the swing indicator, using a high and low threshold. I want to detect the highest pivot in the oscillator, against the next pivot and see if it is lower and go short. the same with the long ones. attached there is an example image, and if is possible to do it in the builder
thanks
1 PhotoTags: None
-
Hello jerryblack,
Thanks for your post.
Trying to accomplish this in the Strategy Builder would be difficult at best and may not be possible.
In the Strategy Builder, the Swing indicator only provides access to the current swing high or swing low.
An important note about the swing indicator. The swing indicator does not provide a swing point until the "strength" bars have passed. For example with a strength of 5, this means that the swing high or swing low will not be confirmed until the close of the 5th bar after the swing point. It looks like you are showing a strength setting of 2 which means these values are not known until the close of the 2nd bar after the swing point, so in your screenshot you would need to add two bars to the right of where your are pointing to visualize where the swing changes actually are known.
You can detect when the swing point changes. You can save the swing point to a variable and can compare the previous swing high to the current swing high (same with swing low).
You can likely create what you need in Ninjascript where you do have access to other information about the swing such as accessing what bar the swing started on.
An alternative would be to have the strategy created for you, if this is of interest we can provide a reference to 3rd party programmers in the NinjaTrader ecosystem.
Paul H.NinjaTrader Customer Service
-
Thanks for answering . Could you give me an example of how to detect swing poin in ninjascript? thanks
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Jonker, 04-27-2024, 01:19 PM
|
3 responses
22 views
0 likes
|
Last Post Today, 05:45 PM | ||
Started by businessman1929, 04-29-2024, 01:28 PM
|
2 responses
21 views
0 likes
|
Last Post Today, 05:38 PM | ||
Started by bltdavid, 03-27-2023, 05:32 AM
|
18 responses
347 views
0 likes
|
Last Post
by ETFVoyageur
Today, 05:28 PM
|
||
Started by NM_eFe, Today, 05:15 PM
|
0 responses
5 views
0 likes
|
Last Post
by NM_eFe
Today, 05:15 PM
|
||
Started by vitaly_p, Today, 05:09 PM
|
0 responses
5 views
0 likes
|
Last Post
by vitaly_p
Today, 05:09 PM
|
Comment