Something wrong with DChannel ?

Posted By: sodiumchloride

Something wrong with DChannel ? - 07/31/17 15:31

i tried this
Code:
// DC Test
function run()
{
	set(PLOTNOW);
	StartDate = 20170722;
	BarPeriod = 1;
	vars Price = series(price());
	plot("DC",DChannel(20),0,RED);
}


and it is only plotting the upper line. i was then searching for "DChannel" in Zorro folder and in indicators.c i found this
@Line 312:
Code:
// Donchian Channel
var DChannel(int Period)
{
	rRealUpperBand = HH(Period,0);
	rRealLowerBand = LL(Period,0);
	return rRealUpperBand;
}


looks like the return of the lower band is missing? i hope someone can enlighten me. ty
Posted By: MatPed

Re: Something wrong with DChannel ? - 07/31/17 18:00

hi,
you should first call DChannel and than plot rRealUpperBand and rRealLowerBand.

Ciao
Posted By: sodiumchloride

Re: Something wrong with DChannel ? - 08/01/17 10:52

fixed it, tyvm

Code:
// DC Test
function run()
{
	set(PLOTNOW);
	StartDate = 20170722;
	BarPeriod = 1;
	vars Price = series(price());
	DChannel(20);
	plot("DC UP",rRealUpperBand,BAND1,RED);
	plot("DC DOWN",rRealLowerBand,BAND2,GREY);
}

© 2024 lite-C Forums