Strategy · Pine Script v5 · On the chart

Git Pine Script v5 Template

by sysvar

Acts as a modular strategy boilerplate designed for automated and manual trading strategies on the price chart.

View on GitHub

GitHub stars7on the repository
Pine versionv5runs as is
Lines of code298
Settings33inputs
LicenceNone stated
Last update2 years ago19 Mar 2024

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  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

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Git Pine Script v5 Template provides execution infrastructure including trade direction toggles, signal reversal, alternating orders, session filtering, and anti-news volatility delays. Exits are handled via fixed pip take profit and stop loss levels, recent swing high or low lookbacks with risk-reward ratios, or custom logic. Extensive safety inputs allow users to enforce max daily losses, equity drawdown ceilings, and post-loss candle cooldowns.

Details

Published by

sysvar on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Sessions & time

Markets

Forex

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.

Topics

pinescripttemplatetradingview

Settings

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

SettingTypeDefaultVariable
Pip Symbol Valuestring10000sys_input_pip
Position Sizeint500000sys_input_general_positionSize
Trade DirectionstringBothsys_input_dire
Reverse Buy/Sellboolfalsesys_input_dire_reverse
Alternate Between Buy & Sellboolfalsesys_input_dire_alternate
(A) Take Profit / Stop Lossbooltruesys_input_exit_tpsl
(B) Take Profit / Trailing Stop (TODO)boolfalsesys_input_exit_tpts
(C) Recent High/Low and Risk Reward Ratioboolfalsesys_input_exit_hlrr
(D) Custom Exitboolfalsesys_input_exit_cust
(A) Take Profit Pipsfloat9sys_input_risk_tpslProfit
(A) Stop Loss Pipsfloat4sys_input_risk_tpslLoss
(C) Lookback Period High/Lowint20sys_input_risk_hlrrLookBack
Show all 33 settings
SettingTypeDefaultVariable
(C) Extra Pips Above/Belowfloat0.5sys_input_risk_hlrrExtraPips
(C) Risk Reward Ratiofloat1.5sys_input_risk_hlrrRiskReward
Lost Trade Wait Candlesint0sys_input_risk_waitLoss
News Pip Triggerint7sys_input_risk_newsPips
News Trade Wait Candlesint10sys_input_risk_newsCandles
Enable Backtesting Datesboolfalsesys_input_backtest_range
Start Date (UTC 0)timetimestamp("14 Nov 2023 07:00 +0000")sys_input_backtest_start
End Date (UTC 0)timetimestamp("14 Nov 2023 19:00 +0000")sys_input_backtest_end
TimezonestringUTCsys_input_time_zone
Allowed hourssession0700-1900sys_input_time_hours
Allowed Daysstring123456sys_input_time_days
Enable Safety Settingsboolfalsesys_input_safety
Max Position Sizeint9999999999999999sys_input_safety_positionSize
Max Drawdown Cashint9999999999999999sys_input_safety_drawdownCash
Max Drawdown Account Equity %int9999999999999999sys_input_safety_drawdownEquity
Max Consecutive Days Lostint9999999999999999sys_input_safety_consLossDays
Max Intra-Day Tradesint9999999999999999sys_input_safety_intradayTrades
Max Day Cash Lossint9999999999999999sys_input_safety_intradayLossCash
Max Day Account Equity % Lossint9999999999999999sys_input_safety_intradayLossEquity
EMA Lengthint9usr_input_ema_length
EMA Above/Below Pipsfloat0.5usr_input_ema_diff
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

361 stars

Forven S01512 — Monday Drift is a calendar-based long trading strategy designed to exploit time-based recurring market patterns. It tracks UTC calendar days and hours to enter a long position at a specified day and hour, holding it for a fixed duration until a

Strategy v6 Sessions & time
Updated today · AGPL-3.0 GitHub repository of Forven S01512 - Monday Drift

This overlay strategy offers two selectable entry modes: a Bollinger squeeze on typical price and a simple moving-average cross. It filters trades by weekday, session, date range, and an optional news window, and can restrict direction or invert the side. Risk

Strategy v5 Volatility & bandsMoving averages
Updated today · None stated GitHub repository of Boilerplate Configurable Strategy [Yosiet]
257 stars

Donald - Test Logic Futures is an overlay strategy designed for intraday futures trading. It combines kernel regression functions with exponential moving averages to evaluate price retracements and entry timing. Trades are filtered by session execution windows

Strategy v5 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Donald - Test Logic Futures

Daily Bias + FVG Strategy

by TradersPost
218 stars

This overlay strategy plots previous-day high and low, the daily open, and fair value gap zones on the price chart. It takes entries on a selectable timeframe when the FVG requirement and an optional session window allow them, then uses an ATR or fixed pip sto

Strategy v6 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Daily Bias + FVG Strategy
106 stars

This script monitors opening gap conditions and breakout behavior relative to the first candle's range across up to twenty configurable stock tickers. It detects whether following bars remain inside the opening range before breaking out, displaying the status

Strategy v4 Screeners & dashboardsBreakout Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 1St Bar GAP+BkOut Screener v2 by RM
53 stars

This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of BTCUSD 5M Optimized Strategy

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