Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating a Dynamic Threshold for RSI

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

    Creating a Dynamic Threshold for RSI

    Using RSI as a tool for identifying over-bought or over-sold markets is useful when markets are range-bound. But when a market wants to make a sustained one-directional move, RSI will generate a lot of false signals on the opposite side of that move.

    On the other hand, in such a strong-trending market, RSI typically can't reach its threshold on the side of that sustained move. For example, if your usual threshold for a sell-side entry is, say, 90, when market is moving strongly downward, RSI rarely will reach 85-88.

    I would like to build in to my strategy recognition of that concept. So, my idea is this:

    By defining a Lookback int variable, which would specify a look-back period, I would like my strategy to test whether market has reached that usual SignalThreshold (a double variable) during the Lookback period. If it has not, I then would like my strategy to adjust SignalThreshold by some amount (for example, 2 increments).

    My question is this:

    How do I code such a contingency into an existing strategy? That is, by using the sell side as an example, if market has not attained SignalThreshold during the Lookback period, adjust SignalThreshold to SignalThreshold - 2.

    I have tried amending my strategy to include the following, but it won't compile:

    {

    if (MAX(RSI(xx,xx),Lookback)[0] < SignalThreshold)

    SignalThreshold == SignalThreshold - 2.0;

    }

    else if ....

    Am I on the wrong track to accomplish what I want?

    #2
    Hi Longhornmark,

    Thanks for your post.

    I think the MRO() method will be useful for finding this, the MAX method is also a solution. What part of that will not compile? It looks like you just have "xx" for the parameters of RSI you must supply two integers, a period value and a smoothing value.

    Please let me know if I can assist further.

    Comment


      #3
      You want '=' instead of '=='

      Also, this is equivalent and a shorter way of writing it: SignalThreshold -= 2.0;

      *Not sure if those parentheses are in your real code, but they are surrounding the 'if' statement, so you wouldn't be able to link an 'else if' to it.

      This would fix it:

      if (MAX(RSI(xx,xx),Lookback)[0] < SignalThreshold)
      {
      SignalThreshold = SignalThreshold - 2.0;
      }
      else if..
      Last edited by anon84; 05-23-2019, 10:24 AM. Reason: parentheses

      Comment


        #4
        Indeed, it did compile with your simple edit! Thanks for your help!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        546 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X