MarketMechanik Oscillator – Precision Meets Simplicity
MarketMechanik is a custom-built oscillator designed for clarity, speed, and performance. Whether you're identifying trend strength, spotting momentum shifts, or confirming entries and exits, this tool gives you exactly what you need — no clutter, just clean signals.
Optimized for traders who value efficiency and precision, MarketMechanik helps you stay focused and make better decisions in any market condition.
COPY SCRIPT
Available now on TradingView. Try it out and feel the difference.
OPEN SOURCE SCRIPT MARKET MACHANIK OSLITAR:
COPY SCRIPT IN YOUR TRADING VIEW TOO USE FREE MARKET MECHANIK OSILATOR.
//@version=5
indicator("MARKETMECHANIK.COUSTUM -", overlay=false)
// Inputs for the first indicator
src = close
len = input.int(14, title="RSI Length")
len2 = input.int(9, title="SMA of RSI Length")
len3 = input.int(45, title="EMA of RSI Length")
rsiOverbought = input.int(70, title="RSI Overbought")
rsiOversold = input.int(30, title="RSI Oversold")
overConditionOnly = input.bool(title="Show overbought/sold conditions only", defval=true)
bandLength = input.int(31, title="Band Length")
offs = input.float(1.6185, title="Multiplier for Band Calculation")
// Select moving average type
ma_type = input.string(title="Moving Average Type", defval="SMA", options=["SMA", "EMA", "WMA", "RMA"])
// Function to get the selected moving average
get_ma(source, length) =>
    if ma_type == "SMA"
        ta.sma(source, length)
    else if ma_type == "EMA"
        ta.ema(source, length)
    else if ma_type == "WMA"
        ta.wma(source, length)
    else
        ta.rma(source, length)
rsiValue = ta.rsi(src, len)
smaRSI = get_ma(rsiValue, len2)
emaRSI = get_ma(rsiValue, len3)
plot(rsiValue, title="RSI", style=plot.style_line, linewidth=2, color=color.new(color.gray, 20))
longCondition = ta.crossover(smaRSI, emaRSI)
shortCondition = ta.crossunder(smaRSI, emaRSI)
plot(series=longCondition ? smaRSI : na, linewidth=2, title="Bullish Cross", style=plot.style_cross, color=color.green)
plot(series=shortCondition ? smaRSI : na, title="Bearish Cross", style=plot.style_cross, linewidth=2, color=color.red)
plot(smaRSI, title="SMA of RSI", style=plot.style_line, linewidth=1, color=color.green)
plot(emaRSI, title="EMA of RSI", style=plot.style_line, linewidth=1, color=color.red)
ma = ta.sma(rsiValue, bandLength)
upb = ma + offs * ta.stdev(rsiValue, bandLength)
dnb = ma - offs * ta.stdev(rsiValue, bandLength)
mid = (upb + dnb) / 2
plot(upb, "Upper Band", color=color.orange)
plot(dnb, "Lower Band", color=color.orange)
plot(mid, "Middle of Bands", color=color.new(color.gray, 60), linewidth=1, style=plot.style_stepline)
rsiBBCrosTop = ta.crossover(rsiValue, upb) and not ta.crossover(rsiValue[1], upb)
rsiBBCrosBottom = ta.crossunder(rsiValue, dnb) and not ta.crossunder(rsiValue[1], dnb)
rsiBBCrosBottomUp = ta.crossover(rsiValue, dnb) and not ta.crossover(rsiValue[1], dnb)
if (rsiBBCrosTop and overConditionOnly and rsiValue <= rsiOverbought)
    rsiBBCrosTop := false
if (rsiBBCrosBottom and overConditionOnly and rsiValue >= rsiOversold)
    rsiBBCrosBottom := false
if (rsiBBCrosBottomUp and overConditionOnly and rsiValue >= rsiOversold)
    rsiBBCrosBottomUp := false
plot(series=rsiBBCrosTop ? rsiValue : na, linewidth=2, title="Bearish Cross", style=plot.style_cross, color=color.white)
plot(series=rsiBBCrosBottom ? rsiValue : na, title="Bullish Cross", style=plot.style_cross, linewidth=2, color=color.gray)
plot(series=rsiBBCrosBottomUp ? rsiValue : na, title="Bullish Cross Up", style=plot.style_cross, linewidth=2, color=color.white)
hline(rsiOverbought, title="Upper Limit", linestyle=hline.style_dashed, color=color.new(color.gray, 55))
hline(50, title="Midline", linestyle=hline.style_dotted, color=color.new(color.gray, 55))
hline(rsiOversold, title="Down Limit", linestyle=hline.style_dashed, color=color.new(color.gray, 55))
band2 = hline(65, title='Upper Line for Bullish Control Zone', color=color.new(color.green, 60), linestyle=hline.style_solid, linewidth=1)
band3 = hline(60, title='Lower Line for Bullish Control Zone', color=color.new(color.green, 60), linestyle=hline.style_solid, linewidth=1)
band1 = hline(45, title='Upper Line for Bearish Control Zone', color=color.new(color.red, 60), linestyle=hline.style_solid, linewidth=1)
band0 = hline(30, title='Lower Line for Bearish Control Zone', color=color.new(color.red, 100), linestyle=hline.style_solid, linewidth=1)
fill(band1, band0, color=color.new(color.red, 90), title="Bearish Control Zone Fill")
fill(band3, band2, color=color.new(color.green, 90), title="Bullish Control Zone Fill")
// Inputs for the second indicator
rsi_length2 = input.int(14, title="RSI Length 2")
mfi_length = input.int(14, title="MFI Length")
smoothK = input.int(3, title="Smooth K")
smoothD = input.int(3, title="Smooth D")
lengthRSI = input.int(14, title="Length RSI")
lengthStoch = input.int(14, title="Length Stochastic")
tradingOpportunity = input.int(2, title="Opportunity (0 = Okay, 1 = Good, 2 = Very Good)")
longThreshhold = tradingOpportunity == 0 ? 40 : tradingOpportunity == 1 ? 30 : tradingOpportunity == 2 ? 20 : 0
shortThreshhold = tradingOpportunity == 0 ? 60 : tradingOpportunity == 1 ? 70 : tradingOpportunity == 2 ? 80 : 0
// Calculations for the second indicator
mfi = ta.mfi(src, mfi_length)
rsi2 = ta.rsi(src, rsi_length2)
rsi1 = ta.rsi(close, lengthRSI)
k = ta.sma(ta.stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = ta.sma(k, smoothD)
longSignal = mfi < longThreshhold and rsi2 < longThreshhold and k < longThreshhold and d < longThreshhold ? 1 : -1
shortSignal = mfi > shortThreshhold and rsi2 > shortThreshhold and k > shortThreshhold and d > shortThreshhold ? 1 : -1
plot(k, color=color.red, linewidth=2, title="K") // K
plot(d, color=color.green, linewidth=2, title="D") // D
plot(rsi2, color=color.yellow, linewidth=2, title="RSI 2") // RSI 2
plot(mfi, color=color.blue, linewidth=2, title="MFI") // MFI
hline(longThreshhold, color=color.black, linewidth=3, linestyle=hline.style_dashed, title="Long Threshold") // Long Threshold
hline(shortThreshhold, color=color.black, linewidth=3, linestyle=hline.style_dashed, title="Short Threshold") // Short Threshold