Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

test multiple condition

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

    test multiple condition

    If I can test the current bar e the previus I can write:

    if BarColorSeries[0] = Color.Blue && BarColorSeries[1] = Color.Red && BarColorSeries[2] = Color.Yellow;

    Enter Short.....

    It's correct ?

    Tanks

    #2
    Yes, that snippet looks correct to me.

    Comment


      #3
      I receive an error compiling CS0019. Why ?

      The sysntax is:


      // Condition set 1

      if (BarColorSeries[0] = Color.Lavender && BarColorSeries[1] = Color.Red)

      {
      EnterLong(DefaultQuantity,
      "");
      }

      // Condition set 2

      if (BarColorSeries[0] = Color.Lavender && BarColorSeries[1] = Color.Green)
      {
      EnterShort(DefaultQuantity,
      "");
      }

      Comment


        #4
        Sorry missed in your previous post that you did not check for equality properly =
        Code:
        if (BarColorSeries[0] == Color.Lavender && BarColorSeries[1] == Color.Red) 
        
        {
        EnterLong(DefaultQuantity, 
        ""); 
        }
        
        // Condition set 2 
        
        if (BarColorSeries[0] == Color.Lavender && BarColorSeries[1] == Color.Green) 
        {
        EnterShort(DefaultQuantity, 
        ""); 
        }

        Comment


          #5
          The same error CS0019

          The code is now

          // Condition set 1

          if (BarColorSeries[0]==Color.Lavender&&BarColorSeries[1]==Color.Red)

          {
          EnterLong(DefaultQuantity,
          "");
          }

          // Condition set 2

          if (BarColorSeries[0]==Color.Lavender&&BarColorSeries[1]==Color.Green)
          {
          EnterShort(DefaultQuantity,
          "");

          Comment


            #6
            I solve the problem....tanks

            Comment


              #7
              Was the code posted that fixed the problem?

              Comment


                #8
                Originally posted by Trader.Jon View Post
                Was the code posted that fixed the problem?
                Not sure TJ what caused it in the end - the snippet I posted works fine here.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                612 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                355 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                561 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                564 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X