Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Non Historical Swing Indicator

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

    Non Historical Swing Indicator

    What language would it take to modify the normal ninjatrader swing indicator to show only the last high and low swings?

    #2
    Hi Rallii, thanks for posting.

    I made this "Single dot" Swing indicator that only shows the original swing point:


    Alternatively, you can make a new indicator that adds a Swing() object and uses a Draw command to draw just one data point for each bar e.g. Draw.ArrowUp.


    Kind regards,
    -ChrisL

    Comment


      #3
      Thanks Chris! works like a charm!

      Comment


        #4
        Is there a way to have a strategy use a draw object like a horizontal line as a profit target?

        Comment


          #5
          Hi Ralli, thanks for the follow up.

          You can iterate and identify specific drawing tools in the DrawObjects collection and submit an order using its price value:



          Kind regards,
          -ChrisL

          Comment


            #6
            Thanks, Chris!

            A more complicated question, How would I get a strategy to at the entry draw a Gann Fan and then use the rays as an exit.. Like the price action has to stay between the 1x8 and the 1x2, and exit when the close crosses below the 1x2? is that possible?

            Comment


              #7
              Hi, thanks for your reply.

              Yes, that is possible to do. Please see the documentation for the Gann Fan and look at the properties that can be accessed from the script:



              You can use the value of its anchors in order in your strategy.

              Best regards,
              -ChrisL

              Comment


                #8
                Thank Chris, A bit out of my league at the moment.. Do you have an example of a script that uses drawn objects as exits?

                Comment


                  #9
                  Hi, thanks for your reply. I do not know of an exact example of using draw objects You will need to test out the available data by first drawing the tools you want to use (manually on the chart or through NinjaScript) and accessing the data from the objects. Start by using the HorizontalLine tool as this only has one data point. If you draw the line from your script, using Draw.HorizontalLine, you can access the data directly, e.g. HorizontalLine HZ = Draw.HorizontalLine(this, "tag1", 1000, Brushes.Black); //data can be accessed from HZ.

                  If you draw the line manually, you will need to iterate the DrawObjects array and find the line first, then you can access the data once found. There are small examples here as well:



                  Best regards,
                  -ChrisL


                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  602 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  347 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  559 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  558 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X