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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    17 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    59 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    43 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X