Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IsFalling problem.

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

    IsFalling problem.

    Sorry this should have been posted in the NT8 section.

    Hi, I have been trying to use "IsFalling" in an indicator code, and it just isn't working for me.
    I must be doing something wrong, but I just can't figure it out. I have tried it a couple of ways as follows:
    if (IsFalling(SMA(Typical,3))) && Close[0]>BP[0]);
    BarBrush = TransitionUp;

    if (IsFalling(BP)) && Close[0]>BP[0]);
    BarBrush = TransitionUp;

    if (BP[0]<BP[1] && Close[0]>BP[0]);
    BarBrush = TransitionUp;

    You should know, BP[0] = SMA(Typical, 3)[0];

    All 3 of these examples don't work.
    I have had trouble when trying to use IsRising / IsFalling in the past.
    Can you see what I have done wrong and how to correct it?

    Thanks,
    Ken.
    Last edited by KennyK; 09-07-2017, 11:54 PM. Reason: Forgot something

    #2
    Hello KennyK,

    Thanks for your post.

    The conditional statements look like they have a semi-colon ";" at the end which would prevent them from working as intended.

    I would advise coding in this manner to help clarify:

    if (Conditional statements)
    {
    action statements;
    }

    The "curley braces" { } would contain all of the actions to perform be they 1 or more action statements. If you only have 1 action statement the {} are not technically needed but they may help you develop a coding consistency. For example:

    if (IsFalling(SMA(Typical,3))) && Close[0]>BP[0])
    {
    BarBrush = TransitionUp;
    }

    Comment


      #3
      Many Thanks

      Thanks Paul you bloody legend!
      That's got it sorted.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      156 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      90 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      143 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      130 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X