Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

CM_SlingShotSystem+_CassicEMA+Willams21EMA13 htc1977 edition

A Pine Script v5 strategy built on EMA (close, 62), Highest (21) and Lowest (21). It has 6 order rules and no entry of its own. Exits use a stop loss. Each trade is one contract and pays no commission. 17 settings; defaults include CM SLING SHOT ema Slow input 62, CM SLING SHOT ema Fast input 38 and Willams candles back length 21.

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 CM_SlingShotSystem+_CassicEMA+Willams21EMA13 htc1977 edition repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did CM_SlingShotSystem+_CassicEMA+Willams21EMA13 htc1977 edition do on BTCUSDT 1D with default settings?
Not measured
It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its entry conditions never all held on this data. It closed no trades on the other markets either. A backtest, not investment advice.
What alerts does CM_SlingShotSystem+_CassicEMA+Willams21EMA13 htc1977 edition have?
2
long_signal; short_signal.
Does CM_SlingShotSystem+_CassicEMA+Willams21EMA13 htc1977 edition run in Pine Script v6?
No
The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L52:C17: cannot use 'float' as a condition — Pine Script v6 does not cast 'int' or 'float' to 'bool' implicitly. Wrap it in bool(). The v6 version is shown for reference and is not offered as a download.
Does CM_SlingShotSystem+_CassicEMA+Willams21EMA13 htc1977 edition use a stop loss?
Yes
strategy.exit sets a stop on line 117, 123.

BTCUSDT · 1D · default settings

  • Slow MA
  • Fast MA
  • Conservative Buy Entry Triangle
  • Conservative Short Entry Triangle
  • Up Entry Arrow
  • Down Entry Arrow
  • EMA
  • Smoothing Line
  • 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 (17)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOct$500$1,013Equity from $500
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. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.
Net profit
0.00%
$0.00
Buy and hold
+102.5%
same period
Closed trades
0
0 won · 0 lost
Profitable
0.0%
of closed trades
Profit factor
—
gross profit ÷ gross loss
Max drawdown
0.00%
$0.00

One run with the author's default settings, $500 starting capital, commission as the script sets it. 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

    1 setting does nothing

    “Only Choose 1 - Either Conservative Entry Arrows or 'B'-'S' Letters” is declared but never read.

  • Check

    No commission

    The backtest assumes free trading. Results on any real exchange will be lower.

  • Note

    4 settings have no label

    In the settings dialog CM_SLING_SHOT_emaSlow_input (line 19), CM_SLING_SHOT_emaFast_input (line 20), Willams_candles_back_length (line 58), switcher_EMA (line 72) show 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
Show Aggressive Entry?, Or Use as Alert To Potential Conservative Entry?trueboolbarcolor
Show Conservative Entry?trueboolbarcolor
Show Trend Arrows at Top and Bottom of Screen?trueboolConservative Buy Entry Triangle Conservative Short Entry Triangle
Only Choose 1 - Either Conservative Entry Arrows or 'B'-'S' Lettersfalseboolunused
Show Conservative Entry Arrows?trueboolUp Entry Arrow Down Entry Arrow
Show 'B'-'S' Letters?falseboolBuy Entry Short Entry
CM SLING SHOT ema Slow input (no label in the script)62int · min 2emaSlow
CM SLING SHOT ema Fast input (no label in the script)38int · min 1emaFast
Willams candles back length (no label in the script)21int · min 1upper lower
Length13int · min 1emaout
Switcher EMA (no label in the script)trueboolline 93
Length200int · min 1out2
Sourceclosesourceout2
Offset0int · min -500 · max 500EMA Smoothing Line
custom stop0.01float · min 0.001cust_stop_long cust_stop_short
Smoothing
MethodSMAstring · options ["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"]smoothingLine2
Length5int · min 1 · max 100smoothingLine2

