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

Chart drawings to mark 2x previous range

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

    Chart drawings to mark 2x previous range

    Hi there, I would like to use the Strategy Builder to mark each bar that has a range 2x or more, than the previous bar's range.

    In Strategy Builder, I can easily test if the current range is equal or greater than, equal or less than etc the previous bar. However I don't know if there's a way of asking if the current bar is "greater or equal than 2 times" the previous bar's range. The multiple of the previous bar's range clearly being the key bit here.

    Can anyone help?

    Thanks very much.

    #2
    Hello ehope,

    Thank you for your note.

    To accomplish this you would have to save the value of the previous bars range to a variable and compare it to the current bar, this would not be possible to build in the strategy builder.

    I have put together a sample indicator which will draw an up arrow if the current bars range is greater than double the previous bars range. This was built using the NinjaScript editor and provided as an example of how you could use the editor to accomplish what you're looking to do.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks very much Alan. And what's the best way to get your code into my NinjaScript Editor?

      Comment


        #4
        Hello Ehope,

        To Import a NinjaScript into NinjaTrader 8 do the following:
        From the Control Center window select Tools -> Import-> NinjaScript...
        Find the file location.

        Then you can open the editor and select the indicator RangeDoublePreviousBarDrawArrow.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Great, thanks so much Alan

          Comment


            #6
            Sorry Alan one last step. After importing it how do I then see / use it in the "Strategies" area of my chart?

            Thanks vm

            Comment


              #7
              Hello ehope,

              After you've imported the strategy/indicator you can apply it to a chart using the steps covered 1:00:10 into the following youtube.

              Understand the fundamentals of basic strategy creation by developing an actual strategy using the NinjaTrader Strategy Builder.2:45 Opening a Strategy Builde...


              Please let us know if you need further assistance.
              Alan P.NinjaTrader Customer Service

              Comment


                #8
                Thanks Alan.

                Re the script itself, I think it's returning Arrows when the range of the current bar is larger (by any amount) than the previous. I would like arrows when the current bar's range is twice the previous bar's. I've had a look at the script and couldn't see anywhere obvious to edit, bearing in my I'm a complete beginner at coding.

                cheers

                Comment


                  #9
                  Hello ehope,

                  Correct, the sample code I provided did not include a multiplier. In the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients.

                  You could add this to the script or if you'd like I can have someone from business development reach out regarding a list of third parties that would be interested in building the indicator for you.

                  Please let us know if you need further assistance.
                  Alan P.NinjaTrader Customer Service

                  Comment


                    #10
                    Understood, thanks Alan.

                    Comment


                      #11
                      Hello ehope,

                      I have modified and attached the indicator.

                      Please let us know if you need further assistance.
                      Attached Files
                      Alan P.NinjaTrader Customer Service

                      Comment


                        #12
                        BigCandle arrow

                        eHope, if you are a member of Futures.io there is also an indicator there that will produce an arrow when a candle is larger than an AVERAGE RANGE candle for the instrument, timeframe:

                        Big Candle v1.0
                        Identify unusually large price movements. If the range for the bar is outside of the standard deviation then the bar gets highlighted. There are also options to draw arrows on your main chart, and trigger alerts.

                        It is likely that if you set the period to 1 it would perform as you request. Just a thought.

                        The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies


                        But you need to be a member to get to it. The membership is considered cheap by most people.

                        Comment


                          #13
                          Thanks Alan and JMont1, much appreciated.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by bortz, 11-06-2023, 08:04 AM
                          47 responses
                          1,602 views
                          0 likes
                          Last Post aligator  
                          Started by jaybedreamin, Today, 05:56 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post jaybedreamin  
                          Started by DJ888, 04-16-2024, 06:09 PM
                          6 responses
                          18 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by Jon17, Today, 04:33 PM
                          0 responses
                          4 views
                          0 likes
                          Last Post Jon17
                          by Jon17
                           
                          Started by Javierw.ok, Today, 04:12 PM
                          0 responses
                          12 views
                          0 likes
                          Last Post Javierw.ok  
                          Working...
                          X