OPEN-SOURCE SCRIPT
Strategy_501 de FranPineda

**Strategy_501 de FranPineda**
Strategy_501 is a New York session liquidity-based strategy built around a predefined 3-hour range.
The model first creates a range from **06:00 to 08:59 New York time**. Once that range is completed, the strategy starts tracking the highest high and the lowest low formed by the M5 candles after the range closes.
The active entry window runs from **09:00 to 12:30 New York time**.
The strategy does not enter immediately after a liquidity sweep. Instead, it waits for price to take one side of the 3-hour range and then places a pending stop order at the opposite post-range extreme.
For a **long setup**, price must first take the low of the 3-hour range. After that, the strategy places a buy stop order at the highest M5 high formed after the range close. The stop loss is placed below the lowest M5 low formed after the range close, with a configurable buffer.
For a **short setup**, price must first take the high of the 3-hour range. After that, the strategy places a sell stop order at the lowest M5 low formed after the range close. The stop loss is placed above the highest M5 high formed after the range close, with a configurable buffer.
The take profit is always calculated using a fixed **1:1 risk-to-reward ratio**. It is not limited to the opposite side of the 3-hour range. If the opposite range level is not far enough to provide a full 1R target, the take profit is extended until the 1:1 RR level is reached.
If no entry is triggered before **12:30 New York time**, the pending setup is cancelled and the strategy waits for the next trading day.
If a trade is still open at **16:00 New York time**, the stop loss is moved to break even.
**Core logic:**
* 3-hour New York range: 06:00–08:59 NY.
* Entry window: 09:00–12:30 NY.
* Liquidity sweep of the range high or low.
* Pending stop entry at the opposite post-range M5 extreme.
* Stop loss beyond the post-range extreme with buffer.
* Take profit always at 1:1 RR.
* Break even rule at 16:00 NY.
* One trade maximum per day.
* Designed for the M5 timeframe.
The purpose of this strategy is to study how price behaves after taking liquidity from a key intraday range and whether a later breakout of the post-range structure can offer a cleaner continuation toward a fixed 1R target.
Strategy_501 is a New York session liquidity-based strategy built around a predefined 3-hour range.
The model first creates a range from **06:00 to 08:59 New York time**. Once that range is completed, the strategy starts tracking the highest high and the lowest low formed by the M5 candles after the range closes.
The active entry window runs from **09:00 to 12:30 New York time**.
The strategy does not enter immediately after a liquidity sweep. Instead, it waits for price to take one side of the 3-hour range and then places a pending stop order at the opposite post-range extreme.
For a **long setup**, price must first take the low of the 3-hour range. After that, the strategy places a buy stop order at the highest M5 high formed after the range close. The stop loss is placed below the lowest M5 low formed after the range close, with a configurable buffer.
For a **short setup**, price must first take the high of the 3-hour range. After that, the strategy places a sell stop order at the lowest M5 low formed after the range close. The stop loss is placed above the highest M5 high formed after the range close, with a configurable buffer.
The take profit is always calculated using a fixed **1:1 risk-to-reward ratio**. It is not limited to the opposite side of the 3-hour range. If the opposite range level is not far enough to provide a full 1R target, the take profit is extended until the 1:1 RR level is reached.
If no entry is triggered before **12:30 New York time**, the pending setup is cancelled and the strategy waits for the next trading day.
If a trade is still open at **16:00 New York time**, the stop loss is moved to break even.
**Core logic:**
* 3-hour New York range: 06:00–08:59 NY.
* Entry window: 09:00–12:30 NY.
* Liquidity sweep of the range high or low.
* Pending stop entry at the opposite post-range M5 extreme.
* Stop loss beyond the post-range extreme with buffer.
* Take profit always at 1:1 RR.
* Break even rule at 16:00 NY.
* One trade maximum per day.
* Designed for the M5 timeframe.
The purpose of this strategy is to study how price behaves after taking liquidity from a key intraday range and whether a later breakout of the post-range structure can offer a cleaner continuation toward a fixed 1R target.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.