Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

double bars in progress

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

    double bars in progress

    hi,this is my problem:


    if (BarsInProgress == 1)
    {
    if (close[0] <CONDITION A)
    &&{
    if (BarsInProgress == 2)
    {
    if (close[0] >CONDITION B)
    {
    EnterShort(0, "Short");
    }}}}
    I would like to have two different condition for my input order but they have two different bars in progress. Exist an alternative??
    thanks in advance

    #2
    Hello bergimax,

    BarsInProgress can only be a single value meaning that you cannot have a condition that uses something like "BarsInProgress == 1 && BarsInProgress == 2" as an integer cannot be two values at once.

    If you are looking at getting the Close values of each different BarsArray you can use the "Closes[][]" method. This way you can pass the "BarsInProgress" in the first array and the the "BarsAgo" value for the second one. Here is a link to our Help Guide that has an example of this that you may view.



    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    657 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    373 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X