Strategy · Pine Script v6 · On the chart

Saham: Papan Gerak Strategy By. Akhmfz

by akhmfz

This strategy calculates multiple technical indicators including EMAs, SuperTrend, ADX, RSI, MACD, Stochastic, and volume MA to generate entry signals for Indonesian stocks.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code160
Settings18inputs
LicenceMIT
Last update3 months ago8 Jul 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

160 lines of Pine Script v6 from src/strategies/PapanGerakStrategy.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

PapanGerakStrategy.pine
// @version=6
// Papan Gerak Strategy — Companion backtest script
// Author : Muhammad Akhmal (AKHMFZ)
// License: MIT
// ==========================================================
// Script terpisah dari indicator() — menggunakan strategy()
// untuk backtest di Strategy Tester bawaan TV.
//
// ⚠️  DISCLAIMER: Strategy ini adalah APPROKSIMASI dari scoring
// engine indikator Papan Gerak sebenarnya (03-scoring.pine).
// Perbedaan utama:
//   - Strategy hanya pakai 3 dimensi (Tren/Momentum/Volume),
//     sementara indikator asli pakai 4 (Tren/Momentum/Volatilitas/Volume)
//   - Strategy TIDAK menerapkan minSignalBars / signalFilterMode
//   - Bobot strategy terfiksasi (3:3:2); indikator asli bisa diatur user
//   - Tidak ada MTF filter / Smart Money di strategy
// Jangan jadikan win rate / return / profit factor di strategy tester
// sebagai representasi presisi sinyal entry indikator Papan Gerak.
// ==========================================================

strategy(
    "Saham: Papan Gerak Strategy By. Akhmfz",
    shorttitle = "PG Strategy",
    overlay = true,
    initial_capital = 100000000,
    default_qty_type = strategy.percent_of_equity,
    default_qty_value = 100,
    commission_type = strategy.commission.percent,
    commission_value = 0.15,
    slippage = 5
)

// ==========================================================
// 1. INPUTS (all with display.data_window)
// ==========================================================
emaFastPeriod = input.int(20, "EMA Fast", group = "Trend", display = display.data_window)
emaMidPeriod = input.int(50, "EMA Mid", group = "Trend", display = display.data_window)
emaSlowPeriod = input.int(200, "EMA Slow", group = "Trend", display = display.data_window)
superTrendFactor = input.float(3.0, "SuperTrend Factor", step = 0.1, group = "Trend", display = display.data_window)
superTrendPeriod = input.int(10, "SuperTrend ATR", group = "Trend", display = display.data_window)
adxLength = input.int(14, "ADX Length", group = "Trend", display = display.data_window)
adxThreshold = input.int(25, "ADX Threshold", group = "Trend", display = display.data_window)

atrLength = input.int(14, "ATR Length", group = "Momentum", display = display.data_window)
rsiLength = input.int(14, "RSI Length", group = "Momentum", display = display.data_window)
macdFast = input.int(12, "MACD Fast", group = "Momentum", display = display.data_window)
macdSlow = input.int(26, "MACD Slow", group = "Momentum", display = display.data_window)
macdSignal = input.int(9, "MACD Signal", group = "Momentum", display = display.data_window)
stochK = input.int(14, "Stochastic K", group = "Momentum", display = display.data_window)
stochD = input.int(3, "Stochastic D", group = "Momentum", display = display.data_window)
volMaLength = input.int(20, "Volume MA Length", group = "Volume", display = display.data_window)

slAtrMult = input.float(1.5, "SL ATR Multiplier", step = 0.1, group = "Risk", display = display.data_window)
targetRmult = input.float(2.0, "Target R-Multiple", step = 0.5, group = "Risk", display = display.data_window)

entryTriggerMode = input.string("Composite Score", "Entry Trigger",
 options = ["Composite Score", "Pullback", "Breakout"], group = "Entry", display = display.data_window)

// ==========================================================
// 2. TECHNICAL INDICATORS
// ==========================================================
emaFast = ta.ema(close, emaFastPeriod)
emaMid = ta.ema(close, emaMidPeriod)
emaSlow = ta.ema(close, emaSlowPeriod)
[superTrend, superTrendDir] = ta.supertrend(superTrendFactor, superTrendPeriod)
[adxUp, adxDn, adxValue] = ta.dmi(adxLength, adxLength)
adxStrong = adxValue >= adxThreshold

