Strategy · Pine Script v5 · On the chart

Omar MMR [Alorse]

by Alorse

Omar MMR is a long-only price-chart strategy that combines three exponential moving averages, RSI, and MACD.

View on GitHub

GitHub stars330on the repository
Pine versionv5runs as is
Lines of code56
Settings10inputs
LicenceNone statedfile: MPL-2.0
Last update2 months ago25 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

56 lines of Pine Script v5 from strategies/other/Omar MMR [Alorse].pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

Omar MMR [Alorse].pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © alorse

//@version=5
strategy("Omar MMR [Alorse]", overlay=true, pyramiding=0, currency=currency.USD, default_qty_type=strategy.percent_of_equity, initial_capital=100000, default_qty_value=100, commission_type=strategy.commission.percent)

// RSI
rsiGroup = 'RSI'
src = input(title='Source', defval=close, group=rsiGroup, inline=rsiGroup)
lenRSI = input.int(14, title='Length', minval=1, group=rsiGroup, inline=rsiGroup)
RSI = ta.rsi(src, lenRSI)

// Moving Averages
groupEma = 'Moving Averages'
len_a = input.int(20, minval=1, title='Length   A', group=groupEma, inline=groupEma)
ema_a = ta.ema(close, len_a)
plot(ema_a, title='EMA A', color=color.new(color.orange, 10))
len_b = input.int(50, minval=1, title='B', group=groupEma, inline=groupEma)
ema_b = ta.ema(close, len_b)
plot(ema_b, title='EMA B', color=color.new(color.purple, 10))
len_c = input.int(200, minval=1, title='C', group=groupEma, inline=groupEma)
ema_c = ta.ema(close, len_c)
plot(ema_c, title='EMA C', color=color.new(color.green, 10), linewidth=2)

// MACD
macdGroup = 'MACD'
fast_ma = input.int(defval=12, minval=1, title='Length   Fast', group=macdGroup, inline=macdGroup)
slow_ma = input.int(defval=26, minval=1, title='Slow', group=macdGroup, inline=macdGroup)
signal_length = input.int(defval=9, minval=1, title='Signal', group=macdGroup, inline=macdGroup)
[macd_line, signal_line, hist_line] = ta.macd(close, fast_ma, slow_ma, signal_length)

longEntry = close > ema_c and ema_a > ema_b and ta.crossover(macd_line, signal_line) and RSI > 29 and RSI < 70
isLong = strategy.position_size > 0

plot_ln = plot(isLong ? strategy.position_avg_price : na, color=#787b86, style=plot.style_linebr, linewidth=1, title="Entry Price")
// Take profit
longProfitPerc = input.float(title="Take Profit (%)", step=0.1, defval=1.5, group="Strategy") * 0.01
longExitPrice  = strategy.position_avg_price * (1 + longProfitPerc)
plot_tp = plot(isLong ? longExitPrice : na, color=color.new(#009688, 100), title="Take Profit")

// Stop loss
longLossPerc = input.float(title="Stop Loss (%)", step=0.1, defval=2.0, group="Strategy") * 0.01
longStopPrice  = strategy.position_avg_price * (1 - longLossPerc)
plot_sl = plot(isLong ? longStopPrice : na, color=color.new(#f44336, 100), title="Stop Loss")

fill(plot_ln, plot_tp, title='UpTrend Highligter', color=color.new(#009688, 80))
fill(plot_ln, plot_sl, title='DownTrend Highligter', color=color.new(#f44336, 80))

am_entry = "🔶Scalping Deal🔶\n \n 🟢**BUY NOW!**🟢\n#" + str.tostring(syminfo.ticker) + "\n\n💰Price " + str.tostring(close) + "\n⬆️Target: " + str.tostring(close * (1 + longProfitPerc)) + "\n❌Stop loss: " + str.tostring(close * (1 - longLossPerc))
ame_win="**Take Profit**\n#" + str.tostring(syminfo.ticker) + "\n\n✅Price " + str.tostring(longExitPrice)+ "\nYou won : 1.5%"
ame_loss="**Stop Loss**\n#"  + str.tostring(syminfo.ticker) + "\n\n❌Price " + str.tostring(longStopPrice)  +"\nYou lost : 2%"

exit_msg = close[1] > strategy.position_avg_price ? ame_win : ame_loss

strategy.entry('Long', strategy.long, when=longEntry, alert_message=am_entry)
strategy.exit('Exit', 'Long', limit=longExitPrice, stop=longStopPrice, alert_message=exit_msg)

Overview

Omar MMR [Alorse] enters long when price is above the slowest average, the fastest average is above the middle one, the MACD line crosses above its signal, and RSI is between 29 and 70. It exits with a percentage take profit and stop loss, both adjustable. It plots the three averages plus entry, target, and stop lines while a position is open. There are no short entries, and pyramiding is disabled.

Details

Published by

Alorse on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Trend, Oscillators & momentum, Moving averages

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

pinescriptpinescript-indicatorspinescript-strategiestrading-strategiestradingviewtradingview-alerttradingview-strategy

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Sourcesourceclosesrc
Lengthint14lenRSI
Length   Aint20len_a
Bint50len_b
Cint200len_c
Length   Fastint12fast_ma
Slowint26slow_ma
Signalint9signal_length
Take Profit (%)float1.5longProfitPerc
Stop Loss (%)float2.0longLossPerc
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Acrypto - Weighted Strategy

by AlbertoCuadra
318 stars

This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · Custom licence GitHub repository of Acrypto - Weighted Strategy

This strategy combines Arnaud Legoux Moving Average percentage price change calculations with an adaptive Gaussian Moving Average to generate trend-following signals. Long and short entries are triggered when the ALMA change calculation crosses above or below

Strategy v5 Moving averagesOscillators & momentum
Updated 6 weeks ago · None stated GitHub repository of ESM2024 - ALMA Smoothed Gaussian Moving Average
218 stars

This strategy generates trading signals based on a selectable momentum engine, supporting MACD, RSI, Stochastic, or Rate of Change. Entries trigger on signal crosses, zero-line crosses, or threshold crosses, with an optional moving average trend filter. Risk m

Strategy v6 Oscillators & momentumTrend
Updated 3 months ago · None stated GitHub repository of Momentum Strategy Template

255 EMA Strategy

by hasnocool
106 stars

255 EMA Strategy combines an exponential moving average with Average True Range bands and standard MACD crossovers to generate entry signals. Drawn directly on the price chart, it plots the central 255 EMA along with upper and lower volatility envelopes. Trade

Strategy v4 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 255 EMA Strategy

SMA RSI Strategy

by PythonForForex
64 stars

This strategy evaluates simple moving averages and the Relative Strength Index to generate trading signals. It calculates a 10-period SMA, a 30-period SMA, and a 14-period RSI. Long positions are entered when the fast SMA crosses above the slow SMA while RSI i

Strategy v5 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of SMA RSI Strategy

Momentum Rider DAILY FINAL

by greenpeas007
58 stars

This strategy combines exponential moving averages (EMA 9, 21, 50), RSI, MACD, and Supertrend indicators to enter long positions. It triggers trades using six dynamic setups based on momentum breakouts, EMA crossovers, and pullbacks. Position sizing is compute

Strategy v6 TrendOscillators & momentum Repaints
Updated 4 months ago · Custom licence GitHub repository of Momentum Rider DAILY FINAL

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers