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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    429 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    281 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    241 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    330 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    290 views
    0 likes
    Last Post CarlTrading  
    Working...
    X