Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multi time frame incorrect

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

    multi time frame incorrect

    Hi, I'm using a multitime frame to just see the close of each time frame, i added a 5 minute 15 minute e a 1 day series.
    But when i look at the output I have the output of the daily result every 7/8 output of 15 minutes series, that means it's not done daily but with another interval. Am i missing something ?
    thanks

    else if (State == State.Configure)
    {
    AddDataSeries(BarsPeriodType.Minute, 5);
    AddDataSeries(BarsPeriodType.Minute, 15);
    AddDataSeries(BarsPeriodType.Day, 1);

    }
    }

    protected override void OnBarUpdate()
    {

    if ( BarsInProgress == 0)
    {
    Print("Bar in progress 0 : " + Close[0].ToString());
    }

    if ( BarsInProgress == 1)
    {
    Print("Bar in progress 1 : " + Close[0].ToString());
    }
    if ( BarsInProgress == 2)
    {
    Print("Bar in progress 2 DAILY : " + Close[0].ToString());
    }

    #2
    Hello AlessioCianini12,

    Thank you for your post.

    You're not printing on the correct BarsInProgress. Keep in mind that BarsInProgress == 0 will always be the primary data series on the chart, and then the BarsInProgress index for each additional series added with AddDataSeries would start at BarsInProgress == 1 and go up for each added series. Try this and you should see the prints you'd expect:

    Code:
    if (BarsInProgress == 1)
    {
    Print("Bar in progress : "+ BarsInProgress + " 5 : " + Close[0].ToString());
    }
    if (BarsInProgress == 2)
    {
    Print("Bar in progress : "+ BarsInProgress + " 15 : " + Close[0].ToString());
    }
    if (BarsInProgress == 3)
    {
    Print("Bars in progress: "+ BarsInProgress + " DAILY : " + Close[0].ToString());
    }
    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    47 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    23 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    33 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X