OPEN-SOURCE SCRIPT

Good Candles with Risk Table

This custom Pine Script indicator highlights bullish and bearish candles based on the highest and lowest close prices over the past specified number of candles (look-back period).

Bullish candles are marked with an orange color when the close is higher than the highest close from the previous candle.
Bearish candles are marked with a purple color when the close is lower than the lowest close from the previous candle.
The indicator also draws two lines for each colored candle:

Midline: A horizontal line drawn at the midpoint between the open and close of the candle, which helps visualize the candle's body.
Open line: A horizontal line drawn at the open price, offering an additional reference point for market action.
Lines are visible for the last 5 colored candles (either bullish or bearish), with old lines being removed to avoid clutter on the chart.

Additionally, the Risk Table at the top right of the chart shows the calculated units to buy for the specified risk amount (default value of $0.1), based on the distance between the candle’s close and its midpoint. This allows users to manage their risk effectively by knowing how many units they should purchase to match their desired risk level.
Candlestick analysis

Skrip sumber terbuka

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai sumber terbuka supaya pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara percuma, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?

Penafian