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 on Strategy Builder

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

    Divergence on Strategy Builder

    Hello,

    Is there any way to identify divergence, say from an oscilator, using Strat Builder?

    Thanks

    #2
    Hello demo166130,

    Are you just wanting to know if it may be possible so you can try and find the answers on your own?
    Yes, it may be possible.

    Are you asking for assisting writing a condition?
    Are you looking for the Close[0] price to be equal to or greater than the ChaikinOscillator(3, 10)[0] plus 10 ticks?

    if (Close[0] >= ChaikinOscillator(3, 10)[0] + 10 * TickSize)
    {
    // execute code
    }
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      More than anything I was hopng you might be able to show me, in as basic a way possible, how to identify divergence using the Strategy Builder so I don't have to spend forever trying and repeatedly bug you when I inevitably fail.

      Comment


        #4
        Maybe when you said 'if (Close[0] >= ChaikinOscillator(3, 10)[0] + 10 * TickSize)' you were doing just that. If you were, can you briefly explain in really simple terms what it means.

        Thankyou!

        Comment


          #5
          Hello demo166130,

          This condition would be possible to setup in the Strategy Builder.

          I am not able to assist you with the logic, but I can assist you with turning the logic into code.

          Below is a public link to a forum post with helpful information about getting started with NinjaScript.


          The suggestion I made would trigger when the Close[0] price is equal to or greater than the ChaikinOscillator(3, 10)[0] plus 10 ticks. Basically if is more than 2 ticks above the ChaikinOscillator.

          What is the specific logic you are wanting to code?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            OK, good to know it is possible to idenify divergence in the Builder, and thanks for the link.

            How would 'when close price is equal or greater than the oscilator plus ten ticks' be identofying divergence. When you say price, are you referring to the price of the bar on the chart, or the price value given by the oscilator? This might be where the misundertanding exists.

            Comment


              #7
              Hello demo166130,

              I am wanting you to provide the exact logic you are wanting.

              My example is when the current market price (the Close[0] is the current market price) is greater than the ChaikinOscillator price. It would be diverging as the price of the indicator is becoming further away from the current price.

              Since I don't know what logic you want, I'm just throwing out suggestions.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                An example of divergence could be an Oscilator showing a lower low despite price being at the same level as before, or price making a higher high, but the oscilator showing a lower low. It sounds like it might be pretty dificult to create but if you can think of a way, feel free.

                Comment


                  #9
                  Hello demo166130,

                  I don't think I'm understanding the specific logic you are wanting coded. Are you using general terms or is there specific psudeo code logic you have that you want assistance writing into a script?

                  You are wanting a condition if the current bars value of the ChaikinOscillator is equal or less than the previous bar's value? (Or a separate condition where the value is equal to or higher than the previous bars value?)

                  if (ChaikinOscillator(3, 10)[0] <= ChaikinOscillator(3, 10)[1])
                  or
                  if (ChaikinOscillator(3, 10)[0] >= ChaikinOscillator(3, 10)[1])
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NRITV, Today, 01:15 PM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by maybeimnotrader, Yesterday, 05:46 PM
                  5 responses
                  24 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by quantismo, Yesterday, 05:13 PM
                  2 responses
                  16 views
                  0 likes
                  Last Post quantismo  
                  Started by frankthearm, Today, 09:08 AM
                  6 responses
                  27 views
                  0 likes
                  Last Post frankthearm  
                  Started by adeelshahzad, Today, 03:54 AM
                  5 responses
                  33 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Working...
                  X