PureBytes Links
Trading Reference Links
|
Sanford Morton wrote:
> On Sat, 2 Nov 2002, Sanford Morton wrote:
>
> > I'd like to chart the previous day's RTH close on an intraday ES Z2 chart. The
> > only ela's I have seen to do this use CloseD(), but this seems to pick up the
> > last tick just before midnight in the Globex session. Is there a simple way to
> > get the close of the regular session?
> >
Dear Sanford,
Below is a study that would be easy to modify to do what you want.
Sincerely,
Richard
{ TS6 ShowMe Study that Plots Yesterday + Today's Two-Day Highest H, Lowest L, &
Mid- & Quarter- Two-Day Ranges }
{ Adds values (reduced to two signif figures) as text to right hand side of plots }
{ Programmed for 24-hour E-Mini Contracts for Minute-based charts (eg, 5-minute) }
{ Problem with Late Open on Sunday ---
Weekday Open at 1645
Sunday Open at 1830, 1 hr 45 min later
Sunday Opening Bar (with data) will always be 1st bar after 1830 depending on
BarInterval --- that is:
1845 for any BI >= 15 min
1830 + BI for any BI <= 15 min
*** Above assumes chart does not begin on a Sunday }
Var: Start(0),
Hi1(0),
Hi0(0),
Hi(0),
Lo1(99999),
Lo0(99999),
Lo(99999),
Mid(0),
Range(0),
Ctr(0),
IDH(-1),
OldIDH(-1),
IDM(-1),
OldIDM(-1),
IDL(-1),
OldIDL(-1);
{ Indicator Study }
IF DayOfWeek(Date) = 0 THEN BEGIN { Sunday Open }
IF BarInterval >= 15 THEN Start = TimeToMinutes(1830) + 15 { BI >= 15 }
ELSE Start = TimeToMinutes(1830) + BarInterval; { BI <= 15 }
END ELSE Start = TimeToMinutes(Sess1StartTime) + BarInterval; { Weekday Open }
IF TimeToMinutes(Time) = Start THEN BEGIN { Opening Bar with Data }
Hi1 = Hi0;
Hi0 = H;
Lo1 = Lo0;
Lo0 = L;
END ELSE BEGIN { Intersession }
IF H > Hi0 THEN Hi0 = H;
IF L < Lo0 THEN Lo0 = L;
END;
Hi = MaxList(Hi1,Hi0); { Highest H of yesterday + today }
Plot1(Hi,"2DayH");
Lo = MinList(Lo1,Lo0); { Lowest L of yesterday + today }
Plot2(Lo,"2DayL");
Mid = (Hi + Lo) / 2; { 2Day Midrange price }
Plot3(Mid,"2DayMid");
Range = Hi - Lo; { 2Day Range }
IF C[1] < Mid AND C > Mid THEN BEGIN
Plot4(Lo + (0.75 * Range),"2DayQ");
Ctr = 0;
END ELSE IF C > Mid THEN BEGIN
Ctr = Ctr[1] + 1;
IF Mod(Ctr,2) = 0 THEN Plot4(Lo + (0.75 * Range),"2DayQ");
END;
IF C[1] > Mid AND C < Mid THEN BEGIN
Plot4(Lo + (0.25 * Range),"2DayQ");
Ctr = 0;
END ELSE IF C < Mid THEN BEGIN
Ctr = Ctr[1] + 1;
IF Mod(Ctr,2) = 0 THEN Plot4(Lo + (0.25 * Range),"2DayQ");
END;
{ Text Study }
Value1 = Hi - 100 * IntPortion(Hi / 100); { Reduces values to 2 signif
figures }
Value2 = Mid - 100 * IntPortion(Mid / 100);
Value3 = Lo - 100 * IntPortion(Lo / 100);
IF LastBarOnChart THEN BEGIN { Adds Hi, Mid & Lo values to chart as text }
OldIDH = IDH; { Deletes text from prior bar }
OldIDM = IDM;
OldIDL = IDL;
IF OldIDH <> -1 THEN BEGIN
Value11 = Text_Delete(OldIDH);
Value12 = Text_Delete(OldIDM);
Value13 = Text_Delete(OldIDL);
END;
IDH = Text_New(D,T+5*BarInterval,Hi,NumToStr(Value1,2)); { Adds text to current
bar }
Text_SetStyle(IDH,0,0);
Text_SetColor(IDH,8);
IDM = Text_New(D,T+5*BarInterval,Mid,NumToStr(Value2,2));
Text_SetStyle(IDM,0,2);
Text_SetColor(IDM,7);
IDL = Text_New(D,T+5*BarInterval,Lo,NumToStr(Value3,2));
Text_SetStyle(IDL,0,1);
Text_SetColor(IDL,8);
END;
{ Note: For this study, don't check "Update Every Tick"; & set "Space to the Right"
appropriately }
{ Richard Josslin, TaoOfDow@xxxxxxxxxxxxxx --- October 25, 2002 --- All rights
reserved }
|