OPEN-SOURCE SCRIPT
Automated - Supply n Demand Levels

Here's a breakdown of its main components and the color scheme:
Automated - Supply n Demand Levels: The script calculates weighted closing prices (wC) and their rate of change (wCR). It then uses these to compute buying and selling pressure (buyP, sellP), which are averaged over 'n' bars to get buying (buyPres) and selling pressure (sellPres). The Demand Index (DI) is derived from these pressures.
Demand Levels Identification: The script sets demand levels (DemandL, DemandH) when the Demand Index crosses under a predefined value (DemandIndexValue). It plots these levels using lines (DL, DH) and a cloud (dcloud). The color for these levels and the cloud is set to green.
Supply Levels Identification: Similarly, supply levels (SupplyH, SupplyL) are set when the Demand Index crosses over the DemandIndexValue. These levels are plotted using lines (SH, SL) and a cloud (scloud). The color for these levels and the cloud is set to red.
Resistance Levels Calculation: The script also calculates resistance levels (res) based on the crossover of the closing price and the SupplyH. It plots these levels using lines (RH, RL) and a cloud (rcloud). The color for these levels and the cloud is set to a light blue.
Green: This color is used to indicate demand levels. These are areas on the chart where buying interest is presumed to be strong, suggesting potential support zones where the market price might bounce upwards.
Red: This color marks the supply levels. These levels represent zones where selling interest is expected to be high, indicating potential resistance areas where the market price might face downward pressure.
Light Blue: This color is used for potential resistance levels that are identified above the current supply level. These are higher price points where the price might struggle to rise further, indicating areas of additional resistance.
Automate your pinescript strategies to NinjaTrader! ninja-view.com/
Automated - Supply n Demand Levels: The script calculates weighted closing prices (wC) and their rate of change (wCR). It then uses these to compute buying and selling pressure (buyP, sellP), which are averaged over 'n' bars to get buying (buyPres) and selling pressure (sellPres). The Demand Index (DI) is derived from these pressures.
Demand Levels Identification: The script sets demand levels (DemandL, DemandH) when the Demand Index crosses under a predefined value (DemandIndexValue). It plots these levels using lines (DL, DH) and a cloud (dcloud). The color for these levels and the cloud is set to green.
Supply Levels Identification: Similarly, supply levels (SupplyH, SupplyL) are set when the Demand Index crosses over the DemandIndexValue. These levels are plotted using lines (SH, SL) and a cloud (scloud). The color for these levels and the cloud is set to red.
Resistance Levels Calculation: The script also calculates resistance levels (res) based on the crossover of the closing price and the SupplyH. It plots these levels using lines (RH, RL) and a cloud (rcloud). The color for these levels and the cloud is set to a light blue.
Green: This color is used to indicate demand levels. These are areas on the chart where buying interest is presumed to be strong, suggesting potential support zones where the market price might bounce upwards.
Red: This color marks the supply levels. These levels represent zones where selling interest is expected to be high, indicating potential resistance areas where the market price might face downward pressure.
Light Blue: This color is used for potential resistance levels that are identified above the current supply level. These are higher price points where the price might struggle to rise further, indicating areas of additional resistance.
Automate your pinescript strategies to NinjaTrader! ninja-view.com/
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.