Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple actions for 1 condition.

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

    Multiple actions for 1 condition.

    Morning all;

    Can any of you C# junkies help me out here please;

    If you write a condition:

    'if( ......... etc etc)
    Do something here;

    Is there an easy way of adding further 'Do somethings' without re-stating the condition?

    eg: if(Value[0] > 0) // condition
    BarColor = Color.Blue; // action

    CandleOutlineColor = Color.Red; // action for same condition

    Have been to MS C# ref library but can't find what I'm looking for.

    Thanks;

    Ben.

    PS If one of you NT guys reads this it might be a useful suggestion to your development bods to include a direct link to the MS C# Ref Library in an obvious place on all pages on this web-site or on all results pages after a search. Apologies if its all ready there.

    Read C# reference material - The language reference provides an informal reference to C# syntax and idioms for beginners and experienced C# / .NET developers.

    #2
    Hi Ben, thanks for the input on how to further enhance the docs, we're always looking to add more educational material.

    For the condition, please try :

    Code:
    if(Value[0] > 0)
     {
        BarColor = Color.Blue; // action 1
        CandleOutlineColor = Color.Red; // action 2
     }

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Ben, thanks for the input on how to further enhance the docs, we're always looking to add more educational material.

      For the condition, please try :

      Code:
      if(Value[0] > 0)
       {
          BarColor = Color.Blue; // action 1
          CandleOutlineColor = Color.Red; // action 2
       }
      Ahhhh always so obvious. Tried every operand I could think of and a few I didn't know existed but when you see the answer ...................

      Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      153 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      306 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      244 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      345 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      176 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X