Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsInProgress inside conditional

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

    BarsInProgress inside conditional

    Hi,

    I always used BarsInProgress the way it shows on the help guide

    if (BarsInProgress == 0)
    {
    // Do something
    }

    I would like to try something different and I don't know if ti will work. I use different time frames and I would use one or another depending on the time of the session. Would it possible to write a code like this?

    if (ToTime(Time[0]) >= StartTime && ToTime(Time[0]) < EndTime)
    {
    //Use BarsInProgress = 0
    }
    else
    {
    //Use BarsInProgress = 1
    }

    How would I write the code to instruct to use BarsInProgress = 0 or BarsInProgress = 1

    #2
    You would for example just add the time filter to your already existing BarsInProgress condition, so it would only evaluate to 'true' in the time range specified.

    If you would just like to access different bars data, you could also point the calculations to another BarsArray to use in the time range needed.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by StockTrader88, 03-06-2021, 08:58 AM
    45 responses
    3,992 views
    3 likes
    Last Post johntraderuser2  
    Started by TAJTrades, Today, 09:46 AM
    0 responses
    7 views
    0 likes
    Last Post TAJTrades  
    Started by rhyminkevin, Yesterday, 04:58 PM
    5 responses
    62 views
    0 likes
    Last Post dp8282
    by dp8282
     
    Started by realblubb, Today, 09:28 AM
    0 responses
    8 views
    0 likes
    Last Post realblubb  
    Started by AaronKoRn, Yesterday, 09:49 PM
    1 response
    19 views
    0 likes
    Last Post Rikazkhan007  
    Working...
    X