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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    60 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    43 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X