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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    72 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    143 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    76 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    47 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    51 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X