Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
     }
    BertrandNinjaTrader Customer Service

    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 MacDad, 02-25-2024, 11:48 PM
      7 responses
      158 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Today, 09:29 PM
      0 responses
      7 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      151 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      6 views
      0 likes
      Last Post mattbsea  
      Working...
      X