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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      51 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      31 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      165 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      100 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      160 views
      2 likes
      Last Post CaptainJack  
      Working...
      X