rsiValue = ta.rsi(close, rsiLength)
[macdLine, macdSignalLine, macdHist] = ta.macd(close, macdFast, macdSlow, macdSignal)
stochKVal = ta.stoch(close, high, low, stochK)
stochDVal = ta.sma(stochKVal, stochD)

atrValue = ta.atr(atrLength)

// ==========================================================
// 3. SIMPLIFIED SCORING
// ==========================================================
f_scoreHigher(val, min, max) =>
    na(val) ? na : math.max(0, math.min(100, (val - min) / (max - min) * 100))

emaPos = close > emaFast ? (close > emaMid ? (close > emaSlow ? 100 : 66) : 33) : 0
stScore = superTrendDir == 1 ? 100 : 0
adxScore = adxStrong ? (adxUp > adxDn ? 80 : 20) : 50
trendScore = (emaPos * 3 + stScore * 2 + adxScore * 2) / 7

rsiScore = f_scoreHigher(rsiValue, 30, 70)
macdBull = macdLine > macdSignalLine
macdScore = macdBull ? (macdHist > macdHist[1] ? 80 : 60) : (macdHist > macdHist[1] ? 40 : 20)
stochScore = f_scoreHigher(stochKVal, 20, 80)
momentumScore = (rsiScore * 3 + macdScore * 3 + stochScore * 2) / 8

volMA = ta.sma(volume, volMaLength)
volRatio = volMA > 0 ? volume / volMA : 0
volScore = f_scoreHigher(volRatio, 0.2, 3.0)

overallScore = (trendScore * 3 + momentumScore * 3 + volScore * 2) / 8

// ==========================================================
// 4. ENTRY TRIGGERS
// ==========================================================
currentZone = na(overallScore) ? -1 : (overallScore >= 70 ? 2 : overallScore >= 40 ? 1 : 0)
var int prevZone = -1
zoneChanged = prevZone >= 0 and currentZone >= 0 and currentZone != prevZone
if zoneChanged
    prevZone := currentZone

nearEma = not na(emaFast) and not na(atrValue) and math.abs(close - emaFast) <= atrValue * 1.5
rsiRecover = not na(rsiValue) and rsiValue <= 50 and ta.rising(rsiValue, 1)

recentHigh = ta.highest(high, 20)
recentLow = ta.lowest(low, 20)

csTrigger = zoneChanged
pbTrigger = not na(trendScore) and trendScore >= 65 and nearEma and rsiRecover
boTrigger = not na(volScore) and volScore >= 60 and (close >= recentHigh or close <= recentLow)

entryTriggered = entryTriggerMode == "Composite Score" ? csTrigger
 : entryTriggerMode == "Pullback" ? pbTrigger : boTrigger

signalDir = entryTriggerMode == "Composite Score"
 ? (currentZone > prevZone ? 1 : -1)
 : entryTriggerMode == "Pullback" ? 1
 : (close >= recentHigh ? 1 : -1)

// ==========================================================
// 5. EXECUTION
// ==========================================================
if entryTriggered and strategy.position_size == 0
    riskAmt = atrValue * slAtrMult
    slPrice = close - riskAmt * signalDir
    tgtPrice = close + riskAmt * targetRmult * signalDir
    strategy.entry("PG", signalDir > 0 ? strategy.long : strategy.short)
    strategy.exit("PG-X", "PG", stop = slPrice, limit = tgtPrice)

// ==========================================================
// 6. DISPLAY
// ==========================================================
if barstate.islast
    tbl = table.new(position.top_right, 2, 5, border_width = 1,
     bgcolor = color.rgb(13, 22, 30, 90))
    table.cell(tbl, 0, 0, "PG STRATEGY", text_size = size.small,
     text_color = color.rgb(38, 166, 154), bgcolor = color.rgb(0, 0, 0, 85))
    info1 = "Mode: " + entryTriggerMode + " | Trades: " + str.tostring(strategy.closedtrades)
    table.cell(tbl, 0, 1, info1, text_size = size.small, text_color = color.white)
    winRate = strategy.closedtrades > 0
     ? str.tostring(math.round(strategy.wintrades / strategy.closedtrades * 100)) + "%"
     : "—"
    table.cell(tbl, 0, 2, "Win Rate: " + winRate, text_size = size.small, text_color = color.white)
    pf = strategy.closedtrades > 0
     ? str.tostring(math.round(strategy.profitfactor * 10) / 10) : "—"
    table.cell(tbl, 0, 3, "Profit Factor: " + pf, text_size = size.small, text_color = color.white)
    netPct = strategy.netprofit / strategy.initial_capital * 100
    netStr = str.tostring(math.round(netPct * 10) / 10) + "%"
    table.cell(tbl, 0, 4, "Return: " + netStr, text_size = size.small,
     text_color = netPct >= 0 ? color.rgb(38, 166, 154) : color.rgb(239, 83, 80))

