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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        59 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        144 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        283 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X