03-20-2009, 07:00 PM
|
#8 |
Join Date: Nov 2006 Location: N/A Thanks: 62
Thanked 294 Times in 177 Posts
| Re: Finding Globex High and Low in Easylanguage Here is my version I am using. It is most likely not the best way of doing it as I am not a very efficient programmer and it is not 100% there. The minute between 23:59 and midnight is ignored, so you have a small chance of missing the high/low if it is made during that minute. I am only using it on time based charts, but I think it should work on tick and volume based charts too. Code: inputs:
StartTime1 (1530),
EndTime1 (2359),
StartTime2 (0000),
EndTime2 (0830),
PlotStartTime (0830),
PlotEndtime (1515),
TLSize (1),
TLStyle (1),
ONH_Color (red),
ONL_Color (green);
variables:
ON_High(0),
Plot_High(0),
ON_Low(999999999),
Plot_Low(0),
TL_ON_High(0),
TL_ON_Low(0),
ONH_Txt(0),
ONL_Txt(0),
TextStyleHoriz(1),
TextStyleVert(1);
If Time > PlotStartTime and Time[1] <= PlotStartTime then
begin
Plot_High = ON_High;
Plot_Low = ON_Low;
ON_High = 0;
ON_Low = 999999999;
end;
if (Time >= StartTime1 and Time <= Endtime1) or (Time >= StartTime2 and Time <= EndTime2) then
begin
if High > ON_High then ON_High = High;
if Low < ON_Low then On_Low = Low;
end ;
if Time > PlotStartTime then
begin
TL_ON_High = TL_New(Date, PlotStartTime, Plot_High, Date, PlotEndTime, Plot_High);
TL_SetColor(TL_ON_High, ONH_Color);
TL_SetSize(TL_ON_High, TLSize);
TL_SetStyle(TL_ON_High, TLStyle);
TL_ON_Low = TL_New(Date, PlotStartTime, Plot_Low, Date, PlotEndTime, Plot_Low);
TL_SetColor(TL_ON_Low, ONL_Color);
TL_SetSize(TL_ON_Low, TLSize);
TL_SetStyle(TL_ON_Low, TLStyle);
ONH_Txt = Text_New(Date, PlotEndTime, Plot_High, "ONH");
Text_SetStyle(ONH_Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(ONH_Txt, ONH_Color);
ONL_Txt = Text_New(Date, PlotEndTime, Plot_Low, "ONL");
Text_SetStyle(ONL_Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(ONL_Txt, ONL_Color);
end; |
| |