Announcement

Collapse
No announcement yet.

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.

        https://ninjatrader.com/support/help...nt8/?swing.htm
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by guilhem, Today, 02:09 PM
        0 responses
        9 views
        0 likes
        Last Post guilhem
        by guilhem
         
        Started by Hyper, Today, 12:20 PM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by TurtleTrader, Today, 11:50 AM
        2 responses
        24 views
        0 likes
        Last Post TurtleTrader  
        Started by Ricam, Today, 12:21 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by sidlercom80, Today, 11:52 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Kate  
        Working...
        X