Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Signals from Different Time frames

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

    Signals from Different Time frames

    So...

    I've understood how to use the add additional data series in order to link different indicators or prices to different time frames.
    For example MACD on 'Weekly' Data, Stock on 'Daily' data etc etc...

    But even If each of the indicator is linked to a specific data series, if I change the Data series input on the Strategy Analyser...I get different results/signals. I was expecting the result indifferent to the Data series selected on the Strategy Analyser since all was referenced to a specific series in the Strategy Builder.

    Any help would be appreciated!

    Mp

    #2
    Hello percma,

    Thank you for your note.

    What syntax are you using for your add data series calls?

    For example,
    Code:
    AddDataSeries(BarsPeriodType periodType, int period)
    https://ninjatrader.com/support/help...dataseries.htm

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      AddDataSeries(Data.BarsPeriodType.Week, 1);
      AddDataSeries(Data.BarsPeriodType.Day, 1);
      AddDataSeries(Data.BarsPeriodType.Minute, 60);

      I use Strategy Builder. This is what I find on the Script Editor but is not compiled by me.

      Comment


        #4
        Hello percma,

        This is expected and relates to the feature request SFT 882, which has considerable interest, for which I will add your vote to. This SFT would allow dynamic loading of additional data series.

        Each time you wish to change the instrument you will have to remove and re-add the instance of the strategy. This is because your adddataseries are not guaranteed to be called on an instrument change.

        The third warning at the following link relates to your issue,
        https://ninjatrader.com/support/help...dataseries.htm

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

        Comment


          #5
          Hey Alan,

          this is getting a bit complicated for my level...

          so:
          Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables

          I don't understand the above...but mostly what should I do (I use strategy builder) if I want to have a multi timeframes signals?
          Would it be different if I use just 1 adddataseries additionally to the Default Input?

          Comment


            #6
            Hello percma,

            You would not need to modify your code but instead when you want to change the instrument you're testing you should remove the strategy and readd it with the desired instrument. Start with a fresh strategy each time.

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

            Comment


              #7
              ok. but would the data series input that I choose for the chart have an effect on the way the strategy operates? even if each indicator is linked to a specific data series (and each data series is uploaded as additional data)?

              I'm asking this because if I use different time frames in the in the strategy analyser ...I get different results even if all my indicator should be de-correlated from the instrument input time frame (since they are never linked to that in the code).

              Comment


                #8
                Hello percma,

                I might suggest adding the following print statements for each bar series, BarsArray[2] for the third series, BarsArray[1] for second series, etc. Open an output window, and check the prints on each run.

                Code:
                Print(BarsArray[1].Instrument.ToString());
                Print(BarsArray[1].BarsPeriod.ToString());
                The prints above will allow you to know exactly which instrument are being referenced as well as the period of that series.

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

                Comment


                  #9
                  Sample code request

                  Hi Alan


                  Do you have sample code that I can modify? I simply wish to have an indicator that gives an alert when price is above a 3 minute MA and also a 10 minute MA. I'm using NT7.



                  Thanks.

                  Comment


                    #10
                    Hello Slide588,

                    I do not have a sample which does this however this could be achieved with alerts in NT7,
                    https://ninjatrader.com/support/help...t7/?alerts.htm

                    Or via a script using the following,

                    Alert,
                    https://ninjatrader.com/support/help...nt7/?alert.htm

                    Close,
                    https://ninjatrader.com/support/help...nt7/?close.htm

                    SMA,
                    https://ninjatrader.com/support/help...simple_sma.htm

                    And this could be built using the strategy builder,
                    https://ninjatrader.com/support/help...y_via_the_.htm

                    Going forward if you could please avoid posting NT7 questions in the NT8 section of the forum that would be appreciated.

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

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by wftrrdt, Today, 05:01 AM
                    0 responses
                    3 views
                    0 likes
                    Last Post wftrrdt
                    by wftrrdt
                     
                    Started by wellbeingcbd, Today, 04:41 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post wellbeingcbd  
                    Started by piydasuknu, Today, 03:45 AM
                    0 responses
                    3 views
                    0 likes
                    Last Post piydasuknu  
                    Started by ajdfkgjiojjhfihjg, Today, 03:20 AM
                    0 responses
                    3 views
                    0 likes
                    Last Post ajdfkgjiojjhfihjg  
                    Started by keravitahere, Today, 01:56 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post keravitahere  
                    Working...
                    X