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
- 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.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Crossover Config | 2x4,3x5,4x6 | string | crossoverGroups |
| Source (no label in the script) | high | source | wmaFast wmaSlow |
| Moving Average Type | WMA | string · options ["WMA","SMA","VWMA"] | wmaFast wmaSlow |
| ATR Period | 14 | int | profitPrice lossPrice |
| Profit ATR x | 10 | int | profitPrice |
| Loss ATR x | 5 | int | lossPrice |
What it calculates
- SMA / WMA / VWMAsrc, length
ma · 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.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open Long long | longCondition and profitPrice>0 | On | 42 |
| Close Long | longVotes<crossoverCount and strategy.position_size>0 and (high>profitPrice or low<lossPrice) | On | 44 |
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.
- 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.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | +28.5% | +102.5% | 5 | 40% | 1.39 | 39.4% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | +1.9% | +5.5% | 5 | 20% | 1.10 | 23.4% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | −14.7% | +9.8% | 6 | 33% | 0.90 | 62.2% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | +14.9% | +8.4% | 5 | 20% | 1.62 | 27.9% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | −36.9% | +16.7% | 3 | 33% | 0.64 | 73.9% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +22.7% | +21.5% | 6 | 33% | 1.71 | 22.9% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | +74.6% | +148.3% | 5 | 60% | 1.52 | 52.2% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +41.3% | +17.1% | 3 | 67% | 12.81 | 9.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 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 2 | 0% | −$491.40 |
| Sideways market | 3 | 67% | $777.93 |
| Falling market | 0 | — | $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.
All 5 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 9 Feb 2024 45,288.70 | 3 Mar 2024 61,987.30 | 23 | $365.98 |
| long | 5 Mar 2024 68,245.70 | 6 Jul 2024 56,628.80 | 123 | −$234.78 |
| long | 11 Jul 2024 57,725.80 | 16 Nov 2024 91,032.10 | 128 | $649.11 |
| long | 20 Nov 2024 92,310.80 | 8 Apr 2025 79,163.20 | 139 | −$256.61 |
| long | 12 Apr 2025 83,423.80 | 7 Feb 2026 70,580.30 | 301 | −$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.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| Configurable Multi MA Crossover Voting System this page | — | v5 strategy | +28.5% | 5 | 39.4% |
| DayTradingFutures Cross-Strategy by james4392010 | sma atr wma | v4 strategy | No trades on this market | ||
| VWMA-SMA 3Commas Bot by CrackingCryptocurrency | sma vwma atr | v5 strategy | −1,774,150,000.0% | 157 | 50,545.9% |
| Open Close Cross Strategy plus Explorer by roses27 | sma wma vwma atr | v4 strategy | does not run in Zeal Terminal | ||
| I11L - Better Buy Low Volatility or High Volatility- by I11L | atr sma | v5 strategy | +19.2% | 83 | 37.4% |
| Vortex Cross w-MA Confirmation by DraftVenture | atr sma | v5 strategy | +2.4% | 52 | 4.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.
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
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 29 ms | Yes 1,000 bars in 74 ms | Not measured |
| PineTS | Not tested | Not tested | Not 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