Zeal Terminal Open Zeal Terminal

Pine Script v5 · Strategy

Scalping Support Resistance Strategy

A Pine Script v5 strategy built on Lowest (hlc3, 10). It has 6 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a stop loss and a profit target. Each trade is one contract and pays no commission. 8 settings; defaults include Symbol BTC, Balance 20 and Take Percent 1.

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 Scalping Support Resistance Strategy repaint?
Yes
At least one pattern in the source can repaint: intrabar recalculation.
Does Scalping Support Resistance Strategy run in Pine Script v6?
Not tested
The v5 script does not run in Zeal Terminal's engine (Pine Script v5 Error at @L18:C0: no source was supplied for the library 'HPotter/RouterOrdersIron/1'. Libraries cannot be fetched from TradingView; supply the source in the 'libraries' option. No libraries were supplied.), so this step could not be checked. The v6 version is shown for reference and is not offered as a download.
Does Scalping Support Resistance Strategy use a stop loss?
Yes
strategy.exit sets a stop on line 8, 15.
Does Scalping Support Resistance Strategy run in Zeal Terminal?
No
Not yet: it imports the library HPotter/RouterOrdersIron/1, whose source is not available here, so it does not run here
Does not run in Zeal Terminal yetIt imports the library HPotter/RouterOrdersIron/1, whose source is not available here, so it does not run here. The settings, logic and review below are read from the source, which does not need a run.

Review

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

  • Check

    No commission

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

  • Note

    8 settings have no label

    In the settings dialog symbol (line 19), ID (line 20), balance (line 21), TakePercent (line 22), StopPercent (line 23), LookBack (line 24), PointBack (line 25), ShowBackTest (line 26) 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
Symbol (no label in the script)BTCstringmsg line 43 line 45
ID (no label in the script)stringmsg line 43 line 45
Balance (no label in the script)20float · min 12msg line 43 line 45
Take Percent (no label in the script)1float · min 0.00001Take
Stop Percent (no label in the script)1float · min 0.00001Stop
Look Back (no label in the script)10intLLS lineLevel
Point Back (no label in the script)5intLevel
Show Back Test (no label in the script)falseboolWork

What it calculates

  • Lowesthlc3, Look Back (10)LLS · line 33

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.

hlc3hlc3price dataLookBackLook Backsetting · 10IDIDsetting · symbolSymbolsetting · BTCbalanceBalancesetting · 20PointBackPoint Backsetting · 5closecloseprice dataTakePercentTake Percentsetting · 1StopPercentStop Percentsetting · 1LLSLowest→ LLSmsgmsgvalueWorkWorkvalueLevelLevelvaluelineLevellineLevelvalueclrclrvalueTakeTakevalueStopStopvalueGreen, Red, BlueColourGreen · Red +1cancel_all:cancel_all strategy.cancel_allentry:LongOpen Longstrategy.entryexit:Exitexit Exitstrategy.exitentry:ShortOpen Shortstrategy.entrybarcolor:46barcolorbarcolor

Order rules

OrderFires whenBy defaultLine
cancel_all every barOn4
Open Long longevery barOn6
Exit Exit stop and limitevery barOn8
cancel_all every barOn11
Open Short shortevery barOn13
Exit Exit stop and limitevery barOn15

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

Does it repaint?

Yes

At least one pattern in the source can repaint; it is marked Check below.

The live replay needs a run, and this script does not run in Zeal Terminal yet; the answer comes from the checks on the source alone.

  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • CheckIntrabar recalculationreads realtime-only state. Live values can differ from history.
  • 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.

Similar scripts

Indicators and strategies built from the same calculations.

ScriptSharesTypeNetTradesMax drawdown
I11L - Reversal Trading Ideas by Larry Connors by I11Llowestv5 strategy+101.7%11958.8%
Exponential Stochastic Strategy by faytterrolowestv5 strategy+64.1%8542.2%
STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAY by FiatDropoutlowestv4 strategy+496.9%997732.3%
Alex Days HiLo Rajib by 14rajiblowestv4 strategyNo trades on this market
Donchian Strat EXMO by pskoroplaslowestv4 strategy+12.1%2268.0%

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.

  • No v6-only features. v6 is not needed to run this script.

Clean v5

Verified

Nothing to change.

Does it run in Pine Script v6?

Not tested

The v5 script does not run in Zeal Terminal's engine (Pine Script v5 Error at @L18:C0: no source was supplied for the library 'HPotter/RouterOrdersIron/1'. Libraries cannot be fetched from TradingView; supply the source in the 'libraries' option. No libraries were supplied.), so this step could not be checked. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯    strategy.exit('Exit', 'Short', limit = Level-Take, stop = Level + Stop, alert_message = msg)-//@version=5+//@version=6strategy("Iron Support Resistance Automat", shorttitle="Iron SRA", overlay = true, calc_on_order_fills = true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2No It imports the library HPotter/RouterOrdersIron/1, whose source is not available here, so it does not run hereNot 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/// © HPotterTradeLong(Level, Take, Stop, ID, symbol, balance) =>    strategy.cancel_all()    msg = ROI.MsgDoLongMKT(ID, symbol,  balance)     strategy.entry("Long", strategy.long, stop = Level, alert_message = msg)     msg := ROI.MsgDoLongMKT(ID, symbol, 0)     strategy.exit('Exit', 'Long', limit = Level+Take, stop = Level - Stop, alert_message = msg)     TradeShort(Level, Take, Stop, ID, symbol,balance) =>     strategy.cancel_all()    msg = ROI.MsgDoShortMKT(ID, symbol, balance)    strategy.entry("Short", strategy.short, stop = Level, alert_message = msg)    msg := ROI.MsgDoShortMKT(ID, symbol, 0)    strategy.exit('Exit', 'Short', limit = Level-Take, stop = Level + Stop, alert_message = msg)//@version=5strategy("Iron Support Resistance Automat", shorttitle="Iron SRA", overlay = true, calc_on_order_fills = true)import HPotter/RouterOrdersIron/1 as ROIsymbol = input.string("BTC")ID = input.string("")balance = input.float(20, minval=12)TakePercent= input.float(1, minval=0.00001)StopPercent= input.float(1, minval=0.00001)LookBack = input.int(10)PointBack = input.int(5)ShowBackTest = input.bool(false)var Green = color.new(color.green, 0)var Red = color.new(color.red, 0)var Blue =  color.new(color.blue, 0)var Work = ShowBackTestif barstate.islastconfirmedhistory or barstate.isrealtime    Work := trueLLS = ta.lowest(hlc3, LookBack)Level = LLS[PointBack]var line lineLevel = na clr = close > Level ? Red  : Green line.delete(lineLevel)lineLevel := line.new(bar_index-LookBack,  LLS[LookBack], bar_index,  Level,  color = clr)Take = Level * TakePercent / 100 Stop = Level * StopPercent / 100 if Work and strategy.position_size == 0    if close < Level         TradeLong(Level, Take, Stop, ID, symbol, balance)    if close > Level         TradeShort(Level, Take, Stop, ID, symbol, balance)barcolor(strategy.position_size < 0 ? Red : strategy.position_size > 0 ? Green: Blue)