Create Indicator Using following details: A Demand Zone in trading is a price area where…
- User
Create Indicator Using following details: A Demand Zone in trading is a price area where buying interest is strong enough to prevent the price from falling further. In this zone, traders expect that the demand will push the price higher due to the concentration of buy orders.
What Does a Demand Zone Look Like? Visually, a demand zone typically appears as a cluster of candles near a support level, where the price has been unable to fall further and often reverses upward. It's often characterized by:
Strong bullish candles: These are large green candles with small wicks or no wicks, indicating that buyers controlled the price movement during the formation of the candle. Consolidation periods: Before the price reverses, the market may show a period of sideways movement with small candles or indecision candles (like Doji or Spinning Tops), signaling that selling pressure is weakening and buyers are stepping in. Rejection wicks: Candles with long lower wicks indicate that sellers pushed the price down, but buyers were able to bring it back up, showing strong demand in that area. Types of Demand Zones Rally-Base-Rally (RBR):
A demand zone is formed when there is a rally in price, followed by a brief consolidation (base), and then another rally. Rally: A sequence of bullish candles with strong upward momentum. Base: A period of consolidation with small candles indicating indecision. Rally: The final upward move after the base, showing that demand still outpaces supply. Candles in the Base: Small, narrow candles that could be Doji, Spinning Tops, or candles with wicks indicating a balance between buyers and sellers before the next rally. Drop-Base-Rally (DBR):
This demand zone forms after a drop in price, followed by a consolidation (base), and then a rally. Drop: A bearish move in price with strong red candles. Base: A range of small candles signaling that the downward momentum is exhausted, and buyers are stepping in. Rally: A strong upward move after the base, driven by increased demand. Candles in the Base: Similar to RBR, the candles in this base are usually small and show little price movement as the market prepares to reverse upward. Deep Dive Into Candle Size in Demand Zones Candle size plays a crucial role in identifying a demand zone. Here's a breakdown:
Rally Candles (Before and After the Base):
Body Size: The body of the bullish candle should be large relative to the base candles, showing that buyers are in control. For a good demand zone, the body should cover at least 60-80% of the entire candle, with minimal wicks. Wicks: Short upper wicks show that sellers were unable to push the price back down, which is a strong bullish signal. Volume: High volume is a sign of aggressive buying, which reinforces the validity of the demand zone. Base Candles (Within the Base):
Body Size: The candles in the base should be small, indicating indecision. If the bodies are large, it may indicate volatility and a weak base. Wicks: These candles may have long wicks on both sides, showing that both buyers and sellers are active but neither side is able to dominate. Long lower wicks can be a sign that buyers are defending the zone. Types of Candles: You might see Doji, Spinning Tops, or small-bodied candles with large wicks, indicating that the market is neutral and preparing for a reversal. Volume:
- Assistant
Certainly! Below is a TradingView Pine Script v5 indicator that identifies Demand Zones based on your detailed specifications:
//@version=5 indicator("Demand Zone Indicator", overlay=true) // Input for ATR calculation atrLength = input.int(14, "ATR Length") atr = ta.atr(atrLength) // Functions to identify candle types isStrongBullish(idx) => bodySize = close[idx] - open[idx] totalSize = high[idx] - low[idx] bodyRatio = bodySize / totalSize bodyRatio >= 0.6 and (totalSize >= atr[idx]) isStrongBearish(idx) => bodySize = open[idx] - close[idx] totalSize = high[idx] - low[idx] bodyRatio = bodySize / totalSize bodyRatio >= 0.6 and (totalSize >= atr[idx]) isBaseCandle(idx) => totalSize = high[idx] - low[idx] bodySize = math.abs(close[idx] - open[idx]) bodyRatio = bodySize / totalSize wicks = totalSize - bodySize wickRatio = wicks / totalSize smallBody = bodyRatio <= 0.3 longWicks = wickRatio >= 0.7 smallRange = totalSize <= (1.5 * atr[idx]) (smallBody or longWicks) and smallRange // Variables to store demand zones var demandZones = array.new_table() // Function to draw demand zones drawDemandZone(left, right, upper, lower) => var colorZone = color.new(color.green, 80) box.new(left=left, top=upper, right=right, bottom=lower, border_color=colorZone, bgcolor=colorZone) // Loop through bars to identify patterns for i = 2 to bar_index by 1 // Rally-Base-Rally (RBR) if isStrongBullish(i - 2) and isBaseCandle(i - 1) and isStrongBullish(i) baseHigh = high[i - 1] baseLow = low[i - 1] drawDemandZone(bar_index[i - 1], bar_index[i] + 100, baseHigh, baseLow) // Drop-Base-Rally (DBR) if isStrongBearish(i - 2) and isBaseCandle(i - 1) and isStrongBullish(i) baseHigh = high[i - 1] baseLow = low[i - 1] drawDemandZone(bar_index[i - 1], bar_index[i] + 100, baseHigh, baseLow)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.