Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with Strategy Input - Range Trading

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

    Help with Strategy Input - Range Trading

    Hello everyone,

    ive done some "searches" on my topic and cannot find any useful threads. I am trying to backtest a simple strategy.

    I would greatly appreciate the walkthrough on this and here is my strategy. (End of day Futures trading only)

    Long: buy 1 contract if price reaches a 5 day high with a stop loss at low of that 5 day range.


    Short: sell 1 contract if price breaks under a 5 day low with a stop loss at the high of that 5 day range.

    #2
    Hello antonio_zeus,

    Thank you for your post and welcome to our forums!

    What part do you need help with? Have you already programmed your strategy? Have you ran this through the strategy analyzer?

    If you are new to NinjaScript strategies, there are a few Sample Automated Strategies which come pre-configured in NinjaTrader. These are found under Tools--> Edit NinjaScript--> Strategy. You will see locked strategies where you can see the details of the code, but you will not be able to edit.

    We also have some Reference Samples online as well as some Tips and Tricks for both indicators and strategies:

    These samples can be downloaded, installed and modified from NinjaTrader.

    For more information, please see our Help Guide articles on How to use the Strategy Wizard and Strategy Analyzer as well as NinjaScript Strategies. More information on these subjects can be found below:

    Lastly, we have a Automated Strategy Development Webinar to help you get up to speed on developing strategies:
    More information about these sessions can be found here:

    Furthermore I have included links of our Help Guide and Video Library:


    Please let me know if there is anything else I can do for you.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hey Matthew

      thank you for all that advice.

      I am trying to Create a Strategy and then Backtest the strategy.

      I have literally done no work on it simply because the examples provided are always based on indicators.

      The strategy mentioned is based on price and time. (5 day range).

      How would I get the first step done which is to open a LONG position once a 5 day range has been penetrated to the upside?

      Comment


        #4
        antonio_zeus,

        I would not be able to help you work on the logic of this strategy. If you haven't done so already, I would suggest starting in the strategy wizard to get started with your strategy.

        There are many refernece samples for Stratigies in addition to indicators. I would suggest reviewing the links in the previous post and starting with the strategy wizard.
        MatthewNinjaTrader Product Management

        Comment


          #5
          I dont need help with the logic of the strategy. I just need an explanation on how to input the commands.

          The command is basically buy 1 contract after price moves above the previous 5 period range.

          Comment


            #6
            Originally posted by antonio_zeus View Post
            Hey Matthew

            thank you for all that advice.

            I am trying to Create a Strategy and then Backtest the strategy.

            I have literally done no work on it simply because the examples provided are always based on indicators.

            The strategy mentioned is based on price and time. (5 day range).

            How would I get the first step done which is to open a LONG position once a 5 day range has been penetrated to the upside?
            Which means that your strategy is really based on price and the Range() indicator. Why not start from there?

            Comment


              #7
              Ouuuu.. i didnt see that! frig man, you computer guys will have the last laugh! I need to go back to school to learn this programming stuff.

              Let me try that.

              Also for stop loss: how do i place a stop loss at the LOW of that 5 day range for an entry signal??

              Comment


                #8
                Originally posted by antonio_zeus View Post
                Ouuuu.. i didnt see that! frig man, you computer guys will have the last laugh! I need to go back to school to learn this programming stuff.
                Tee hee. You just have to master how to think in straight lines, while thinking crooked. LOL.

                Also for stop loss: how do i place a stop loss at the LOW of that 5 day range for an entry signal??
                There is a shipping indicator called MIN() that will give you the lowest low within a lookback range. You should be able to use that to set your StopLoss by price and an offset, all from within the Strategy Wizard.

                Comment


                  #9
                  Koganam..much appreciated. Let me put all this together and see if it works!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  672 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  379 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  111 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  577 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  582 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X