Quote from Arthur Deco:
You want code? You can't handle code!
A money maker on a daily chart:
//deadbandonedayhelperRevA
var alpha=.04;
var filtonlow;var filtonhigh;
function preMain()
{setPriceStudy(false);setPlotType(PLOTTYPE_SQUAREWAVE);setDefaultBarBgColor(Color.RGB(255,165,0));//orange
setComputeOnClose(true);
}
function main()
{
if (filtonlow==null) {filtonlow=low();filtonhigh=high();}
filtonlow=((1-alpha)*filtonlow)+(alpha*low()); filtonhigh=((1-alpha)*filtonhigh)+(alpha*high());
if(high()<filtonhigh && low()<filtonlow){setBarBgColor(Color.red);}
if(low()>filtonlow && high()>filtonhigh){setBarBgColor(Color.lime);}
return;
} [/B]