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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    476 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    317 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    254 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    340 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    305 views
    0 likes
    Last Post CarlTrading  
    Working...
    X