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

RE: EL Question



PureBytes Links

Trading Reference Links

I'm in the process of writing a function that combines different time
frames.  I am building it piece-by-piece as I find need for it, so it's not
fully functional yet.  Only thing that does work right now is determining
the daily price based on intraday.  My only request in return: should
anybody be kind enough to write the rest of the pieces, please send it to me
as well (or post it to the list).

Looking at the ongoing thread "Different Between Intraday and Daily Data?",
when differences between different price data can be so absurd in some
cases, the applicability of this funtion may be somewhat limited, however...

Ivo






PS Example for calling SecondScale funtion for daily prices based on
intraday data:

vars: Od(0), Hd(0), Ld(0), Cd(0);

	Od=SecondScale(O, 1); 	{Daily Open	}
	Hd=SecondScale(H, 1); 	{Daily High	}
	Ld=SecondScale(L, 1); 	{Daily Low	}
	Cd=SecondScale(C, 1); 	{Daily Close}




{********************************************************
SecondScale function
This funtion determines the price value of a different
timeframe.  FX, daily close based on intraday data, etc.

2001 by Ivo Karindi, ivo@xxxxxxxxx
********************************************************}

input: 	Price(NumericSeries), 	{Price: o,h,l,c, range						}
		Scale(Numeric);		{Intraday: 	0.6 for 60-minute, 0.3 for 30-minute, etc.}
						{Daily:	1							}
						{Weekly:	2							}
						{Monthly:	3							}
						{Quarterly:	4							}
						{Yearly:	5							}

vars: ScNum(0), dc(0), DT(0), TT(0), Pr(0), v1(0), Counter(0);
array: PA[10000](0);


if CurrentBar=1 then begin
	dc=DataCompression;
	if Price=Open or Price=o then Pr=1;
	if Price=Close or Price=c then Pr=4;
	if Price=High or Price=h then Pr=3;
	if Price=Low or Price=l then Pr=2;
end;

ScNum=0;

{*********** INTRADAY BASED ON INTRADAY **************}
if Scale<1 and dc<2 then begin

end;


{*********** DAILY BASED ON INTRADAY **************}
if Scale=1 and dc<2 then begin
	Counter=Counter+1;

	if Pr=1 and Time=CalcTime(Sess1StartTime, BarInterval) then v1=Open[0];

	if Pr=4 and Time=Sess1EndTime then v1=Close[0];

	if Pr=2 and Counter=1 then v1=Low;
	if Pr=2 and Counter>1 and Low<v1 then v1=Low;

	if Pr=3 and Counter=1 then v1=High;
	if Pr=3 and Counter>1 and High>v1 then v1=High;

	if Time=Sess1EndTime then begin
		ScNum=v1;
		Counter=0;
	end;
end;

{*********** WEEKLY BASED ON INTRADAY **************}
if Scale=2 and dc<2 then begin

end;

{*********** MONTHLY BASED ON INTRADAY **************}
if Scale=3 and dc<2 then begin

end;

{*********** QUATERLY BASED ON INTRADAY **************}
if Scale=4 and dc<2 then begin

end;

{*********** YEARLY BASED ON INTRADAY **************}
if Scale=5 and dc<2 then begin

end;

{*********** WEEKLY BASED ON DAILY **************}
if Scale=2 and dc=2 then begin

end;

{*********** MONTHLY BASED ON DAILY **************}
if Scale=3 and dc=2 then begin

end;

{*********** QUARTERLY BASED ON DAILY **************}
if Scale=4 and dc=2 then begin

end;

{*********** YEARLY BASED ON DAILY **************}
if Scale=5 and dc=2 then begin

end;

{*********** MONTHLY BASED ON WEEKLY **************}
if Scale=3 and dc=3 then begin

end;

{*********** QUARTERLY BASED ON WEEKLY **************}
if Scale=4 and dc=3 then begin

end;

{*********** YEARLY BASED ON WEEKLY **************}
if Scale=5 and dc=3 then begin

end;

{*********** QUARTERLY BASED ON MONTHLY **************}
if Scale=4 and dc=4 then begin

end;

{*********** YEARLY BASED ON MONTHLY **************}
if Scale=5 and dc=4 then begin

end;

SecondScale=ScNum;












> -----Original Message-----
> From: Sean O'Toole [mailto:sean@xxxxxxxxxxxxxxxxxxxx]
> Sent: Monday, April 09, 2001 2:35 PM
> To: Omega List
> Subject: EL Question
>
>
> I'm having a mental lapse here.  I would like to incorporate
> yesterday's
> high and low into an indicator which will be used on today's
> intraday data.
> How do I call daily data from an intraday chart?
>
> TIA
>
> Sean
>
>