Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Configurable Multi MA Crossover Voting System

A Pine Script v5 strategy built on SMA or WMA or VWMA (src, length) and ATR (14). It has 2 order rules, 1 entry among them, and trades long only with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 100% of equity and pays 0.1% commission. 6 settings; defaults include Crossover Config 2x4,3x5,4x6, Source high and Moving Average Type WMA.

Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.

Does Configurable Multi MA Crossover Voting System repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did Configurable Multi MA Crossover Voting System do on BTCUSDT 1D with default settings?
+28.52%
From 26 Jan 2024 to 21 Oct 2026, over 5 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Configurable Multi MA Crossover Voting System run in Pine Script v6?
No
The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 5 before, 9 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download.
Does Configurable Multi MA Crossover Voting System use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Configurable Multi MA Crossover Voting System run in Zeal Terminal?
Yes
It compiles in 29 ms and runs 1,000 bars in 74 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (6)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$1,582$2,025Equity from $1,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots.
Net profit
+28.52%
$285.25
Buy and hold
+102.5%
same period
Closed trades
5
2 won · 3 lost
Profitable
40.0%
of closed trades
Profit factor
1.39
gross profit ÷ gross loss
Max drawdown
39.38%
−$701.05

One run with the author's default settings, $1,000 starting capital, commission as the script sets it. A long position was still open at the last bar. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.

Review

What a careful reader of this script would point out, found by checking the source and the backtest.

  • Check

    No stop loss

    Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.

  • Check

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    1 setting has no label

    In the settings dialog source (line 6) shows an empty name. The labels on this page come from the variable names.

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Crossover Config2x4,3x5,4x6stringcrossoverGroups
Source (no label in the script)highsourcewmaFast wmaSlow
Moving Average TypeWMAstring · options ["WMA","SMA","VWMA"]wmaFast wmaSlow
ATR Period14intprofitPrice lossPrice
Profit ATR x10intprofitPrice
Loss ATR x5intlossPrice

What it calculates

  • SMA / WMA / VWMAsrc, lengthma · line 12
  • ATRATR Period (14)profitPrice · line 34
  • ATRATR Period (14)lossPrice · line 35

Signal flow

How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.

closecloseprice datahigh · low · closehigh · low · closeprice dataprofitAtrProfit ATR xsetting · 10atrPeriodATR Periodsetting · 14lossAtrLoss ATR xsetting · 5crossoverConfigCrossover Configsetting · 2x4,3x5,4x6highhighprice datamaTypeMoving Average Typesetting · WMAlowlowprice datamaSMA / WMA / VWMA→ maprofitPriceATR→ profitPricelossPriceATR→ lossPricecrossoverGroupscrossoverGroupsvaluecrossoverCount, crossovercrossoverCount · crosso…2 valuescrossovers, positionscrossovers · positions2 valueslongVoteslongVotesvaluecrossoverBoundariescrossoverBoundariesvaluefastLength, slowLengthfastLength · slowLength2 valueswmaFastwmaFastvaluewmaSlowwmaSlowvaluelongConditionlongConditionconditionentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closeplot:39plotplotplot:40plotplot

Order rules

OrderFires whenBy defaultLine
Open Long longlongCondition and profitPrice>0On42
Close LonglongVotes<crossoverCount and strategy.position_size>0 and (high>profitPrice or low<lossPrice)On44

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Does it repaint?

No

No repainting patterns in the source.

Not measuredNo trades to compareThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, but neither the live nor the historical run produced any trades in them, so the replay says nothing either way.
  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
  • ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Other markets

The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.

MarketNetBuy and holdTradesWonProfit factorMax drawdownPeriod
BTCUSDT 1D+28.5%+102.5%540%1.3939.4%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+1.9%+5.5%520%1.1023.4%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−14.7%+9.8%633%0.9062.2%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+14.9%+8.4%520%1.6227.9%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−36.9%+16.7%333%0.6473.9%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+22.7%+21.5%633%1.7122.9%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+74.6%+148.3%560%1.5252.2%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+41.3%+17.1%367%12.819.0%8 May 2026 – 21 Oct 2026

Backtests are simulations on historical data and are not investment advice.

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market20%−$491.40
Sideways market367%$777.93
Falling market0—$0.00

Rising and falling mean the market moved more than 15% over the 90 bars before entry.

How bad could the drawdown be?

40.2%

The 95th percentile of the worst drawdown when the same 5 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 17.2% to 40.2%; the tick is what actually happened, 27.7%. Order luck alone moves it this much.

