Strategy · Pine Script v5 · On the chart

NakInvest Cross EMA

by feliperazeek

This strategy trades three-candle reversal patterns, called 123, PFR and engulfing, together with a 9, 40 and 80 EMA trend stack.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code917
Settings37inputs
LicenceNone stated
Last update1 year ago11 Oct 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  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

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Entries can occur when price crosses the fast EMA without crossing the slower ones, or when it crosses all of them. Optional volume, stochastic and MACD filters are available, and candle size limits are adjustable. Stops can sit below the candle body or wick or at a percentage, and targets use a risk-reward ratio or percentage. Sizing is percent of equity.

Details

Published by

feliperazeek on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Candlestick patterns, Moving averages, Trend

Markets

Crypto

Timeframes

M15-H1

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.

Settings

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

SettingTypeDefaultVariable
Show PFR DebugboolfalseshowPFRDebug
Show 123 Debugboolfalseshow123Debug
Show Engulfing DebugboolfalseshowEngulfingDebug
Use EMA Cross RulesbooltrueuseEmaCrossRules
Enable Bear Cross (all emas)booltrueenableAllEmaCross
Min Candle 1 Size (absolute units)float0.1minCandle1Size
Min Candle 2 Body Size as % of Candle 1float0.1minCandle2Pct
Max Candle 2 Body Size as % of Candle 1float0.5maxCandle2Pct
Min Candle 3 Body Size as % of Candle 1float0.6minCandle3Pct
Max Candle 3 Body Size as % of Candle 1float1.5maxCandle3Pct
Enable Long PositionsbooltrueenableLong
Enable Short PositionsbooltrueenableShort
Show all 37 settings
SettingTypeDefaultVariable
Use Trend FilterbooltrueuseTrendFilter
Use Volume FilterboolfalseuseVolumeFilter
Minimum Volume Multiplierfloat1.5minVolume
Use Stochastic FilterboolfalseuseStochFilter
Stochastic Lengthint21stochLength
Stoch Overboughtfloat50stochOverbought
Stoch Oversoldfloat50stochOversold
Take Profit TypestringRR-BasedtpType
Take Profit Ratio (vs SL)float1.0profitTargetRR
Take Profit % From Entryfloat1.0tpPercent
Stop Loss TypestringBelow Candle WickslType
Stop Loss %float1.0slPercent
Number of Candles for Lowest Lowint10slCandlesLookback
Price Comparison Buffer (%)float0.001priceBufferPct
Enable 123 Patternbooltrueenable123
Enable PFR PatternbooltrueenablePFR
Enable Engulfing PatternbooltrueenableEngulfing
Use MACD ConfirmationboolfalseuseMacdConfirmation
MACD Fast Lengthint12macdFastLength
MACD Slow Lengthint26macdSlowLength
MACD Signal Lengthint9macdSignalLength
MA TypestringEMAmaType
Fast MA Lengthint9fastLength
Medium MA Lengthint40mediumLength
Slow MA Lengthint80slowLength
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

Pin Bar Magic v1

by Alorse
330 stars

This strategy trades price action pin bar patterns aligned with moving average trend alignment on the main price chart. It defines uptrends or downtrends using a fan arrangement of three moving averages (6 EMA, 18 EMA, and 50 SMA). Entry conditions require a b

Strategy v4 Candlestick patternsTrend
Updated 2 months ago · None stated GitHub repository of Pin Bar Magic v1
257 stars

This overlay strategy marks short-term turning points on the price chart and enters SPY option-style trades from them. It plots simple moving averages of highs and lows, draws up and down reversal arrows, and colors bars when a short-term extreme coincides wit

Strategy v5 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of SPY Options Trading - Alert

This strategy calculates and plots smoothed Heikin-Ashi candles directly onto the main price chart using exponential moving averages of open, high, low, and close prices. It enters a long position after three consecutive bullish smoothed candles with sequentia

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Abdoli's Heikin Ashi Smoothed Buy & Sell Strategy Rev.4

DI Engulfing A002

by ruckard
13 stars

This strategy executes trades based on candlestick engulfing patterns aligned with a 200-period exponential moving average trend filter. It enters long positions when a bullish engulfing candle follows three consecutive bearish candles while price trades above

Strategy v5 Candlestick patternsTrend
Updated 1 year ago · None stated GitHub repository of DI Engulfing A002
7 stars

This strategy combines Ichimoku Kinko Hyo components, a Stochastic oscillator, and specific candlestick patterns to generate trade signals. It identifies Kumo twists and range breakouts while evaluating candle body shapes using Fibonacci threshold filters. Tra

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · MIT GitHub repository of Soulevement / Ressaut Strategy

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