Neil,
You are correct, I originally posted the code to assist someone
that was trying to capture the market high and low. I should have checked it
more closely. I prefer trading the ES mini but use the same code for trading
any market that is moving with good volume.
mkss = market slow time start
(not plotted)
mkse = market slow time end (not plotted)
va30 = 30
minutes pre close for Value High and Low of final 30 minutes
va2h = final 2
hours for getting the High and Low of final 2 hours
These will
typically come into play the following day, they often come into play in the
first 15 minutes of trading and will act as support or resistance
points.
You did not question the preOpen High and Low but they are for
the same purpose as the Va30 and Va2h.
David K.
--- In amibroker@xxxxxxxxxps.com,
"Neil Wrightson" <neilw@xxx> wrote:
>
> Hi,
>
>
I haven't look to closely at the code yet but I surmise that the
following
> two lines should have the 160000 replaced with cltn.
>
> mkCl = ValueWhen(Cross(TimeNum(),160000),C);
>
xmCL = bc-BarsSince(Cross(TimeNum(),160000)>0);
>
> i.e.
>
> mkCl =
ValueWhen(Cross(TimeNum(),cltn),C);
> xmCL =
bc-BarsSince(Cross(TimeNum(),cltn)>0);
>
>
> I also wonder about other lines i.e.
> mkss = 110000;
>
mkse = 133000; tfrslo = tn>=mkss AND tn<= mkse;
> va30 = 154500;
tfva30 = tn>=va30 AND tn<= cltn;
> va2h = cltn-020000; tf2hrs =
tn>=va2h AND tn<= cltn;
>
>
> Just out of interest,
what market was this originally created for?
>
>
>
Regards,
> Neil Wrightson.
> Skype : Neil_Wrightson
>
>
> -----Original Message-----
> From: amibroker@xxxxxxxxxps.com
[mailto:amibroker@xxxxxxxxxps.com]
On Behalf
> Of Vinay Gakkhar.
> Sent: Saturday, 5 December 2009
11:16 PM
> To: amibroker@xxxxxxxxxps.com
>
Subject: [amibroker] SUPER PIVOT POINTS
>
> Dear David K &
Wooziwog,
>
> Sorry, it is not 'gtet', it is 'gtext', at the
following place:
>
> _SECTION_BEGIN("GFX Text+Label, GFX Y,
Std X"); //======================
> dec=0; ha=0; procedure
gtx(val,color,string,xpos) { GfxSetTextColor(color);
>
gtext=GfxDrawText(NumToStr(val,dec)+"-"+
>
> Best
regards,
>
> Vinay
>
>
> On Sat, 05 Dec 2009
10:21:42 +0530, wooziwog <xcitemint@x..> wrote:
>
>
> vinay,
> >
> > I copy and pasted the formula below into
AB 5.2.9.2 and searched for the
> 'gtet' that you describe, it does not
exist in the formula. I am guessing
> you may have a problem with line
wrapping. GfxSetText(color) is part of a
> procedure or function and I
did not find any problems with them. I am going
> to post the formula in
the library. Go there and "download" the file to
> avoid line wrapping.
Hopefully it will be successful.
> >
> > David K.
>
> --- In amibroker@xxxxxxxxxps.com,
"Vinay Gakkhar." <vgakkhar@> wrote:
> >>
> >>
Dear David K.
> >>
> >> When I tried your exploration
on my system, I could not get the graph are
> rather got error messages
as follows:
> >>
> >> 1) A few syntax error messages
(Ln: 42, Col: 16 ; Error 30, Syntax
> error), the first one at the
line:
> >> GfxSetTextColor(color);
> >>
>
>> 2) A message saying "variable 'gtet' used without having been
initiated"
> >>
> >> Please rectify the exploration
and repost it.
> >>
> >> vinay
>
>>
> >>
> >> On Fri, 04 Dec 2009 23:20:23 +0530,
wooziwog <xcitemint@> wrote:
> >>
> >> >
Reinsley,
> >> >
> >> > Thanks for the feedback.
Replace your copy with the code below and
> >> > you will not
receive the message. The "Plot Shapes" is for
> >> > plotting
starts at the Highs and Lows of the various pivots - I
> >> >
have never used it so I can't be sure that all is right. The error
>
>> > message you received was due to the fact that the arrays were
not
> >> > turned on when the plot shapes was turned on. To
minimize
> >> > execution time on my intraday charts I avoid
executing the arrays
> >> > when the lines or text are not
being used. Now the arrays will
> >> > also be processed when
plot shapes are turned on. I have not tested
> >> > the shapes
plot yet - it is supposed to plot stars at the highs and
> >>
> lows of the various time frames. Let me know how it works :-)
>
>> >
> >> >
> >> > David K.
>
>> >
> >> >
> >> >
//======================
> >> >
_SECTION_BEGIN("Chart Settings");
> >> >
//======================
> >> >
SetChartOptions(0, chartShowDates);
> >> >
SetChartBkColor(1);
> >> >
GraphXSpace=Param("GraphXSpace",15,0,300,1);
> >>
> dec= IIf(StrRight(Name(),3) == "", 3.2, 3.2);
> >> >
bc = BarCount-1;
> >> > bi = BarIndex();
> >> >
Lbi = LastValue(bi);
> >> > sbi =
SelectedValue(BarIndex());
> >> > tn =
TimeNum();
> >> >
Plot(C,"",IIf(C>O,34,IIf(C<O,32,55)),128,4);
>
>> > //======================
> >> >
pxchartright = Status("pxChartRight");//returns y-coordinate of
>
>> > top-left corner //======================
_SECTION_BEGIN("GFX X
> >> > Conversion");
>
>> > function tpX(bar) {
> >> > lvb =
Status("LastVisibleBar");
> >> > fvb =
Status("FirstVisibleBar");
> >> > pxchartleft =
Status("pxChartLeft");
> >> > pxchartright =
Status("pxChartRight");
> >> > pxheight =
Status("pxheight");
> >> > pxchartwidth =
Status("pxChartWidth");
> >> > return
pxchartleft+(bar-fvb)*pxchartwidth/(Lvb-fvb+1); }
>
>> > _SECTION_END(); //======================
_SECTION_BEGIN("GFX Y
> >> > Conversion");
>
>> > function tPY(Value) {
> >> > local Miny, Maxy,
pxchartbottom, pxchartheight;
> >> > Miny =
Status("AxisMiny");
> >> > Maxy =
Status("AxisMaxy");
> >> > pxchartbottom =
Status("pxChartBottom");
> >> > pxchartheight =
Status("pxChartHeight");
> >> > return pxchartbottom -
floor(0.5
> >> >
+(Value-Miny)*pxchartheight/(Maxy-Miny)); }
_SECTION_END();
> >> > //======================
_SECTION_BEGIN("GFX Text+Label, GFX Y, Std
> >> > X");
//======================
> >> > dec=0; ha=0;
>
>> > procedure gtx(val,color,string,xpos) {
> >>
> GfxSetTextColor(color);
> >> >
gtext=GfxDrawText(NumToStr(val,dec)+"-"+
> >> >
StrExtract(string,0)+"
>
",xpos,tpY(SelectedValue(val))+ha,0,0,256);
> >>
> return gtext; }
> >> > _SECTION_END();
>
>> > //======================
> >> >
_SECTION_BEGIN("Plot Shapes");
> >> >
//======================
> >> > procedure
plshp(x,y,shape,color,shift)
> >> > {
PlotShapes(IIf(BarIndex()==x,shape,0),color,0,y,shift);
}
> >> > //===========================
>
>> > lls=0; sln=0;
> >> > procedure
hrplt(tf,value,color,sty,shf) {
> >> >
Lin=LineArray(Lbi-lls-shf,LastValue(value),
> >>
> Lbi+shf,LastValue(value),1);
> >> > Plot(IIf(tf
AND sln==0,value,Null),"",color,sty,0,0,shf);
> >>
> Plot(IIf(sln==1,Lin,Null),"",color,sty,0,0,shf); }
> >> > //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //Time and
Dates
> >> > begD = DateNum() != Ref(DateNum(),-1);//Begin
New Day
> >> > fboD =
LastValue(ValueWhen(begD,bi,1));//First Bar of Day
> >>
> endD = DateNum() != Ref(DateNum(), 1);//End of Day
> >>
> lboD = LastValue(ValueWhen(endD,bi,1));//Last Bar of
Day
> >> > lbpd =
LastValue(ValueWhen(begD,bi,2)-1);//Last Bar of Previous Day
>
>> > tday = DateNum()==LastValue(DateNum(),1);//Includes
current fbod to
> future lbod
> >> > pdaz=
ValueWhen(begD,Ref(DateNum(),-1),1);//All bars prior to
>
existing lbod
> >> > prdaz=pdaz AND NOT tday;
> >>
> notda= NOT tday;
> >> >
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> >> >
_SECTION_BEGIN("Intraday Time Pivots");
> >> >
//===============================
> >> > ipv =
ParamList("Sup Res
>
Pivots","Off|All|Calculate|OHLC|Lines|Labels",3);
>
>> > psh= ParamToggle("Plot Shapes", "Off|On",0);
>
>> > htx = Param("Text Shift",18,-200,150,1);
> >>
> sln= ParamToggle("Short Lines", "Off|On",1);
> >> >
lls = Param("Short Line Length",3,0,500,1)*10;
> >> > shf
= Param("Shift Line Right",2,0,50,1);
> >> > rsc =
ParamToggle("No Rescale","Off|On",1);
> >> > sty =
ParamStyle("Style",4096);
> >> > optn= Param("Market
Open",93000,00000,235959,000500);
> >> > cltn=
Param("Market Close",161500,00000,235959,000500);
> >>
> plsi= Param("Start
Plotting",083000,00000,240000,000500);
> >> > plei=
Param("End Plotting",161500,00000,240000,000500);
> >>
> //===================
> >> > function
tvy(tstart,tframe,array) {
> >> > if(array==1)y
=
>
ValueWhen(tframe,HighestSince(Cross(tn,tstart),H),1);
>
>> > if(array==2)y =
>
ValueWhen(tframe,LowestSince(Cross(tn,tstart),L),1);
>
>> > y0=IIf(y>0,y,Null);
> >> > return y0;
}
> >> > //======================
> >>
> function xbar(tstart,tframe,array) {
> >> >
if(array==1) {
> >> >
>
y=ValueWhen(tframe,HighestSince(Cross(tn,tstart),H),1);
>
>> > x=BarIndex()==ValueWhen(tframe AND H==y,bi);
>
>> > x0=bc-LastValue(BarsSince(x>0),1); }
>
>> > if(array==2) {
> >> >
>
y=ValueWhen(tframe,LowestSince(Cross(tn,tstart),L),1);
>
>> > x=bi==ValueWhen(tframe AND L==y,bi);
> >> >
x0=bc-BarsSince(x>0); }
> >> > return x0; }
>
>> > //==============
> >> > if(ipv=="All" OR
ipv=="Calculate" OR ipv=="Lines" OR ipv=="Labels"
> OR ipv=="OHLC" OR
psh==1) {
> >> > pmtn = optn-010000; premkt = tn >= pmtn AND
tn <= optn;
> >> > mk05 = optn+000500; tfrm05 = tn>=optn
AND tn<= mk05;
> >> > mk15 = optn+001500; tfrm15 =
tn>=optn AND tn<= mk15;
> >> > mk30 = optn+003000; tfrm30
= tn>=optn AND tn<= mk30;
> >> > mk45 = optn+004500;
tfrm45 = tn>=optn AND tn<= mk45;
> >> > mk60 =
optn+010000; tfrm60 = tn>=optn AND tn<= mk60;
> >> > mkss
= 110000;
> >> > mkse = 133000; tfrslo = tn>=mkss AND
tn<= mkse;
> >> > va30 = 154500; tfva30 = tn>=va30 AND
tn<= cltn;
> >> > va2h = cltn-020000; tf2hrs = tn>=va2h
AND tn<= cltn;
> >> > mktHrs = tn>=optn AND tn<=
cltn;
> >> > pltval = tn>=plsi AND tn<= va2h;
>
>> > //======================
> >> >
>
>> > cyHi = HighestSince(bi==fbod,H);
> >> >
cxHi = ValueWhen(tday AND H==cyHi,bi);
> >> > cyLo =
LowestSince(bi==fbod,L);
> >> > cxLo = ValueWhen(tday
AND L==cyLo,bi);
> >> > pyHi =
ValueWhen(prdaz,HighestSince(bi==lbpd,H),1);
> >>
> pxHi = ValueWhen(H==pyHi AND NOT tday ,bi);
> >> >
pyLo = ValueWhen(prdaz,LowestSince(bi==lbpd,L),1);
>
>> > pxLo = ValueWhen(L==pyLo AND NOT tday,bi);
> >>
> mkOp = ValueWhen(Cross(tn,cltn),O,1);
> >> >
xmOp = bc-BarsSince(Cross(tn,optn)>0);
> >> > mkCl
= ValueWhen(Cross(TimeNum(),160000),C);
> >> >
xmCL = bc-BarsSince(Cross(TimeNum(),160000)>0);
>
>> > xpmk = bc-BarsSince(Cross(tn,optn)>0);
>
//======================
> >> >
poHi=tvy(pmtn,premkt,1); poLo=tvy(pmtn,premkt,2);
>
>> > mkHi=tvy(optn,mktHrs,1);
mkLo=tvy(optn,mktHrs,2);
> >> >
Hi05=tvy(optn,tfrm05,1); Lo05=tvy(optn,tfrm05,2);
>
>> > Hi15=tvy(optn,tfrm15,1);
Lo15=tvy(optn,tfrm15,2);
> >> >
Hi30=tvy(optn,tfrm30,1); Lo30=tvy(optn,tfrm30,2);
>
>> > Hi60=tvy(optn,tfrm60,1);
Lo60=tvy(optn,tfrm60,2);
> >> >
vH2h=tvy(va2h,tf2hrs,1); vL2h=tvy(va2h,tf2hrs,2)