plot(overallScore, "Score", color.rgb(38, 166, 154, 80), 2)
hline(70, "OB", color.rgb(239, 83, 80, 50), hline.style_dashed)
hline(40, "OS", color.rgb(38, 166, 154, 50), hline.style_dashed)

Overview

Saham: Papan Gerak Strategy By. Akhmfz supports three entry trigger modes: Composite Score, Pullback, and Breakout, with fixed weights across trend, momentum, and volume dimensions. Risk is managed using ATR-based stop loss and risk multiples for targets. It draws signals and indicators directly on the price chart as an overlay. The main input settings adjust periods and thresholds for each indicator group. Position sizing uses 100 percent of equity with commission and slippage applied. It is an approximation of the full Papan Gerak dashboard scoring engine and lacks certain filters found in the indicator version.

Details

Published by

akhmfz on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Trend, Oscillators & momentum, Volume, Support & resistance

Markets

Stocks

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.

Settings

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

SettingTypeDefaultVariable
EMA Fastint20emaFastPeriod
EMA Midint50emaMidPeriod
EMA Slowint200emaSlowPeriod
SuperTrend Factorfloat3.0superTrendFactor
SuperTrend ATRint10superTrendPeriod
ADX Lengthint14adxLength
ADX Thresholdint25adxThreshold
ATR Lengthint14atrLength
RSI Lengthint14rsiLength
MACD Fastint12macdFast
MACD Slowint26macdSlow
MACD Signalint9macdSignal
Show all 18 settings
SettingTypeDefaultVariable
Stochastic Kint14stochK
Stochastic Dint3stochD
Volume MA Lengthint20volMaLength
SL ATR Multiplierfloat1.5slAtrMult
Target R-Multiplefloat2.0targetRmult
Entry TriggerstringComposite ScoreentryTriggerMode
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

This strategy overlays the price chart and looks for VWAP pullbacks. It goes long when a short SMA crosses above VWAP after RSI has been oversold within ten bars, and short on the opposite cross after RSI has been overbought. Optional Minervini-style moving-av

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced VWAP-Momentum Pullback Trend Qualifier

This strategy trades 1-minute futures contracts on Binance. It plots pivot high and low resistance and support levels on the price chart, along with an EMA and a custom Cto indicator. Long and short entries trigger on EMA and Cto crossovers combined with price

Strategy v5 TrendMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of Binancash Futures Strategy 1M Candles
12 stars

This strategy plots on the price chart and looks for three-candle fair value gaps and inverse gaps on Bitcoin. It enters long when a wide enough bullish gap appears in an uptrend with RSI above 30 and volume above its average, and short on the opposite bearish

Strategy v6 SMC / ICT / price actionTrend Repaints
Updated 4 months ago · None stated GitHub repository of BTC 4h FVG/iFVG Strategy

This strategy identifies reversal opportunities based on liquidity sweeps and multi-gate confluence scoring. It evaluates setups using mandatory conditions such as swing sweeps, body and ATR filters, and dual EMA higher-timeframe trend alignment, alongside opt

Strategy v6 SMC / ICT / price actionTrend
Updated yesterday · MIT GitHub repository of Reversal Engine Score [WavesUnchained] Strategy

Combined Strategy

by Dropio12
7 stars

This strategy plots buy and sell markers on the price chart by combining a fast and slow ALMA crossover with a simple close-to-close momentum check. A long marker appears when the fast ALMA crosses above the slow ALMA and momentum is positive. A short marker a

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Combined Strategy
7 stars

This strategy plots dynamic pivot-based support and resistance trendlines on the price chart and trades breakouts beyond those lines. By default it allows longs only when EMA 50 is above EMA 200 and an RSI-SMA momentum filter is met, with an ATR entry buffer.

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Easy Trendline - XAUUSD 30m

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