0%46%
All 5 trades
SideEntryExitBarsP&L
long9 Feb 2024 45,288.703 Mar 2024 61,987.3023$365.98
long5 Mar 2024 68,245.706 Jul 2024 56,628.80123−$234.78
long11 Jul 2024 57,725.8016 Nov 2024 91,032.10128$649.11
long20 Nov 2024 92,310.808 Apr 2025 79,163.20139−$256.61
long12 Apr 2025 83,423.807 Feb 2026 70,580.30301−$237.16

Similar scripts

Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.

ScriptSharesTypeNetTradesMax drawdown
Configurable Multi MA Crossover Voting System this page—v5 strategy+28.5%539.4%
DayTradingFutures Cross-Strategy by james4392010sma atr wmav4 strategyNo trades on this market
VWMA-SMA 3Commas Bot by CrackingCryptocurrencysma vwma atrv5 strategy−1,774,150,000.0%15750,545.9%
Open Close Cross Strategy plus Explorer by roses27sma wma vwma atrv4 strategydoes not run in Zeal Terminal
I11L - Better Buy Low Volatility or High Volatility- by I11Latr smav5 strategy+19.2%8337.4%
Vortex Cross w-MA Confirmation by DraftVentureatr smav5 strategy+2.4%524.7%

Upgrade and export

Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.

  • 3 settings use the untyped input() (line 8, 9, 10). It still compiles in v6; input.int, input.float or input.source state the type.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

VerifiedDownload the v5 script

Same 5 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 8: input() → input.int()
  • Line 9: input() → input.int()
  • Line 10: input() → input.int()
⋯maType= input.string("WMA", title="Moving Average Type", options=["WMA","SMA","VWMA"])-atrPeriod= input(14, title="ATR Period")+atrPeriod= input.int(14, title="ATR Period")-profitAtr = input(10, title="Profit ATR x")+profitAtr = input.int(10, title="Profit ATR x")-lossAtr = input(5, title="Loss ATR x")+lossAtr = input.int(5, title="Loss ATR x")ma(src,length,type) => ⋯

Does it run in Pine Script v6?

No

The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 5 before, 9 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © levieux-//@version=5+//@version=6strategy(title='Configurable Multi MA Crossover Voting System', shorttitle='Configurable Multi MA Crossover Voting System', initial_capital=1000, overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 29 msYes 1,000 bars in 74 msNot measured
PineTSNot testedNot testedNot measured

“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report.

Source

Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © levieux//@version=5strategy(title='Configurable Multi MA Crossover Voting System', shorttitle='Configurable Multi MA Crossover Voting System', initial_capital=1000, overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1)crossoverConfig= input.string(defval="2x4,3x5,4x6", title="Crossover Config")source= input.source(high)maType= input.string("WMA", title="Moving Average Type", options=["WMA","SMA","VWMA"])atrPeriod= input(14, title="ATR Period")profitAtr = input(10, title="Profit ATR x")lossAtr = input(5, title="Loss ATR x")ma(src,length,type) =>     float ma = switch type        "SMA" => ta.sma(src, length)        "WMA" => ta.wma(src, length)        "VWMA" => ta.vwma(src, length)crossoverGroups= str.split(crossoverConfig, ",")crossoverCount= array.size(crossoverGroups)crossovers= array.new_string(crossoverCount)positions= array.new_int(crossoverCount, 0)longVotes= 0for i= 0 to crossoverCount-1    crossover= str.tostring(array.get(crossoverGroups, i))    crossoverBoundaries= str.split(crossover, "x")    int fastLength= math.round(str.tonumber(array.get(crossoverBoundaries, 0)))    int slowLength= math.round(str.tonumber(array.get(crossoverBoundaries, 1)))    wmaFast= ma(source,fastLength,maType)    wmaSlow= ma(source,slowLength,maType)    if wmaFast>wmaSlow        longVotes:= longVotes + 1        array.set(positions, i, 1)longCondition= longVotes==crossoverCount and strategy.position_size==0//profitTicks = profitAtr*ta.atr(atrPeriod)/syminfo.mintick//lossTicks = lossAtr*ta.atr(atrPeriod)/syminfo.mintickprofitPrice= close+profitAtr*ta.atr(atrPeriod)lossPrice= close-lossAtr*ta.atr(atrPeriod)if strategy.position_size>0    profitPrice:= profitPrice[1]    lossPrice:= lossPrice[1]plot(profitPrice, color=color.green)plot(lossPrice, color=color.red)if longCondition and profitPrice>0    strategy.entry("Long", strategy.long)if longVotes<crossoverCount and strategy.position_size>0 and (high>profitPrice or low<lossPrice)    strategy.close("Long")    longVotes:= 0