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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    61 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X