Re: MT4 Indicator requests and ideas

19492
Hello Mr.Tools or kvak or anyone....

can you fix this indicator coz when using certain averages or price options the bars fly way out of bounds to ridiculous values when the candle opens.

I know Mr.Tools said once he lost the indicator when the drive crashed, but I'm hoping for a rebuild, it's a very good indi.....

*nudge nudge*


ps: any interest in an update on the swinging setup ? see screenshot, doing tweeking not done.....but I'm on the swinging side of do it/not do it....
Check out my Intraday Swinging Setup - Updated Q4 2022... viewtopic.php?p=1295496595#p1295496595


Re: MT4 Indicator requests and ideas

19496
simon_n3z wrote: Thu Oct 19, 2023 1:12 pm Hello Mr.Tools or kvak or anyone....

can you fix this indicator coz when using certain averages or price options the bars fly way out of bounds to ridiculous values when the candle opens.

I know Mr.Tools said once he lost the indicator when the drive crashed, but I'm hoping for a rebuild, it's a very good indi.....

*nudge nudge*


ps: any interest in an update on the swinging setup ? see screenshot, doing tweeking not done.....but I'm on the swinging side of do it/not do it....
Not sure if I can do you any good but will try.
These users thanked the author mrtools for the post:
simon_n3z

Re: MT4 Indicator requests and ideas

19498
TRADINGVIEW INDICATOR: "Extreme Entry with Mean Reversion and Trend Filter" by spudow

Lately I've been diving very deep into the world of mean reversion. And this TradingView indicator came up that on appearance looks like a very simple yet powerful tool to use for finding those extreme reversals on smaller timeframes.

Here is the TradingView link.

However, before I get started I want to mention this is an upgrade to spudow's first indicator called "Edri Extreme Points Buy & Sell".

I won't post the entire description but near the end he provides a summary of how his first indicator works:

In summary this is how this indicator works:
• The indicator takes input settings such as the choice between using CCI or Momentum as the entry signal source, length parameters for CCI/Momentum, RSI levels for overbought and oversold conditions, RSI length, and options to plot mean reversion bands on the chart.
• It calculates the CCI and Momentum and RSI values based on user-defined length..
• It checks for regular bullish and bearish divergences (3 periods) in the RSI if the option is enabled.
• The script plots shapes on the chart to indicate the buy and sell signals based on the entry conditions.
• If the mean reversion bands option is enabled, it calculates the mean reversion, standard deviation, upper band, and lower band values.
• It also plots the upper band, mean reversion line, and lower band on the chart if the mean reversion bands option is enabled.
• This indicator includes alert conditions to generate alerts for the buy and sell signals.
• On top of that, users can opt to use only one alert for both buy and sell signals. (This can save Trading view subscribers with limited alerts.)


That first indicator was 50 lines of code despite the extended description. This upgraded indicator is 77 lines of code.

Here is the description and the accompanying pictures to explain the logic behind spudow's upgrade:


This non-repainting indicator is an improved version of my previous work, a more versatile tool designed to provide traders with dynamic and adaptive entry signals while incorporating a mean reversion and trend filtering mechanism. By combining RSI overbought/oversold, regular divergence and confirmatory momentum oscillator such as CCI or MOM, this indicator generates more precise and timely signals for entering trades.

The indicator offers a comprehensive set of entry conditions for both Buy and Sell entries:


Image


• For Buy entries, it checks for oversold conditions based on RSI levels, and detects bullish divergence patterns while oversold and it identifies upward crossovers in the selected entry signal source (CCI or Momentum).

• Similarly, for Sell entries, it identifies downward crossovers of the CCI or Mom, after the recent overbought conditions, and bearish divergence patterns inside the overbought RSI.


Image


To refine the entry signals even further, the indicator utilizes a mean reversion filter. Traders can choose to display signals that occur inside or outside the upper and lower mean reversion bands:

• Range Entries are indicating potential buying opportunities near the lower band and selling opportunities near the upper band. This is based on the concept of mean reversion, which suggests that prices tend to return to the average when they reach the upper or lower bands. By focusing on these signals, traders can take advantage of price movements that have a higher probability of reversing towards the mean.


