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!
See more
See less

Partner 728x90

Collapse

Divergence strategy with some oscillator and the swing indicator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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


    #2
    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

    Comment


      #3
      Thanks for answering . Could you give me an example of how to detect swing poin in ninjascript? thanks

      Comment


        #4
        Hello jerryblack,

        Thanks for your reply.

        Please see the help guide for the swing indicator which shows the syntax for both the bars ago as well as the value. A simple example is also provided in the link.

        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by timmbbo, Today, 08:59 AM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by KennyK, 05-29-2017, 02:02 AM
        2 responses
        1,281 views
        0 likes
        Last Post marcus2300  
        Started by fernandobr, Today, 09:11 AM
        0 responses
        3 views
        0 likes
        Last Post fernandobr  
        Started by itrader46, Today, 09:04 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by bmartz, 03-12-2024, 06:12 AM
        5 responses
        33 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Working...
        X