What it calculates

  • EMAclose, CM SLING SHOT ema Slow input (62)emaSlow · line 21
  • EMAclose, CM SLING SHOT ema Fast input (38)emaFast · line 22
  • HighestWillams candles back length (21)upper · line 59
  • LowestWillams candles back length (21)lower · line 60
  • EMAwillyout, Length (13)emaout · line 66
  • EMASource (close), Length (200)out2 · line 76

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 dataCM_SLING_SHOT_emaSlow_inputCM SLING SHOT ema Slow …setting · 62CM_SLING_SHOT_emaFast_inputCM SLING SHOT ema Fast …setting · 38Willams_candles_back_lengthWillams candles back le…setting · 21Willams_lenLengthsetting · 13EMA_classic_lenLengthsetting · 200smoothingLength2Lengthsetting · 5typeMA2Methodsetting · SMAcustom_stop_percentcustom stopsetting · 0.01lowlowprice datahighhighprice dataemaSlowEMA→ emaSlowemaFastEMA→ emaFastupperHighest→ upperlowerLowest→ loweremaoutEMA→ emaoutout2EMA→ out2entryUpTrend, entryDnTrendentryUpTrend · entryDnT…2 valuescodiffcodiffvaluecodiff2codiff2valuewillyoutwillyoutvaluesrcsrcvaluecurrent_pricecurrent_pricevaluesmoothingLine2smoothingLine2valuecust_stop_long, cust_stop_shortcust_stop_long · cust_s…2 valuesupTrend, downTrendupTrend · downTrend2 conditionscolColourcolorder:long_entryorder long_entrystrategy.orderexit:long_entryexit long_entrystrategy.exitorder:short_entryorder short_entrystrategy.orderexit:short_entryexit short_entrystrategy.exitclose:long_entryClose long_entrystrategy.closeclose:short_entryClose short_entrystrategy.closeplot:41Slow MAplotplot:42Fast MAplotfill:43Fillfillbarcolor:45barcolorbarcolorbarcolor:46barcolorbarcolorplotshape:48Conservative Buy Entry …plotshapeplotshape:49Conservative Short Entr…plotshapeplotarrow:51Up Entry Arrowplotarrowplotarrow:52Down Entry Arrowplotarrowplotchar:53Buy Entryplotcharplotchar:54Short Entryplotcharplot:77EMAplotplot:89Smoothing Lineplotalert:115alertalertalert:121alertalertplot:134plotplot

Order rules

OrderFires whenBy defaultLine
order long_entry longemaFast > emaSlow and ta.crossunder(low, emaFast) and low[1] > emaFast and long_EMA_classic == trueOn114
Exit long_entry stopemaFast > emaSlow and ta.crossunder(low, emaFast) and low[1] > emaFast and long_EMA_classic == trueOn117
order short_entry shortemaFast < emaSlow and ta.crossover(high, emaFast) and high[1] < emaFast and short_EMA_classic == trueOn120
Exit short_entry stopemaFast < emaSlow and ta.crossover(high, emaFast) and high[1] < emaFast and short_EMA_classic == trueOn123
Close long_entrycalc == 1 and (emaFast < emaSlow or (emaout > -20 and willyout > -20) or close < cust_stop_long)On128
Close short_entrycalc == -1 and (emaFast > emaSlow or (emaout < -80 and willyout < -80) or close > cust_stop_short)On132

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

Alerts

AlertCallMessageLine
(no title)alertlong_signal115
(no title)alertshort_signal121

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 1D0.0%+102.5%00%—0.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h0.0%+5.5%00%—0.0%8 May 2026 – 21 Oct 2026
ETHUSDT 1D0.0%+9.8%00%—0.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h0.0%+8.4%00%—0.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D0.0%+16.7%00%—0.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h0.0%+21.5%00%—0.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D0.0%+148.3%00%—0.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h0.0%+17.1%00%—0.0%8 May 2026 – 21 Oct 2026

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

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
CM_SlingShotSystem+_CassicEMA+Willams21EMA13 htc1977 edition this page—v5 strategy0.0%00.0%
CC Trend strategy 2- Downtrend Short by CheatCode1ema highest lowestv5 strategyNo trades on this market
TrianglePoint strategy by mohaneehighest lowest emav4 strategy+45.4%11101.9%
Lagged Donchian Channel + EMA by Mysteriownema highest lowestv4 strategy−12.3%412.3%
Backtest Custom HiLo Strategy by luyikaibrema highest lowestv4 strategyNo trades on this market
EMA Mean Reversion Strategy by jordanfrayema highest lowestv5 strategy+4.7%2308.9%

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.

  • 7 settings use the untyped input() (line 11, 12, 13, 14, 15, 16, 74). 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

Not verified

Neither version placed a trade on any of the 8 markets, so there was nothing to compare.

  • Line 11: input() → input.bool()
  • Line 12: input() → input.bool()
  • Line 13: input() → input.bool()
  • Line 14: input() → input.bool()
  • Line 15: input() → input.bool()
  • Line 16: input() → input.bool()
  • Line 74: input() → input.source()
