• 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

Stochastic Alerts

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

    Stochastic Alerts

    Hello
    I Have a request. I have been looking for a Stochastic with cross over alerts. One that will paint an up and down arrow on my chart near the price bars when the lines cross over. It seems simple enough that it must be out there already but I haven't been able to find it. And I know nothing about programming. Can someone please help me with it?
    Thank you
    Tom

    #2
    Hi Tom, there are lots of scripts working with a stochastic setup shared here - http://www.ninjatrader.com/support/f...chastic&desc=1

    You will likely be able to find a good starting point then for your own custom works.

    As alternative start customizing the default Stochastics script, for example right click in it and select to 'Save as' under a new new (so you have a copy) and then add this snippet as last part in the OnBarUpdate() -

    Code:
    if (CrossAbove(K, D, 1))
    				DrawArrowUp("upArrow" + CurrentBar, 0, Low[0] - TickSize, Color.Blue);

    This will draw an up arror on the price bar one tick below the low bar which produced the K,D crossover.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Tom, there are lots of scripts working with a stochastic setup shared here - http://www.ninjatrader.com/support/f...chastic&desc=1

      You will likely be able to find a good starting point then for your own custom works.

      As alternative start customizing the default Stochastics script, for example right click in it and select to 'Save as' under a new new (so you have a copy) and then add this snippet as last part in the OnBarUpdate() -

      Code:
      if (CrossAbove(K, D, 1))
      				DrawArrowUp("upArrow" + CurrentBar, 0, Low[0] - TickSize, Color.Blue);

      This will draw an up arror on the price bar one tick below the low bar which produced the K,D crossover.
      Thanks for the tip Bertrand. I will try it over the weekend.
      Last edited by TomTrades; 11-22-2014, 04:01 PM.

      Comment


        #4
        Still need help.
        That code didn't work. I created this code.

        // Condition set 1
        if (CrossAbove(Stochastics(3, 6, 3).K, Stochastics(3, 6, 3).D, 1))
        {
        DrawArrowUp("My up arrow" + CurrentBar, false, 0, 0, Color.Lime);
        }

        // Condition set 2
        if (CrossBelow(Stochastics(3, 6, 3).K, Stochastics(3, 6, 3).D, 1))
        {
        DrawArrowDown("My down arrow" + CurrentBar, false, 0, 0, Color.Red);
        }

        With the help of strategy builder and it checked out OK but didn't plot on my chart.
        Any suggestions?

        Comment


          #5
          Hello TomTrades,

          Thank you for your response.

          Both of your DrawArrow methods are drawing at zero. You need to set a value like given in Bertrand's example:
          Code:
          DrawArrowUp("upArrow" + CurrentBar, 0, Low[0] - TickSize, Color.Blue);
          Patrick H.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_PatrickH View Post
            Hello TomTrades,

            Thank you for your response.

            Both of your DrawArrow methods are drawing at zero. You need to set a value like given in Bertrand's example:
            Code:
            DrawArrowUp("upArrow" + CurrentBar, 0, Low[0] - TickSize, Color.Blue);
            Thank you Patrick.
            I'm almost there. How do I make the plot arrow X number of ticks away from the current bar?
            Thank you
            Tom

            Comment


              #7
              Hi Tom, you could just set a multiplier here to multiple into the ticksize to use as offset.

              Code:
              DrawArrowUp("upArrow" + CurrentBar, 0, Low[0] - 4 * TickSize, Color.Blue);
              The 4 could also be made a user integer input so you can control on the fly from the UI.

              http://www.ninjatrader.com/support/f...ead.php?t=5782
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Bertrand View Post
                Hi Tom, you could just set a multiplier here to multiple into the ticksize to use as offset.

                Code:
                DrawArrowUp("upArrow" + CurrentBar, 0, Low[0] - 4 * TickSize, Color.Blue);
                The 4 could also be made a user integer input so you can control on the fly from the UI.

                http://www.ninjatrader.com/support/f...ead.php?t=5782
                My indicator looks great!
                Thanks guys
                Tom

                Comment


                  #9
                  Originally posted by TomTrades View Post
                  My indicator looks great!
                  Thanks guys
                  Tom
                  Anyone interested I added the following to a standard Stochastic indicator and called it StochasticAlerts

                  // Condition set 1
                  if (CrossAbove(Stochastics(3, 6, 3).K, Stochastics(3, 6, 3).D, 1))
                  {
                  DrawArrowUp("My up arrow" + CurrentBar, 0, Low[0] - 2 * TickSize, Color.Lime);
                  }

                  // Condition set 2
                  if (CrossBelow(Stochastics(3, 6, 3).K, Stochastics(3, 6, 3).D, 1))
                  {
                  DrawArrowDown("My down arrow" + CurrentBar, 0, High[0] + 2 * TickSize, Color.Red);
                  }

                  Comment


                    #10
                    thank you very much

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by bbdjad, Today, 04:36 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post bbdjad
                    by bbdjad
                     
                    Started by mittie3, Today, 03:33 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post mittie3
                    by mittie3
                     
                    Started by Againmain1, Today, 03:04 AM
                    0 responses
                    7 views
                    0 likes
                    Last Post Againmain1  
                    Started by tonytimpa, Today, 01:33 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post tonytimpa  
                    Started by kiwidtrader, Yesterday, 11:49 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post kiwidtrader  
                    Working...
                    X