Image


• Extreme Entries, on the other hand, represent signals that occur outside of the bands, signaling potential pullbacks during strong trends. By entering positions only at extreme highs or lows, traders can avoid getting caught in the middle of the trend. This approach helps traders capitalize more favorable trading opportunities which have a high reward-risk ratio.

Image


Trend Filter acts as a directional bias for the entry signals. When enabled, long and short entry conditions are filtered based on the relationship between the closing price and the EMA.

Image


Traders have the flexibility to customize, tweak the indicator filter and values in the settings according to their preferences strategies and traded assets, tailoring the signals to their specific needs. The script sets alert conditions to trigger alerts for buy, sell, or both entry signals. This indicator can be used in conjunction with price action or other technical analysis tools for confirmation and better trading decisions.

Below is the code for spudow's upgraded indicator:

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/

//spudow @ edri
//rodavlas12
//@version=5
indicator(title='Extreme Entry with Mean Reversion and Trend Filter', overlay=true, shorttitle='Extreme Entry with MR and TR')

// Input settings
ccimomCross = input.string('CCI', 'Entry Signal Source', options=['CCI', 'Momentum'], tooltip='CCI or Momentum will be the final source of the Entry signal if selected.')
ccimomLength = input.int(10, minval=1, title='CCI/Momentum Length')
useDivergence = input.bool(false, title='Find Regular Bullish/Bearish Divergence', tooltip='If checked, it will only consider an overbought or oversold condition that has a regular bullish or bearish divergence formed inside that level.')
rsiOverbought = input.int(65, minval=1, title='RSI Overbought Level', tooltip='Adjusting the level to extremely high may filter out some signals especially when the option to find divergence is checked.')
rsiOversold = input.int(35, minval=1, title='RSI Oversold Level', tooltip='Adjusting this level extremely low may filter out some signals especially when the option to find divergence is checked.')
rsiLength = input.int(14, minval=1, title='RSI Length')
plotMeanReversion = input.bool(true, 'Plot Mean Reversion on the chart', tooltip='If checked, will use upper and lower bands to filter entry signals that are within or outside the range')
meanReversionFilter = input.string('All Entries', 'Mean Reversion Signal Filter', options=['Range Entries', 'Extreme Entries', 'All Entries'], tooltip='Entry signals filter will function only when Plot Mean Reversal is enabled')
emaPeriod = input(200, title='MR Lookback Period (EMA)')
bandMultiplier = input.float(1.8, title='MR Bands Multiplier', tooltip='Multiplier for both upper and lower bands to adjust the range.')

// Trend Filter Input
enableTrendFilter = input.bool(false, "Enable Trend Filter", tooltip="When enabled, entry signals will be filtered based on the long-term trend.")
emaPeriodFilter = input(200, title="EMA Period (Trend Filter)", tooltip="The period used for the EMA trend filter.")

// CCI and Momentum calculation
momLength = ccimomCross == 'Momentum' ? ccimomLength : 10
mom = close - close[momLength]
cci = ta.cci(close, ccimomLength)
ccimomCrossUp = ccimomCross == 'Momentum' ? ta.cross(mom, 0) : ta.cross(cci, 0)
ccimomCrossDown = ccimomCross == 'Momentum' ? ta.cross(0, mom) : ta.cross(0, cci)

// RSI calculation
src = close
up = ta.rma(math.max(ta.change(src), 0), rsiLength)
down = ta.rma(-math.min(ta.change(src), 0), rsiLength)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - 100 / (1 + up / down)
oversoldAgo = rsi[0] <= rsiOversold or rsi[1] <= rsiOversold or rsi[2] <= rsiOversold or rsi[3] <= rsiOversold
overboughtAgo = rsi[0] >= rsiOverbought or rsi[1] >= rsiOverbought or rsi[2] >= rsiOverbought or rsi[3] >= rsiOverbought

// Regular Divergence Conditions
bullishDivergenceCondition = rsi[0] > rsi[1] and rsi[1] < rsi[2]
bearishDivergenceCondition = rsi[0] < rsi[1] and rsi[1] > rsi[2]

