Posted By: tradingest
RangeBar - 01/12/19 14:28
Hi guys,
whythe range bar is not costant?
Here I show you the difference between High and Low. Why is not costant? The code used below
thanks
whythe range bar is not costant?
Here I show you the difference between High and Low. Why is not costant? The code used below
Code:
var BarRange = 0.005; //Range Bar int bar(vars Open,vars High,vars Low,vars Close) { if(Open[0] != Close[1]) { High[0] = max(Open[0],Close[1]); Low[0] = min(Open[0],Close[1]); Open[0] = Close[1]; } if(High[0]-Low[0] >= BarRange) return 1; return 4; } function run() { set(PLOTNOW); StartDate = 20180601; EndDate = 2019; BarPeriod = 1; asset("EUR/USD"); plot("Range",priceHigh()-priceLow() ,NEW,RED); }
thanks