Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fibonacci Retracement Alert

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

    Fibonacci Retracement Alert

    Please, I need your assistance in relation to the Ninjascript that I need to use to check to see whether price has retraced/touched the 50% Level of a Fibonacci retracement.
    In other words, I want to send an alert to myself whenever price has retraced to the 50% level of a Fibonacci tool.





    For Example

    If (price retraced to 50% of Fibonacci)
    {
    Alert(string id, Priority priority, string message....)
    }

    #2
    Hello cryfgg,

    Thank you for your post.

    To clarify, is the Fibonacci retracement in question drawn by a NinjaScript indicator or strategy, or would you be drawing this manually and then applying an indicator or strategy to monitor the price?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello cryfgg,

      Thank you for your post.

      To clarify, is the Fibonacci retracement in question drawn by a NinjaScript indicator or strategy, or would you be drawing this manually and then applying an indicator or strategy to monitor the price?

      Thanks in advance; I look forward to assisting you further.

      The Fibonacci retracement will be drawn via Ninjascript Indicator (using the code Draw.FibonacciRetracements (....) applied to swing points)

      Comment


        #4
        Hello cryfgg,

        Thank you for your reply.

        I'm attaching a simple example indicator that draws a fibonacci retracement between the high and low of the past 100 bars and then gets the 50% level value that should get you going in the correct direction.

        Please let us know if we may be of further assistance to you.
        Attached Files

        Comment


          #5
          Originally posted by NinjaTrader_Kate View Post
          Hello cryfgg,

          Thank you for your reply.

          I'm attaching a simple example indicator that draws a fibonacci retracement between the high and low of the past 100 bars and then gets the 50% level value that should get you going in the correct direction.

          Please let us know if we may be of further assistance to you.
          I couldn't figure it out using your codes (I'm still a novice in programming)... Here is my code (below). How do I modify it to what i want? thanks for the assistance

          private int strength = 7; // Default setting for Strength

          private int lastHighBar ()
          {
          return Swing(strength).SwingHighBar(1,1,200);
          }
          private double lastHighBarValue ()
          {
          return Swing(strength).SwingHigh[strength+1];
          }
          private int lastLowBar ()
          {
          return Swing(strength).SwingLowBar(1,1,200);
          }
          private double lastLowBarValue ()
          {
          return Swing(strength).SwingLow[strength+1];
          }
          private double length ()
          {
          return lastHighBarValue() - lastLowBarValue();
          }
          private double curLength()
          {
          return lastHighBarValue() - MIN(Low,nbars)[0];
          }
          private double curLLength ()
          {
          return MAX(High,nbars)[0] - lastLowBarValue();
          }


          protected override void OnBarUpdate()
          {

          if (lastLowBar() > lastHighBar() )
          &&

          )
          {
          Draw.FibonacciRetracements(this, "line" + CurrentBar, false, lastLowBar(), lastLowBarValue(), lastHighBar(), lastHighBarValue());

          Alert(@"Fib Retracement_1", Priority.Low, @"Fib Retracement", NinjaTrader.Core.Globals.InstallDir+@"\sounds"+Al ertWavFileName, 0, Brushes.Cyan, Brushes.Black);
          }

          }

          if (lastLowBar() < lastHighBar() && Close[0] < lastHighBarValue() && length())
          {

          Draw.FibonacciRetracements(this, "line" + CurrentBar, false, lastHighBar(),lastHighBarValue(),lastLowBar(),last LowBarValue());

          if(soundAlert1==true)
          {
          Alert(@"Fib Retracement_1", Priority.Low, @"Fib Retracement", NinjaTrader.Core.Globals.InstallDir+@"\sounds"+Al ertWavFileName, 0, Brushes.Cyan, Brushes.Black);
          }


          }

          Comment


            #6
            Hello cryfgg,

            Thank you for your reply.

            You'd want to make sure you're saving your drawn fib retracement to a variable so you can easily loop through the price levels and get that 50% level. I'm attaching an example strategy that builds upon the logic in my example indicator I previously posted and submits long or short orders depending on whether the price crosses above or below the 50% level and sets a 10 tick stop loss and a profit target at either the 0 or 100 level depending on the direction of entry. There's a number of comments in the code to explain what's going on that should be helpful to you.

            Please let us know if we may be of further assistance to you.
            Attached Files

            Comment


              #7
              Hello! I am new Ninja trader user and I like to make some change to Fibonacci retracement as shown as attachment below. Can anyone help?
              Attached Files

              Comment


                #8
                Hello Eunha Kim,

                Thank you for your reply.

                While we in the Support department cannot create a strategy on your behalf, I would take a look at the example strategy above which will allow you to get the price levels of whichever % line you wish. From there, you can calculate the number of shares/contracts according to your formula and then enter using that calculated value for the quantity.

                If you are interested in services in having the code written for you, I can have a representative of our EcoSystem reach out with more information on NinjaScript consultants who will be happy to do so.

                Please let us know if we may be of further assistance to you.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                637 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                366 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                107 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                569 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                572 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X