PureBytes Links
Trading Reference Links
|
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?
>
Here is the solution I chose, though I'm a little uncomfortable with reliance on
a single bar. It seems to work for active securities, such as ES and NQ
Var: YDayC(0), GotFirstClose(False);
if Time = Sess1EndTime then begin
YDayC = Close;
GotFirstClose = True;
end;
if GotFirstClose then begin
if Time >= Sess1StartTime and Time <= Sess1EndTime then
Plot1 (YDayC, "YDayC", yellow)
else if Time >= Sess1EndTime then
Plot1 (YDayC, "YDayC", red)
else Plot1 (YDayC, "YDayC", white);
end;
After thinking it over, it may be more reliable to remember things during RTHs.
Here is some pseudocode which also collects OHL, but which I have not
implemented:
Var: gotOpen(False),
tmpO(null), tmpH(null), tmpL(null), tmpC(null),
YDayO(null), YDayH(null), YDayL(null), YDayC(null)
if Time >= Sess1StartTime and Time <= Sess1EndTime then
unless gotOpen
tmpO = open
gotOpen = True
if H > tmpH then tmpH = H
if L < tmpL then tmpL = L
tmpC = C
else
if tmpO /= null then
YDayO = tmpO
tmpO = null
gotOpen = False
if tmpH /= null then
YDayH = tmpH
tmpH = null
if tmpL /= null then
YDayL = tmpL
tmpC = null
if tmpC /= null then
YDayC = tmpC
tmpC = null
|