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

MultiTimeFrame and Inputs

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

    MultiTimeFrame and Inputs

    Hi,

    i have a problem whit MTFs.

    Why is this script not practicable?

    Both EMAs are the same (in HTF).

    Thanks for Answers, and sorry for my bad english

    post scriptum

    I also use
    Code:
    				EmaS = EMA(Closes[0],200);
    				EmaL = EMA(Closes[1],200);
    with the same result.
    Attached Files
    Last edited by ibrsc; 12-06-2016, 07:50 AM.

    #2
    Hello ibrsc,

    I'd like to clarify what your inquiry is.

    Are you asking why the values of the moving averages are the same when there is a bar for both series?

    In the output window you have a screenshot of, there are prints that show the emaS and emaL values are different unless both series are processing. Likely this is because the secondary series is a multiple of the primary series, so the primary would become a finer tuned ma of the same data.

    The values on these two indicator calls are expected to be very very similar as they are using the same instrument over slightly different time frames. If the time frames were arbitrary (for example a 3 minute and a 7 minute), it would much less often the values are exactly the same (until there is a multiple, my guess would be every 21 minutes).
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your answer,

      but an ema(200) over 1min is not the same as an ema(200) on 5min,
      (200 * 1min bars) vs. (200 * 5min bars)
      as you can see at the screenshot from the chart.

      Comment


        #4
        Hello ibrsc,

        I'm noticing two things.
        The code in your script does not match the code in your first post.

        EmaS = EMA(Inputs[0],200);
        EmaL = EMA(Inputs[1],200);

        Also, you are trying to use Inputs[1] in State.Configure which will not work.
        When you call AddDataSeries() in State.Configure, the data is not yet available until State.DataLoaded.

        You must move this to State.DataLoaded or after.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          how to plot indicator of a secondary series

          This is how to do it.

          If the secondary series has a higher time frame than that of the price series of the chart, the secondary indicator will plot as a step function since its values change only on the first tick of each bar of the secondary series, and remain constant during the lifetime of each secodnary bar..

          MTF code needs to pass the test of plotting the same in historical, whether tick replay or not, and realtime.

          If the percentage of completion for the secondary series bar type can be calculated, the intermediate values of the secondary series can be calculated by interpolation. This worked OK in NT7, but works better in NT8 because of the finer granularity of the time stamps. Screenshot attached
          Attached Files
          Last edited by Ricam; 12-07-2016, 01:25 AM.

          Comment


            #6
            @NinjaTrader_ChelseaB: Thats the solution!

            thanks
            Attached Files
            Last edited by ibrsc; 12-07-2016, 02:49 AM.

            Comment


              #7
              @Ricam:

              this was not the problem,

              but also thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Aviram Y, Today, 05:29 AM
              0 responses
              2 views
              0 likes
              Last Post Aviram Y  
              Started by quantismo, 04-17-2024, 05:13 PM
              3 responses
              25 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by ScottWalsh, 04-16-2024, 04:29 PM
              7 responses
              34 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by cls71, Today, 04:45 AM
              0 responses
              6 views
              0 likes
              Last Post cls71
              by cls71
               
              Started by mjairg, 07-20-2023, 11:57 PM
              3 responses
              218 views
              1 like
              Last Post PaulMohn  
              Working...
              X