Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting CCI from second timeframe

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

    Getting CCI from second timeframe

    Hello!
    I want to get value of CCI from second timeframe. But calculated values is invalid.
    What I do:

    1. Add(PeriodType.Minute, 15); // in Initialize()
    2. In OnBarUpdate() call Print(Time[0] + " " + CCI(BarsArray[1], 21)[0]) that theoretically should return the current CCI value on M15 time-frame. But values ​​differ radically. The actual value is greater +175, but the function returns -145.

    What am I doing wrong?

    Base timeframe is M1. Print calling when BarsInProgress==0, i.e I handle only the closure of the main bars timeframe ( in Initialize() added CalculateOnBarClose = true ).

    Thanks.

    #2
    romanick,

    Could you please post more of your code here? Alternatively you can send this to support at ninjatrader dot com with ATTN : Adam in the message body along with a link to this thread.

    I look forward to assisting you.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      In attachment two files: the sample strategy code to illustrate my problems, and screen shot, when can you see invalid results of script work (in output window, value of cci on M15 equal to -147, but on chart cci value is about -130.
      Attached Files

      Comment


        #4
        romanick,

        I am not able to replicate this currently, as when an order is generated I did verify the CCI is correct. Do you have the CCI set to calculate on bar close = false in your chart for comparison?
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X