OPEN-SOURCE SCRIPT

Break of High/Low with Volume, MACD, and MAs

Theo Antaresfx_league
How It Works:

Sessions:

The London session is defined between 8:00 and 16:00 UTC.
The New York session is defined between 13:00 and 21:00 UTC.

Previous High/Low:

The script identifies the highest high and lowest low from the previous bar using ta.highest(high, 1)[1] and ta.lowest(low, 1)[1].

Candle Body Size:

The script calculates the size of the current candle's body and checks if it is at least double the size of the previous candle's body.

Volume Check:

A high volume threshold is set as 1.5 times the 50-period SMA of the volume.

MACD Crossover:

The script calculates the MACD and its signal line and checks for bullish (buy) or bearish (sell) crossovers.

Signals:

A long signal (buy) is generated if the price breaks the previous high with a large body candle, high volume, and a bullish MACD crossover during the specified sessions.

A short signal (sell) is generated if the price breaks the previous low with a large body candle, high volume, and a bearish MACD crossover during the specified sessions.

Plotting:

The 50-period and 200-period moving averages, previous high, and previous low are plotted on the chart.

If a long condition is met, a "BUY" label is displayed below the bar. If a short condition is met, a "SELL" label is displayed above the bar.

Alerts:

Alerts are triggered whenever the conditions for a long or short trade are met.
Customization:

Feel free to adjust the session times, volume threshold, MACD settings, or moving averages based on your trading strategy or the specific asset you are trading.


Moving AveragesPine utilitiesVolume

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Thông báo miễn trừ trách nhiệm