Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-time frame and calculation

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

    Multi-time frame and calculation

    Hi Ninja Support Group!

    I have attached a couple of samples. MyCustomIndicator.cs is NT7 indicator. MyCustomIndicator2.cs is the attempt to convert the forst one into NT8 indicator. Please apply both to some 10-minutes chart and try to change parameter SeriesIndex. It makes sense for NT7 but not for NT8 which ignores in fact that parameter.

    What is the correct approach to rich the same behavior as in NT7?

    I hope my samples will help you to understand my question better then wordy question. )

    Thank you in advance for any assistance!
    Attached Files
    Last edited by AlexGn; 03-12-2016, 08:15 AM.

    #2
    Try this new code attached.

    I think your mistake was:

    Code:
    mySeries = new Series<double>(SMA(BarsArray[SeriesIndex], 1));
    should have been:

    Code:
    mySeries = new Series<double>(SMA(BarsArray[seriesIndex], 1));
    I did however change the code slightly in the .cs so have a look at that (including properties).
    Attached Files
    Last edited by Sim22; 03-13-2016, 07:15 PM.

    Comment


      #3
      Sim22,

      Thank you much for looking!

      But the problem I have faced is not related to that. All I have described in the first post is still true for the script corrected by you.
      It is about what series is used to calculate indicator. Dependently from the definition of mySeries MAX's (or any other) results are different. In the NT7 it calculates based on BarsArray = 0 or BarsArray = 1, but in the NT8 it is always based on BarsArray = 0. Look at screenshots I have attached.

      P.S. To create screenshots I have used the same time template (24/7) and loaded 50 bars for both NT7 and NT8
      Attached Files

      Comment


        #4
        Hello AlexGn,

        Thank you for your post.

        Try setting line 67 in NinjaTrader 8 to the following:
        Code:
        mySeries[0] = Highs[1][0];
        Please let me know if that corrects the plot.

        Comment


          #5
          Hi Patrick,

          Thank you for your suggestion but it changes nothing. The problem is not in the values of mySeries, it is in WHEN MAX(mySeries,1) is calculating. And how it depends on line mySeries = new Series<double>(SMA(BarsArray[SeriesIndex], 1));

          The indicator I am converting from NT7 to NT8 is about 3000 lines and I have spent some time to localize the issue and create those clear samples to demostrate the change of the behavior (which looks like a bug of NT8 to me). So I will be happy if you will apply them to NT7 and NT8 and will see the difference (and that using Highs[1][0] does not the change anything).

          Thank you for your assistance! I still hope that there is workaround for NT8 to reach the same result

          Comment


            #6
            Hello AlexGn,

            Thanks for your reply.

            Move the line: mySeries = new Series<double>(SMA(BarsArray[SeriesIndex], 1)); from State.Configure to State.DataLoaded.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hallelujah!
              Thank you very-very much Paul!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by usazencort, Today, 01:16 AM
              0 responses
              1 view
              0 likes
              Last Post usazencort  
              Started by kaywai, 09-01-2023, 08:44 PM
              5 responses
              603 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              6 responses
              23 views
              0 likes
              Last Post xiinteractive  
              Started by Pattontje, Yesterday, 02:10 PM
              2 responses
              22 views
              0 likes
              Last Post Pattontje  
              Started by flybuzz, 04-21-2024, 04:07 PM
              17 responses
              230 views
              0 likes
              Last Post TradingLoss  
              Working...
              X