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 hurleydood, 09-12-2019, 10:45 AM
      14 responses
      1,093 views
      0 likes
      Last Post Board game geek  
      Started by cre8able, Yesterday, 04:16 PM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cre8able, Yesterday, 04:22 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by stafe, 04-15-2024, 08:34 PM
      5 responses
      28 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by StrongLikeBull, Yesterday, 04:05 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X