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

Question, to create Half Hour charting

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

    Question, to create Half Hour charting

    Hi,

    I would like to create a Crossover strategy with a slow moving average based on the Half Hour bar and a 9 moving average. Can this be done? I have tried using a value of 270 (9 x 30), but I do not think it working correctly.

    Thanks so much,

    kenny

    #2
    Hello Kenny,

    Yes, this can be done.

    Are you planning to add this to a 30 minute chart?

    To have a crossover you need two moving averages of different lengths that use two different period values (number of bars for calculation) so that these are not the same line so that these can cross.

    For example you can create an SMA with a value of 9 and another SMA with a value of 30.

    Below is a link to a video that demonstrates creating a simple moving average crossover script.



    Are you trying to use a secondary series as an input series for the indicators so that the script can be applied to any interval and still use a 30 minute series for the indicators?

    An example of this can be found in the help guide with BarsArray, which is populated with calls to AddDataSeries().




    Please see the following about getting started with NinjaScript.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Good to know that it can be done. I do have working strategies with one minute bars for the 50 and 9 moving averages and profits, stops, etc. plus testing experience.

      I can't figure out how to create the 30 minute bar with 9 moving average. then I would use say a one minute bar 9 moving average to cross over.



      This method does not seem to be working. I can also plot my MA's on the back test chart. But I can't change the chart to a 30 minute....

      I mostly need to see the way to begin. Thank you so much,
      kenny

      Comment


        #4
        Hello Kenny,

        It sounds like you trying to use a secondary series as an input series for the indicators so that the script can be applied to any interval and still use a 30 minute series for the indicator.

        Is this what you are trying to do?

        Have you added a 30 minute series to your script with AddDataSeries?

        Are you using BarsArray[1] as the input series for the indicator call?

        Below is a link to post #2 where I have linked the help guide with AddDataSeries and BarsArray.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          OK, thank you so much Chelsea, looks like I need to use coding in order to get what I really want. I have seen some videos on exporting my script and editing. I have saved the links you gave me. Thanks for helping see what I'm really missing and how to get on the right track.
          Kenny

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kujista, Today, 05:44 AM
          0 responses
          1 view
          0 likes
          Last Post kujista
          by kujista
           
          Started by ZenCortexCLICK, Today, 04:58 AM
          0 responses
          5 views
          0 likes
          Last Post ZenCortexCLICK  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          172 responses
          2,281 views
          0 likes
          Last Post sidlercom80  
          Started by Irukandji, Yesterday, 02:53 AM
          2 responses
          18 views
          0 likes
          Last Post Irukandji  
          Started by adeelshahzad, Today, 03:54 AM
          0 responses
          8 views
          0 likes
          Last Post adeelshahzad  
          Working...
          X