• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
          https://ninjatrader.com/support/foru...040#post786040

          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 Hanstanz, Today, 04:44 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post Hanstanz  
                  Started by juniortut, Today, 04:38 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post juniortut  
                  Started by rojiinko, Today, 03:58 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post rojiinko  
                  Started by mreanuzlazx, Today, 01:30 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post mreanuzlazx  
                  Started by xinepev, Today, 12:33 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post xinepev
                  by xinepev
                   
                  Working...
                  X