Re: RSI Indicators for MT4

2734
RSI TREND LINE WITH BREAKOUT
Hope I'm on the right thread

In my opinion I believe that rsi trend line with breakout alert is a useful tool but we lack such tool here on mt4 and mt5 platform.
Actually I found this tool on trading view, please can someone help make it available/ covert it to mt4

Here is the link to the trading view page, the code and the tool description can be found there
https://www.tradingview.com/script/YcKr ... Breakouts/

Code: Select all

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © HoanGhetti

//@version=5
indicator("RSI Trendlines with Breakouts [HG]", precision = 2, max_labels_count = 500, max_lines_count = 500)
import HoanGhetti/SimpleTrendlines/3 as tl

g_trendlines    = 'Trendline Settings', g_conditions = 'Conditions',  g_styling = 'Styling', g_timeframe = 'Timeframe'
input_timeframe = input.timeframe(defval = '', title = 'Timeframe', group = g_timeframe)
input_pLen      = input.int(defval = 4, title = 'Lookback Range', minval = 1, group = g_trendlines, tooltip = 'How many bars to determine when a swing high/low is detected.')
input_rLen      = input.int(defval = 14, title = 'RSI Length' , minval = 1, group = g_trendlines)
input_rSrc      = input.source(defval = close, title = 'RSI Source', group = g_trendlines)
input_repaint   = input.string(defval = 'On', title = 'Repainting', group = g_conditions, options = ['On', 'Off: Bar Confirmation'], tooltip = 'Bar Confirmation: Generates alerts when candle closes. (1 Candle Later)')
input_rsiDiff   = input.int(defval = 3, title = 'RSI Difference', group = g_conditions, tooltip = 'The difference between the current RSI value and the breakout value.\n\nHow much higher in value should the current RSI be compared to the breakout value in order to detect a breakout?')
input_rsiCol    = input.color(defval = color.blue, title = 'RSI Color', group = g_styling)
input_width     = input.int(defval = 2, title = 'Line Width', minval = 1, group = g_styling)
input_lblType   = input.string(defval = 'Simple', title = 'Label Type', group = g_styling, options = ['Full', 'Simple'])
input_lblSize   = input.string(defval = size.small, title = 'Label Size', group = g_styling, options = [size.huge, size.large, size.normal, size.small, size.tiny])
input_pLowCol   = input.color(defval = color.red, title = 'Pivot Low', inline = 'col', group = g_styling)
input_pHighCol  = input.color(defval = #089981, title = 'Pivot High', inline = 'col', group = g_styling)
input_override  = input.bool(defval = false, title = 'Override Text Color', group = g_styling, inline = 'override')
input_overCol   = input.color(defval = color.white, title = ' ', group = g_styling, inline = 'override')

lblText = switch input_lblType
    'Simple' => 'Br'
    'Full'   => 'Break'
repaint = switch input_repaint
    'On' => true
    'Off: Bar Confirmation' => false

rsi_v = ta.rsi(input_rSrc, input_rLen) 
rsi = input_timeframe == '' ? rsi_v : request.security(syminfo.tickerid, input_timeframe, rsi_v, lookahead = barmerge.lookahead_on)

pl = fixnan(ta.pivotlow(rsi, 1, input_pLen))
ph = fixnan(ta.pivothigh(rsi, 1, input_pLen))

pivot(float pType) =>
    pivot = pType == pl ? pl : ph
    xAxis = ta.valuewhen(ta.change(pivot), bar_index, 0) - ta.valuewhen(ta.change(pivot), bar_index, 1)
    prevPivot = ta.valuewhen(ta.change(pivot), pivot, 1)
    pivotCond = ta.change(pivot) and (pType == pl ? pivot > prevPivot : pivot < prevPivot)
    pData = tl.new(x_axis = xAxis, offset = input_pLen, strictMode = true, strictType = pType == pl ? 0 : 1)
    pData.drawLine(pivotCond, prevPivot, pivot, rsi)
    pData

breakout(tl.Trendline this, float pType) =>
    var bool hasCrossed = false
    if ta.change(this.lines.startline.get_y1())
        hasCrossed := false
    this.drawTrendline(not hasCrossed)
    condType = (pType == pl ? rsi < this.lines.trendline.get_y2() - input_rsiDiff : rsi > this.lines.trendline.get_y2() + input_rsiDiff) and not hasCrossed
    condition = repaint ? condType : condType and barstate.isconfirmed
    if condition
        hasCrossed := true
        this.lines.startline.set_xy2(this.lines.trendline.get_x2(), this.lines.trendline.get_y2())
        this.lines.trendline.set_xy2(na, na)
        this.lines.startline.copy()
        label.new(
             bar_index, 
             this.lines.startline.get_y2(), 
             text = lblText, color = pType == pl ? color.new(input_pLowCol, 50) : color.new(input_pHighCol, 50), 
             size = input_lblSize, style = pType == pl ? label.style_label_lower_left : label.style_label_upper_left, 
             textcolor = pType == pl ? (input_override ? input_overCol : input_pLowCol) : input_override ? input_overCol : input_pHighCol)
    hasCrossed

method style(tl.Trendline this, color col) =>
    this.lines.startline.set_color(col)
    this.lines.startline.set_width(input_width)
    this.lines.trendline.set_color(col)
    this.lines.trendline.set_width(input_width)
    this.lines.trendline.set_style(line.style_dashed)

plData = pivot(pl)
phData = pivot(ph)
plData.style(input_pLowCol)
phData.style(input_pHighCol)
cu = breakout(plData, pl)
co = breakout(phData, ph)

hline(70, title = 'Overbought', color = input_pHighCol, linestyle = hline.style_dotted)
hline(30, title = 'Oversold', color = input_pLowCol, linestyle = hline.style_dotted)
plot(rsi, title = 'Relative Strength Index', linewidth = 2, color = input_rsiCol)
alertcondition(ta.change(plData.lines.startline.get_y1()), 'New Pivot Low Trendline')
alertcondition(ta.change(cu) and cu, 'Pivot Low Breakout')
alertcondition(ta.change(phData.lines.startline.get_y1()), 'New Pivot High Trendline')
alertcondition(ta.change(co) and co, 'Pivot High Breakout')
Attachments
These users thanked the author Mrtrader for the post:
Jimmy
everyone is brain washed either by religion, weed, self-talking, alcohol even those who doubt the most are self brain washed

Re: RSI Indicators for MT4

2735
Good morning sirs
To our all time problem solver and my fellow trader
Please is there any chances we are getting this tool rsi trend line breakout with alert @mrtool, @kvak

How it works
Before a trendline is drawn, the script retrieves the slope between the previous pivot point and the current. Then it adds or subtracts the slope x amount of times (based on the lookback range) from the current pivot value until the current x-axis is reached. By doing this we can get a trendline that will detect a breakout accurately.

It's a pivot-based breakout indicator that attempts to provide traders with a visual aid for finding breakouts on the RSI. Similar to how we use trendlines on our charts, using them on the Relative Strength Index can also give us a sense of direction in the markets.

🔳 Settings
Lookback Range: Lookback period to trigger a new pivot point when conditions are met.
RSI Difference: The difference between the current RSI value and the breakout value. How much higher in value should the current RSI be compared to the breakout value in order to detect a breakout?
RSI Settings
Styling Options

🔳 Repaint Options
On: Allows repainting
Off - Bar Confirmation: Prevents repainting and generates alerts when the bar closes. (1 candle later)
everyone is brain washed either by religion, weed, self-talking, alcohol even those who doubt the most are self brain washed


Re: RSI Indicators for MT4

2736
I'm really sorry for posting a tool request in here which I'm not supposed to do, I just realized it. Is there anyway I can delete the posting, house please forgive my trespass
everyone is brain washed either by religion, weed, self-talking, alcohol even those who doubt the most are self brain washed

Re: RSI Indicators for MT4

2737
I thought this was a fantastic illustration of how powerful divergence can be on the Rsx indicator - if you patiently wait.
The key in my post is that the extreme levels are used for trap lines to show divergence more clearly, not divergences on the inner values.
This is on the 5m chart of the Dow and was almost 200 pts - so imagine if it were picked up on the 4hr or bigger timeframes. Very profitable.
TEAMTRADER
Attachments
These users thanked the author TEAMTRADER for the post (total 2):
BeatlemaniaSA, Jonex1995

Re: RSI Indicators for MT4

2739
mrtools wrote: Wed Feb 14, 2024 5:46 am Ultimate RSI with Overbought & Oversold Shading, MTF, Filtering (Smoothing), Alerts & On/Off Toggle button

Added filtering.
Hello mrtools
would it be possible to add an arrow indicator please ?
When the RSI line changes to green, show up arrow. When line changes to red, show down arrow. With separate buffers please.

This will help with my auto tester - unless i am missing something with existing buffers ? the green & red line seems to have 1 buffer only ?

Re: RSI Indicators for MT4

2740
timballingall67 wrote: Tue Mar 19, 2024 9:36 pm Hello mrtools
would it be possible to add an arrow indicator please ?
When the RSI line changes to green, show up arrow. When line changes to red, show down arrow. With separate buffers please.

This will help with my auto tester - unless i am missing something with existing buffers ? the green & red line seems to have 1 buffer only ?
Hello,

Arrows added.
These users thanked the author mrtools for the post (total 7):
RodrigoRT7, 太虚一毫, timballingall67, josi, talaate, Jimmy, alexm


Who is online

Users browsing this forum: Ahrefs [Bot], Applebot [Crawler], IBM oBot [Bot], Proximic [Bot], rafl99, saint2545, Sogou [Bot], Takashi12, Telegram [Bot], Umberleigh and 284 guests