⋯// this indicator based on EMA, so there are some reasons to use much bigger/lower EMA classic(see below)-sae = input(true, title="Show Aggressive Entry?, Or Use as Alert To Potential Conservative Entry?")+sae = input.bool(true, title="Show Aggressive Entry?, Or Use as Alert To Potential Conservative Entry?")-sce = input(true, title="Show Conservative Entry?")+sce = input.bool(true, title="Show Conservative Entry?")-st = input(true, title="Show Trend Arrows at Top and Bottom of Screen?")+st = input.bool(true, title="Show Trend Arrows at Top and Bottom of Screen?")-def = input(false, title="Only Choose 1 - Either Conservative Entry Arrows or 'B'-'S' Letters")+def = input.bool(false, title="Only Choose 1 - Either Conservative Entry Arrows or 'B'-'S' Letters")-pa = input(true, title="Show Conservative Entry Arrows?")+pa = input.bool(true, title="Show Conservative Entry Arrows?")-sl = input(false, title="Show 'B'-'S' Letters?")+sl = input.bool(false, title="Show 'B'-'S' Letters?")//                                  EMA Definitions⋯EMA_classic_len = input.int(200, minval=1, title="Length")-EMA_OHLC = input(close, title="Source")+EMA_OHLC = input.source(close, title="Source")offset2 = input.int(title="Offset", defval=0, minval=-500, maxval=500)⋯

Does it run in Pine Script v6?

No

The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L52:C17: cannot use 'float' as a condition — Pine Script v6 does not cast 'int' or 'float' to 'bool' implicitly. Wrap it in bool(). The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © svatvlad1993-//@version=5+//@version=6strategy("CM_SlingShotSystem", overlay=true, margin_long = 100, margin_short = 100, initial_capital = 500, currency=currency.USDT, calc_on_every_tick = false)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 42 msWith a workaround 1,000 bars in 84 msNot measured
PineTSNot testedNot testedNot measured

The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.

