Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Opening range breakout strategic

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

    Opening range breakout strategic

    Hi, I want to test a opening range breakout. How can I create this?

    Thanks
    Joaquin.

    #2
    Hello,

    If you have never created a strategy before, I would recommend starting with our point and click interface Strategy Wizard.
    Please see our Help Guide articles on How to use the Strategy Wizard as well as NinjaScript Strategies. More information on these subjects can be found below:
    Click here for more information on Developing Strategies with the Strategy Wizard
    Click here for a Tutorial on Developing Strategies

    I'm also proving a link to a recently recorded 'Automated Strategy Development Webinar' video for you to view at your own convenience: http://youtube/fVFqw5W8uGI

    We also have great resources in relation to Strategy Development on our Support Forum. There is a very active developer community in our support forum that supplements the responses provided by NinjaTrader support staff providing all users with an exceptional support experience.
    Take me to your support forum!

    There are a few Sample Automated Strategies which come pre-configured in NinjaTrader that you can use as a starting point. 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 (you can though always create copies you can later edit via right click > Save as)
    We also have some Reference samples online as well as ‘Tips and Tricks’ for both indicators and strategies:
    Click here to see our NinjaScript Reference Samples
    Click here to see our NinjaScript Tips

    These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.
    Lastly, you can attend one of our live Automated Strategy Development Webinars to help you get up to speed on developing strategies:


    If you have limited time or programming capabilities, you can discuss your requirements with any of our certified NinjaScript consultants.
    Click here for a list of certified NinjaScript Consultants

    Please let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Simple price channel breakout

      I looked at the breakout reference sample created by Josh. It didn't help me at all. I created a simple strategy using the wizard and the Max function which I saw in another post. It did not treat the "shorts" correctly. So I found the Min function and changed the code. With everything else being the same, now the code doesn't work. There are no trades in the backtest; but there are trades in the backtest with the incorrect shorts.
      Working logic:
      if (High[0] > MAX(High, Period)[0])
      {
      EnterLong(DefaultQuantity, "PC_LE");
      }

      // Condition set 2
      if (Low[0] < MAX(Low, Period)[0])
      {
      EnterShort(DefaultQuantity, "PC_SE");
      Non-working logic:
      if (High[0] > MAX(High, Period)[0])
      {
      EnterLong(DefaultQuantity, "");
      }

      // Condition set 2
      if (Low[0] < MIN(Low, Period)[0])
      {
      EnterShort(DefaultQuantity, "");
      I realize this is an old post, but if someone is monitoring, please tell me why the code with the Min function does not work.

      Comment


        #4
        Hello birdjaguar,

        Thank you for your note.


        if (High[0] > MAX(High, Period)[0])
        With this condition you are checking that the high of the current bar is higher than the highest bar of the series. As this current bar is in the series it will never be higher than the highest bar in the series as it will never be higher than itself (itself being in the series).

        if (Low[0] < MIN(Low, Period)[0])
        Similarly, the low of the current bar will never be the lowest bar in the series as it itself is in the series and will never be lower than itself.

        To correct this, add 1 to the Bars ago value in the MAX and MIN indicators. This will exclude the current bar from the series.


        Please let me know if I can be of further assistance.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Okay. This was embarrasing, but thank you very much. The stress of having to change software seems to have affected my ability to see the simplest things.

          Comment


            #6
            So you are good now?


            Why did you have to switch??



            Originally posted by birdjaguar View Post
            Okay. This was embarrasing, but thank you very much. The stress of having to change software seems to have affected my ability to see the simplest things.

            Comment


              #7
              Yes. I am good. Thank you. I had to switch because FXCM discontinued StrategyTrader which was also in C#. Unfortunately, the code is not as similar as I expected, but the Strategy Wizard helps. I expect to have everything I need in place by the end of the week. The videos are also useful. It will still take me a little while to get used to the functionality of the software. Overall, I have been happy with the functionality so far and the service. Thanks again.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Nicholewatkinsi, Today, 10:53 PM
              0 responses
              6 views
              0 likes
              Last Post Nicholewatkinsi  
              Started by dward123, 01-02-2024, 09:59 PM
              4 responses
              175 views
              0 likes
              Last Post Lancer
              by Lancer
               
              Started by ETFVoyageur, Today, 04:00 PM
              2 responses
              19 views
              0 likes
              Last Post ETFVoyageur  
              Started by AaronKTradingForum, Today, 03:44 PM
              1 response
              14 views
              0 likes
              Last Post AaronKTradingForum  
              Started by Felix Reichert, 04-26-2024, 02:12 PM
              11 responses
              80 views
              0 likes
              Last Post Felix Reichert  
              Working...
              X