• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
    https://youtu.be/HCyt90GAs9k


    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().
    http://ninjatrader.com/support/helpG.../barsarray.htm
    http://ninjatrader.com/support/helpG...dataseries.htm


    Please see the following about getting started with NinjaScript.
    http://ninjatrader.com/support/forum...609#post503609
    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.
        http://ninjatrader.com/support/forum...876#post516876
        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 ralett, Today, 11:52 AM
          0 responses
          4 views
          0 likes
          Last Post ralett
          by ralett
           
          Started by rtwave, Yesterday, 07:06 PM
          1 response
          21 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by DTSSTS, Today, 11:27 AM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by siroya, Today, 10:02 AM
          2 responses
          9 views
          0 likes
          Last Post DTSSTS
          by DTSSTS
           
          Started by pjsmith, Today, 10:50 AM
          0 responses
          7 views
          0 likes
          Last Post pjsmith
          by pjsmith
           
          Working...
          X