Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using IsRising on previous bars?

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

    Using IsRising on previous bars?


    How might I use IsRising / IsFalling not from the current bar, but based upon previous bar. For example:

    Print("The SMA is " + SMA(20)[3]; // Prints the 20 SMA value based upon the third most recent bar
    Print("IsRising is " + IsRising(20)); // Prints the 20 SMA IsRising on the current bar

    Print("IsRising from 3rd most recent bar " + IsRising(SMA(20)[3])); // I get an overloaded error here


    How can I do IsRising ./ IsFalling not based upon the current bar, but previous bars? Thanks,



    #2
    Hello, thanks for writing in. IsRising/IsFalling can only be used for the immediate values of the series. You would need to write your own code that could evaluate something like:

    if(SMA(20)[5] > SMA(20)[6])
    Print("SMA was rising 5 bars ago");

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    120 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    71 views
    0 likes
    Last Post PaulMohn  
    Working...
    X