DEMAND AND SUPPLY CODE

DEMAND AND SUPPLY CODE

Hey,

Here is the code of Demand And supply Indicator.

//@version=4
        //change here with the name you prefer to give the script
study("Custom Script GSF Demand & Supply Zone", overlay=true)

show_color = input(true, title="Show Color?", type=input.bool)


bool cond = na

//red candles
if close < open
    // open - close < 1/2 high - low
    cond := open - close < (high - low)/2 and show_color
   

//green candles
if close > open
    //close - Open < 1/2 (High - Low)
    cond := close - open < (high - low)/2 and show_color
   

barcolor(color= cond ? color.navy : na, title ="bar color")