[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EL question



PureBytes Links

Trading Reference Links

I am looking at the Chandelier exit and I can not get it to accept dates
after 990131.  Code for the indicator is below.  Any help would be
appreciated.  TS4 build 27.

TIA
Frank


Input:	StrtDate(0),	{Date you want  plot to start, YYMMDD format}
		StrtTime(0),	{Optional time to start if intraday data, HHMM 24 hour
format}
		Pos("L"),		{Position - use "L" for Long "S" for Short (including
quotes)}
		Fac(3),			{True range multiplier}
		ATRLen(10);	{Length of average}
Vars:
		MaxChand(-999999),		{Chandelier exit var}
		MinChand(999999)			{Chandelier exit var};

If Pos="L" then begin {Long Trade}
	if Time>=StrtTime and Date>=StrtDate then begin
		If (H -Fac*Average(TrueRange,ATRLen)) > MaxChand then
		MaxChand= (H -Fac*Average(TrueRange,ATRLen));
		Plot1(MaxChand,"LongExit");
	end;
end;

If Pos="S" then begin {Short Trade}
	if Time>=StrtTime and Date>=StrtDate then begin
		if (L +Fac*Average(TrueRange,ATRLen)) < MinChand then
		MinChand= (L +Fac*Average(TrueRange,ATRLen));
		Plot2(MinChand,"ShortExit");
	end;
end;