// Entry Conditions
longEntryCondition = ccimomCrossUp and oversoldAgo and (not useDivergence or bullishDivergenceCondition)
shortEntryCondition = ccimomCrossDown and overboughtAgo and (not useDivergence or bearishDivergenceCondition)

// Mean Reversion Indicator
meanReversion = plotMeanReversion ? ta.ema(close, emaPeriod) : na
stdDev = plotMeanReversion ? ta.stdev(close, emaPeriod) : na
upperBand = plotMeanReversion ? meanReversion + stdDev * bandMultiplier : na
lowerBand = plotMeanReversion ? meanReversion - stdDev * bandMultiplier : na

// Apply signal filtering based on mean reversion bands
if plotMeanReversion
    if meanReversionFilter == 'Range Entries'
        longEntryCondition := na(longEntryCondition) ? na : longEntryCondition and (close > lowerBand and close < upperBand)
        shortEntryCondition := na(shortEntryCondition) ? na : shortEntryCondition and (close > lowerBand and close < upperBand)
    else if meanReversionFilter == 'Extreme Entries'
        longEntryCondition := na(longEntryCondition) ? na : longEntryCondition and (close < lowerBand or close > upperBand)
        shortEntryCondition := na(shortEntryCondition) ? na : shortEntryCondition and (close < lowerBand or close > upperBand)

// Trend Filter
emaPeriodFiltered = enableTrendFilter ? ta.ema(close, emaPeriodFilter) : na
 
// Apply trend filter to entry conditions
if enableTrendFilter
    longEntryCondition := longEntryCondition and (close > emaPeriodFiltered)
    shortEntryCondition := shortEntryCondition and (close < emaPeriodFiltered)

// Plotting
plotshape(longEntryCondition, title='BUY', style=shape.triangleup, text='B', location=location.belowbar, color=color.new(color.lime, 0), textcolor=color.new(color.white, 0), size=size.tiny)
plotshape(shortEntryCondition, title='SELL', style=shape.triangledown, text='S', location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.white, 0), size=size.tiny)

plot(plotMeanReversion ? upperBand : na, title='Upper Band', color=color.new(color.fuchsia, 0), linewidth=1)
plot(plotMeanReversion ? meanReversion : na, title='Mean', color=color.new(color.gray, 0), linewidth=1)
plot(plotMeanReversion ? lowerBand : na, title='Lower Band', color=color.new(color.blue, 0), linewidth=1)

// Plot EMA when Trend Filter is enabled
plot(enableTrendFilter ? emaPeriodFiltered : na, color=color.new(color.orange, 0), title="EMA (Trend Filter)")

// Entry signal alerts
alertcondition(longEntryCondition, title='BUY Signal', message='Buy Entry Signal')
alertcondition(shortEntryCondition, title='SELL Signal', message='Sell Entry Signal')
alertcondition(longEntryCondition or shortEntryCondition, title='BUY or SELL Signal', message='Entry Signal')

kvak, mrtools, or any of the many talented programmers here at Forex-Station, would it be possible to port this indicator into TradingView? I can't imagine the code is too complex or difficult just based off my first glance at it.

I am grateful for all the hard work everyone here puts in every day! :problem:

Re: MT4 Indicator requests and ideas

19499
simon_n3z wrote: Thu Oct 19, 2023 1:12 pm Hello Mr.Tools or kvak or anyone....

can you fix this indicator coz when using certain averages or price options the bars fly way out of bounds to ridiculous values when the candle opens.

I know Mr.Tools said once he lost the indicator when the drive crashed, but I'm hoping for a rebuild, it's a very good indi.....

*nudge nudge*


ps: any interest in an update on the swinging setup ? see screenshot, doing tweeking not done.....but I'm on the swinging side of do it/not do it....
Image
Posted a version here
These users thanked the author mrtools for the post:
simon_n3z


Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], DotNetDotCom [Bot], ffsss, Google [Bot], Grapeshot [Bot], IBM oBot [Bot], Jimmy, Proximic [Bot], TheJurgFX and 69 guests