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/
educationalPivot points and levelsTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer