Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsInProgress

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

    BarsInProgress

    I think I'm misunderstanding how to BarsInProgress correctly


    else if (State == State.Configure)
    {
    AddDataSeries(Data.BarsPeriodType.Tick, 1);
    AddDataSeries(Data.BarsPeriodType.Minute, 15);
    AddDataSeries(Data.BarsPeriodType.Minute, 30);
    AddDataSeries(Data.BarsPeriodType.Day, 1);
    }
    protected override void OnBarUpdate()
    {
    if (BarsInProgress != 0)
    return;

    if (CurrentBars[0] < 1
    || CurrentBars[2] < 1
    || CurrentBars[3] < 1)
    return;

    // Set 1
    if(BarsInProgress == 2)
    {
    Print(@"Time:" + Convert.ToString(Times[0][0]) + @": | 15Volume:" + Convert.ToString(Volumes[2][0]) + @": | 15Delta:" + Convert.ToString(VolumeDelta1.DeltasClose[0]) + @": | 30Volume:" + Convert.ToString(Volumes[3][0]) + @": | 30Delta:" + Convert.ToString(VolumeDelta2.DeltaClose[0]));
    Print(@"Time " + Convert.ToString(Times[0][0]) + @" | BidVolume " + Convert.ToString(GetCurrentBidVolume(3)) + @" | AskVolume " + Convert.ToString(GetCurrentAskVolume(0)));
    }


    }

    I am not seeing any prints when BarsInProgress = 2.


    #2
    Hi AdeptistJune, this line is preventing OnBarUpdate from running in other series:
    if (BarsInProgress != 0)
    return;

    That is added by the strategy builder, so if you want to run code in other series remove this.

    Kind regards.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    86 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    150 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    79 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    52 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    59 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X