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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        50 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        16 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X