“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/// © svatvlad1993//@version=5strategy("CM_SlingShotSystem", overlay=true, margin_long = 100, margin_short = 100, initial_capital = 500, currency=currency.USDT, calc_on_every_tick = false)// do not use 'calc_on_every_tick = true', better to use lower timeframe// if You strong need - you can, but the part of code(some variables) should be overwritten//                                  CM_SLING_SHOT_SYSTEM// Has updated for pinescript v5// this is first indicator you provided https://tr.tradingview.com/script/GE7tSQK1-CM-Sling-Shot-System/// this indicator based on EMA, so there are some reasons to use much bigger/lower EMA classic(see below)sae = input(true, title="Show Aggressive Entry?, Or Use as Alert To Potential Conservative Entry?")sce = input(true, title="Show Conservative Entry?")st = input(true, title="Show Trend Arrows at Top and Bottom of Screen?")def = input(false, title="Only Choose 1 - Either Conservative Entry Arrows or 'B'-'S' Letters")pa = input(true, title="Show Conservative Entry Arrows?")sl = input(false, title="Show 'B'-'S' Letters?")//                                  EMA Definitions// This part for input each EMA for CM_SLING_SHOT_SYSTEMCM_SLING_SHOT_emaSlow_input = input.int(62 ,minval = 2)CM_SLING_SHOT_emaFast_input = input.int(38, minval = 1)emaSlow = ta.ema(close, CM_SLING_SHOT_emaSlow_input)emaFast = ta.ema(close, CM_SLING_SHOT_emaFast_input)//Aggressive Entry or Alert To Potential TradepullbackUpT() => emaFast > emaSlow and close < emaFastpullbackDnT() => emaFast < emaSlow and close > emaFast//Conservative Entry Code For Highlight BarsentryUpT() => emaFast > emaSlow and close[1] < emaFast and close > emaFastentryDnT() => emaFast < emaSlow and close[1] > emaFast and close < emaFast//Conservative Entry True/False ConditionentryUpTrend = emaFast > emaSlow and close[1] < emaFast and close > emaFast ? 1 : 0entryDnTrend = emaFast < emaSlow and close[1] > emaFast and close < emaFast ? 1 : 0//Define Up and Down Trend for Trend Arrows at Top and Bottom of ScreenupTrend = emaFast >= emaSlowdownTrend = emaFast < emaSlow//Definition for Conseervative Entry Up and Down PlotArrowscodiff = entryUpTrend == 1 ? entryUpTrend : 0codiff2 = entryDnTrend == 1 ? entryDnTrend : 0//Color definition for Moving Averagescol = emaFast > emaSlow ? color.lime : emaFast < emaSlow ? color.red : color.yellow//Moving Average Plots and Fillp1 = plot(emaSlow, title="Slow MA", style=plot.style_linebr, linewidth=4, color=col)p2 = plot(emaFast, title="Fast MA", style=plot.style_linebr, linewidth=2, color=col)fill(p1, p2, color.new(color.silver, 50))//Aggressive Entry, Conservative Entry Highlight Barsbarcolor(sae and pullbackUpT() ? color.yellow : sae and pullbackDnT() ? color.yellow : na)barcolor(sce and entryUpT() ? color.aqua : sce and entryDnT() ? color.aqua : na)//Trend Triangles at Top and Bottom of Screenplotshape(st and upTrend ? upTrend : na, title="Conservative Buy Entry Triangle",style=shape.triangleup, location=location.bottom, color=color.new(color.lime, transp=0), offset=0)plotshape(st and downTrend ? downTrend : na, title="Conservative Short Entry Triangle",style=shape.triangledown, location=location.top, color=color.new(color.red, transp=0), offset=0)//Plot Arrows OR Letters B and S for Buy Sell Signalsplotarrow(pa and codiff ? codiff : na, title="Up Entry Arrow", colorup=color.new(color.lime, transp=0), maxheight=30, minheight=30)plotarrow(pa and codiff2*-1 ? codiff2*-1 : na, title="Down Entry Arrow", colordown=color.new(color.red, transp=0), maxheight=30, minheight=30)plotchar(sl and codiff ? low - ta.tr : na, title="Buy Entry", offset=0, char='B', location=location.absolute, color=color.new(color.lime, transp=0))plotchar(sl and codiff2 ? high + ta.tr : na, title="Short Entry", offset=0, char='S', location=location.absolute, color=color.new(color.red, transp=0))//                            Willams21EMA13 htc1977 edition// second indicator https://tr.tradingview.com/v/BYEfUEKp///  input number of candles for diapasonWillams_candles_back_length = input.int(21, minval=1)upper = ta.highest(Willams_candles_back_length)lower = ta.lowest(Willams_candles_back_length)// calc willywillyout = 100 * (close - upper) / (upper - lower)src = willyoutWillams_len = input.int(13, minval=1, title="Length")// compute the EMA of willyemaout = ta.ema(willyout, Willams_len)// draw willy and EMAcurrent_price = close//                             EMA classic// You can use this EMA for bult indicator or/and inside strategy buy logic// You can ON/OFF EMA for calculating(but for OFF indicator there is another field in settings)switcher_EMA = input.bool(true)EMA_classic_len = input.int(200, minval=1, title="Length")EMA_OHLC = input(close, title="Source")offset2 = input.int(title="Offset", defval=0, minval=-500, maxval=500)out2 = ta.ema(EMA_OHLC, EMA_classic_len)plot(out2, title="EMA", color=color.blue, offset=offset2)ma(source, length, type) =>    switch type        "SMA" => ta.sma(source, length)        "EMA" => ta.ema(source, length)        "SMMA (RMA)" => ta.rma(source, length)        "WMA" => ta.wma(source, length)        "VWMA" => ta.vwma(source, length)// choose indicator - for You it is EMAtypeMA2 = input.string(title = "Method", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="Smoothing")smoothingLength2 = input.int(title = "Length", defval = 5, minval = 1, maxval = 100, group="Smoothing")smoothingLine2 = ma(out2, smoothingLength2, typeMA2)plot(smoothingLine2, title="Smoothing Line", color=#f37f20, offset=offset2, display=display.none)// logic for strategy_ema_switchervar long_EMA_classic = truevar short_EMA_classic = trueif switcher_EMA == true    if close > out2        long_EMA_classic := true        short_EMA_classic := false    else        long_EMA_classic := false        short_EMA_classic := trueelse    long_EMA_classic := true    short_EMA_classic := true// var for entered order + stop_loss for each sidevar calc = 0var cust_stop_long = 0.0var cust_stop_short = 0.0if strategy.position_size == 0    cust_stop_long := 0.0    cust_stop_short := 0.0custom_stop_percent = input.float(0.01, minval = 0.001, title = 'custom stop') //this is 1%, 55% = 0.55// logict enry orderif calc == 0    if emaFast > emaSlow and ta.crossunder(low, emaFast) and low[1] > emaFast and long_EMA_classic == true        strategy.order('long_entry', strategy.long, 50)        alert('long_signal')        cust_stop_long := close - (close * custom_stop_percent)        strategy.exit('long_entry', stop=cust_stop_long)        calc := 1    if emaFast < emaSlow  and ta.crossover(high, emaFast) and high[1] < emaFast and short_EMA_classic == true        strategy.order('short_entry', strategy.short, 50)        alert('short_signal')        cust_stop_short := close + (close * custom_stop_percent)        strategy.exit('short_entry', stop=cust_stop_short)        calc := -1    // logic for close positionif calc == 1 and (emaFast < emaSlow or (emaout > -20 and willyout > -20) or close < cust_stop_long)    strategy.close('long_entry', immediately = true)    calc := 0    if calc == -1 and (emaFast > emaSlow or (emaout < -80 and willyout < -80) or close > cust_stop_short)    strategy.close('short_entry', immediately = true)    calc := 0plot(strategy.equity)// a piece of advice// here are a lot of ema, probably You have to try some else indicators.// a lot of negative orders were also opened on period of small difference between emaslow and emafast. This could be avoided.// Play with variables, see profit, gave fan!!!// Arivadis