Strategy · Pine Script v5 · On the chart

MSG Enhanced LEGO System Strategy

by alboogycOdR

This overlay strategy builds independent timed session ranges and marks range, trendline, mean, VWAP, and high-low levels when those displays are enabled.

View on GitHub

GitHub stars6on the repository
Pine versionv5runs as is
Lines of code2,000
Settings40inputs
LicenceNone stated
Last update7 months ago16 Mar 2026

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

MSG Enhanced LEGO System Strategy enters on range breakouts and exits with strategy exits, choosing among range, ATR, fixed-point, and risk-reward stop-loss and take-profit methods, with optional trailing, break-even, and partial exits. Settings change session hours and colors, position size, volume, trend, time, and range filters, plus daily loss, drawdown, and consecutive-loss limits. It draws boxes and trade levels on the price chart and can show a statistics table.

Details

Published by

alboogycOdR on GitHub

Draws

On the price chart

Markets

Any symbol

Timeframes

M15-H1

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.

Settings

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

SettingTypeDefaultVariable
sessionAEnabledbooltruesessionAEnabled
sessionAStartHourint13sessionAStartHour
sessionAStartMinuteint0sessionAStartMinute
sessionAEndHourint22sessionAEndHour
sessionAEndMinuteint0sessionAEndMinute
sessionAColorcolorcolor.orangesessionAColor
RangebooltruesessionAShowRange
TrendlineboolfalsesessionAShowTrendline
MeanboolfalsesessionAShowMean
VWAPbooltruesessionAShowVWAP
Max/MinbooltruesessionAShowMaxMin
sessionBEnabledbooltruesessionBEnabled
Show all 40 settings
SettingTypeDefaultVariable
sessionBStartHourint8sessionBStartHour
sessionBStartMinuteint0sessionBStartMinute
sessionBEndHourint17sessionBEndHour
sessionBEndMinuteint0sessionBEndMinute
sessionBColorcolorcolor.bluesessionBColor
RangebooltruesessionBShowRange
TrendlineboolfalsesessionBShowTrendline
MeanboolfalsesessionBShowMean
VWAPboolfalsesessionBShowVWAP
Max/MinboolfalsesessionBShowMaxMin
sessionCEnabledbooltruesessionCEnabled
sessionCStartHourint0sessionCStartHour
sessionCStartMinuteint0sessionCStartMinute
sessionCEndHourint9sessionCEndHour
sessionCEndMinuteint0sessionCEndMinute
sessionCColorcolorcolor.fuchsiasessionCColor
RangebooltruesessionCShowRange
TrendlineboolfalsesessionCShowTrendline
MeanboolfalsesessionCShowMean
VWAPboolfalsesessionCShowVWAP
Max/MinboolfalsesessionCShowMaxMin
msg1Enabledboolfalsemsg1Enabled
msg1StartHourint23msg1StartHour
msg1StartMinuteint0msg1StartMinute
msg1EndHourint1msg1EndHour
msg1EndMinuteint0msg1EndMinute
msg1Colorcolorcolor.yellowmsg1Color
Rangeboolfalsemsg1ShowRange
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

257 stars

This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry

Strategy v6 Volatility & bandsSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of V1.6 ES - Futures 1M No Repaint

Daily Bias + FVG Strategy

by TradersPost
228 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

Turtle MACD Time-Zone Filter

by skywalker0803r
42 stars

This strategy enters long when price closes above the prior Donchian high and short when it closes below the prior Donchian low, only while flat and inside a Taipei-hour window. It exits on a MACD histogram reversal or through an ATR stop and a percentage take

Strategy v5 BreakoutOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Turtle MACD Time-Zone Filter
16 stars

This strategy trades Donchian breakouts measured on weekly bars while orders execute on the chart timeframe. It allows long and short entries when price breaks the prior weekly channel and exits against the shorter weekly channel. Position size risks a set per

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 4: Weekly Donchian
11 stars

Calculates upper and lower Donchian Channel bands over a customizable lookback length and plots them on the main price chart. At a specified exchange hour, the strategy places a long buy stop order at the upper Donchian Channel level. Unfilled pending orders a

Strategy v6 BreakoutSupport & resistance
Updated 5 months ago · Apache-2.0 GitHub repository of Estrategia Donchian Breakout

More Sessions & time scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers