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 sjsj2732, 03-23-2026, 04:31 AM
      0 responses
      76 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      313 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      312 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      149 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      113 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X