Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

short-term S/R

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

    short-term S/R

    I'm trying to locate and store the highest Open among the last bearish bars, since I've seen that this highest Open is a pretty significant short-term resistance, especially in calm markets, or breakout point, when crossed especially in trendy markets (same thing for the opposite case of the lowest Open among the last bullish bars).
    This easy script of mine seems to work well, creating a signal whenever these short-term resistance and support levels are broken, but I fear it could not apply to any possible case.
    Could it be written better ?



    #2
    Sorry, this is the code:

    if
    (Close[0] > Open[0]) // bullish bar
    {
    SUPPORT = Open[0]; // old short-term support
    if (Open[0]<newSUPPORT || newSUPPORT==0)
    {
    newSUPPORT=Open[0];// new support
    }
    }

    if (Close[0] < Open[0]) // bearish bar
    {
    RESIST = -Open[0]; // old short-term resistance (negative to avoid problems with the very first occurence)
    if (Open[0]>newRESIST)
    {
    newRESIST=Open[0]; // new resistance
    }
    }

    //// Alerts:
    if (Open[0] < Close[0] && High[0] > Math.Abs (RESIST)) // broken resistance
    {
    ENTERsignal = -1;
    SUPPORT = Open[0]; RESIST = 0; // resets
    }

    if (Open[0] > Close[0] && Low[0] < SUPPORT) // broken support
    {
    ENTERsignal = 1;
    RESIST = -Open[0]; SUPPORT = 0; // resets
    }

    Last edited by AlexAlex; 12-22-2015, 05:00 AM.

    Comment


      #3
      Hello,

      Thank you for the question,

      I am not sure where I could assist on this question, are you running into a problem regarding the supplied code or is it not doing what you had intended?

      I would not be sure if this could be re created in a better way without knowing first the reason it needs to be modified.

      If it is not having any problems it could likely be left alone, otherwise if it just needs to account for additional conditions, it seems you are well on your way there but I would not necessarily have any suggestions to make it better.

      I look forward to being of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      649 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      576 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X