Skip to content

jeffreymelgo/melgo-sequence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Melgo Sequence — Price Structure Classifier

Original work by Jeff Rey Melgo | @JeffMelgo on TradingView Research: https://ssrn.com/abstract=6658238 Independent Researcher and System Developer | Cebu, Philippines


What This Is

The Melgo Sequence is a price structure classification engine built on the behavioral properties of three derived candle values:

Level Formula Name
HL2 (High + Low) / 2 Neutral Anchor (NA)
HLC3 (High + Low + Close) / 3 Structural Core (SC)
OHLC4 (Open + High + Low + Close) / 4 FakeOut Threshold (FOT)

Their relative ordering produces six mutually exclusive structural states:

Code State Sequence
T Bull Trend SC > NA > FOT
B Bear Trend FOT > NA > SC
R Bull Rejection SC > FOT > NA
I Bear Indecision NA > SC > FOT
D Distribution FOT > SC > NA
A Accumulation NA > FOT > SC

The classifier identifies market condition type before signaling direction — addressing one of the most consistent failure patterns in retail trading: entering with correct direction bias in structurally unreadable conditions.


What Is Published Here

This repository contains the public classifier release — the conceptual core of the system:

  • Four-timeframe state classification (Macro, Bias, Micro, Context)
  • On-chart state labels with streak and spread conviction
  • Dashboard showing all four timeframe states simultaneously

Sweep signals, breakout signals, zone levels, and the full entry/exit system are part of the proprietary implementation and are not included here.


Research Basis

The Melgo Sequence has been validated across eight phases of structured backtesting covering four instruments — BTCUSDT, SPY, EURUSD, and NASDAQ — with 18,904 valid candles tested under controlled confluence conditions. All directional findings are tested with two-sided binomial tests and Bonferroni correction for multiple comparisons.

A formal research paper is under editorial consideration at Technical Analysis of Stocks & Commodities magazine. The full statistical paper is publicly available at SSRN Abstract ID 6658238.


How to Use

  1. Open TradingView
  2. Open Pine Editor (bottom of screen)
  3. Paste the contents of melgo_sequence.pine
  4. Click Add to chart

Recommended default timeframe stack: 4H / 1H / 15m / 1D


License

Published under the Mozilla Public License 2.0.
Personal use only. Commercial use, white-labeling, or inclusion in paid products requires explicit written authorization from the author.

Contact: @JeffMelgo on TradingView


The Melgo Sequence classification system — including the NA / SC / FOT naming convention, the six-state sequence logic, and the signal framework built upon it — is the original, independent intellectual work of Jeff Rey Melgo, developed outside of any employment relationship and not derived from any third-party system.

About

A six-state price structure classifier built on HL2, HLC3, and OHLC4 — by Jeff Rey Melgo (@JeffMelgo). Research: SSRN 6658238

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors