AFL help needed to plot lines

Raghuveer

Well-Known Member
#21
Hello ,
According to ST concept ,
Gap is when , HL is greater then second HH !!!
see image [1] based on 5 min [2] as per hourly chart

* i have to delete previous images , because my uploading limit is very low
thank you
In uptrend: HL is greater than immediate previous HH. In other words for ST's gap to exist HH must be followed by a HL such that HH<HL.

In downtrend: LL must be followed by LH such that LL>LH.
NF hourly chart: on 10/12/2014 10am LL formed. Immediate next pivot high (LH) was on 11/12 3pm. in this case LL>LH fails, so there is no gap.

Thanks.
 

casoni

Well-Known Member
#22
Hello Raghuveer, amitrandive and everyone who is interested in this concept :)

Lets start Analyzing, ST concept with this formula , will Take TD pivot point afterwords

// E.M.Pottasch
SetBarsRequired(sbrAll,sbrAll);
x=BarIndex();Lx=LastValue(x);

rightStrength=Param("Fractal Pivot Right side Strength",3,0,50,1);
leftStrength=Param("Fractal Pivot Left side Strength",4,0,50,1);
pk=H>Ref(HHV(H,leftStrength),-1) AND Ref(HHV(H,rightStrength),rightStrength)<=H;
tr=L<Ref(LLV(L,leftStrength),-1) AND Ref(LLV(L,rightStrength),rightStrength)>=L;
PHigh = PK;
PHighPrice0 = ValueWhen(PHigh,H);
PHighPrice1 = IIf(PHighPrice0 AND BarsSince(PHigh) > rightStrength,PHighPrice0,Null);
PHighPrice2 = IIf(PHighPrice0 AND BarsSince(PHigh) <= rightStrength,PHighPrice0,Null);
PLow = TR;
PLowPrice0 = ValueWhen(PLow,L);
PLowPrice1 = IIf(PLowPrice0 AND BarsSince(Plow) > rightStrength,PLowPrice0,Null);
PLowPrice2 = IIf(PLowPrice0 AND BarsSince(Plow) <= rightStrength,PLowPrice0,Null);

//pk=ExRem(pk,tr);
//tr=ExRem(tr,pk);

px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);

ll=tr AND tl1<tl2;
hl=tr AND tl1>tl2;
hh=pk AND ph1>ph2;
lh=pk AND ph1<ph2;
dt=pk AND ph1==ph2;
db=tr AND tl1==tl2;

ll_h=IIf(ll,1,0);
hl_h=IIf(hl,2,0);
hh_h=IIf(hh,3,0);
lh_h=IIf(lh,4,0);
dt_h=IIf(dt,5,0);
db_h=IIf(db,6,0);
combi=ll_h+hl_h+lh_h+hh_h;

t0=ValueWhen(combi,combi,0);
t1=ValueWhen(combi,combi,1);
t2=ValueWhen(combi,combi,2);
t3=ValueWhen(combi,combi,3);
t4=ValueWhen(combi,combi,4);

GraphXSpace = 5;
SetChartOptions(0, chartShowDates);
Plot(C,"\nLast",colorWhite,64);

PlotShapes(shapeSmallCircle*tr,IIf(Lx-ValueWhen(tr,x)>=rightStrength,ColorRGB(0,100,0),colorWhite),0,L,-10);
PlotShapes(shapeSmallCircle*pk,IIf(Lx-ValueWhen(pk,x)>=rightStrength,ColorRGB(255,0,0),colorWhite),0,H,10);

Plot(PHighPrice1,"\nPHighPrice",colorOrange,styleLine);
Plot(PHighPrice2,"",colorOrange,styleDots | styleNoLine);
Plot(PLowPrice1,"\nPLowPrice",colorBrightGreen,styleLine);
Plot(PLowPrice2,"",colorBrightGreen,styleDots | styleNoLine);

PH =Phigh- Ref(Phigh,-1) != 0;
PHprice = ValueWhen(PH, H,1);
Pvalid = C > ValueWhen(PH, PHighPrice2,1 ) ;
Pvalid = ExRem(Pvalid, PH);
Buy=Cover=Pvalid ;

PL= Plow - Ref(Plow,-1) != 0;
PLPrice = ValueWhen(PL,L,1);
TValid = C < ValueWhen(PL, PLowPrice2,1) ;
TValid = ExRem(TValid, PL);
Sell=Short= TValid ;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

PlotShapes(IIf(Buy , shapeSmallUpTriangle, shapeNone) ,colorGreen, 0,L,-30);
PlotShapes(IIf(Short , shapeSmallDownTriangle, shapeNone) ,colorRed, 0,H,-30);
PlotShapes(IIf( Cover, shapeHollowSmallUpTriangle, shapeNone) ,colorPink, 0,L,-25);
PlotShapes(IIf( Sell, shapeHollowSmallDownTriangle, shapeNone) ,colorOrange, 0,H,-25);


Title = Name() + " # " +Date() +
"\nRight Bars: " + rightStrength +
"\nLeft Bars : " + leftStrength;

abcdy_up=32;
abcdy_dn=20;
function GetVisibleBarCount()
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
return Min(lvb-fvb,BarCount-fvb);
}
function GfxConvertPixelsToBarX(Pixels)
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
pxchartleft=Status("pxchartleft");
pxchartwidth=Status("pxchartwidth");
fac=pxchartwidth/Pixels;
bar=(lvb-fvb)/fac;
return Nz(bar);
}
function GfxConvertPixelToValueY(Pixels)
{
local Miny,Maxy,pxchartbottom,pxchartheight;
Miny=Status("axisminy");
Maxy=Status("axismaxy");
pxchartbottom=Status("pxchartbottom");
pxchartheight=Status("pxchartheight");
fac=pxchartheight/Pixels;
Value=(Maxy-Miny)/fac;
return Nz(Value);
}
function GfxConvertBarToPixelX(bar)
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
pxchartleft=Status("pxchartleft");
pxchartwidth=Status("pxchartwidth");
return Nz(pxchartleft+bar*pxchartwidth/(lvb-fvb+1));
}
function GfxConvertValueToPixelY(value)
{
local Miny,Maxy,pxchartbottom,pxchartheight;
Miny=Status("axisminy");
Maxy=Status("axismaxy");
pxchartbottom=Status("pxchartbottom");
pxchartheight=Status("pxchartheight");
return Nz(pxchartbottom-floor(0.5+(Value-Miny)*pxchartheight/(Maxy-Miny)));
}
AllVisibleBars=GetVisibleBarCount();
fvbx=Status("firstvisiblebar");
abcdy_up=GfxConvertPixelToValueY(abcdy_up);
abcdy_dn=GfxConvertPixelToValueY(abcdy_dn);

Labels = ParamToggle("Plot HH-LL","No|Yes" ,1);
for(i=0;i<AllVisibleBars;i++)
{ GfxSelectFont("Tahoma",8,500); GfxSetBkMode(1);


if(ll[i+fvbx]AND Labels )
{
lvix=i+fvbx;
GfxSetTextColor(colordarkYellow);GfxTextOut("LL",
GfxConvertBarToPixelX(i)-3,GfxConvertValueToPixelY(L[lvix]-abcdy_dn-3));
}
if(hl[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorYellow);GfxTextOut("HL",
GfxConvertBarToPixelX(i)-3,GfxConvertValueToPixelY(L[lvix]-abcdy_dn-3));
}

if(hh[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorYellow);GfxTextOut("HH",
GfxConvertBarToPixelX(i)-5,GfxConvertValueToPixelY(H[lvix]+abcdy_up+3));
}
if(lh[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colordarkYellow);GfxTextOut("LH",
GfxConvertBarToPixelX(i)-5,GfxConvertValueToPixelY(H[lvix]+abcdy_up+3));
}
if(dt[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorOrange);GfxTextOut("DT",
GfxConvertBarToPixelX(i)-5,GfxConvertValueToPixelY(H[lvix]+abcdy_up+3));
}
if(db[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorwhite);GfxTextOut("DB",
GfxConvertBarToPixelX(i)-3,GfxConvertValueToPixelY(L[lvix]-abcdy_dn-3));
}

}
 

Raghuveer

Well-Known Member
#23
Thanks casoni. yes, TD points can be taken later.
Some observations are below.

We must be able to specify in parameters how much is the minimum gap. e.g 10 points or 0.0001%.

Whatever "Fractal Pivot Strength" we choose from parameters, if condition of minimum gap fails then no lines/markings must be there.

For example in sideways (in oval below) no lines/markings must be there:


In downtrend gap condition (LL>LH) fails in oval, so no lines/markings must be there for pivots inside oval:
:

Where ever minimum gap clearly does not exist, lines/markings must not be there.

Hello Raghuveer, amitrandive and everyone who is interested in this concept :)

Lets start Analyzing, ST concept with this formula , will Take TD pivot point afterwords
 

mastermind007

Well-Known Member
#24
Hello Raghuveer, amitrandive and everyone who is interested in this concept :)

Lets start Analyzing, ST concept with this formula , will Take TD pivot point afterwords

// E.M.Pottasch
SetBarsRequired(sbrAll,sbrAll);
x=BarIndex();Lx=LastValue(x);

rightStrength=Param("Fractal Pivot Right side Strength",3,0,50,1);
leftStrength=Param("Fractal Pivot Left side Strength",4,0,50,1);
pk=H>Ref(HHV(H,leftStrength),-1) AND Ref(HHV(H,rightStrength),rightStrength)<=H;
tr=L<Ref(LLV(L,leftStrength),-1) AND Ref(LLV(L,rightStrength),rightStrength)>=L;
PHigh = PK;
PHighPrice0 = ValueWhen(PHigh,H);
PHighPrice1 = IIf(PHighPrice0 AND BarsSince(PHigh) > rightStrength,PHighPrice0,Null);
PHighPrice2 = IIf(PHighPrice0 AND BarsSince(PHigh) <= rightStrength,PHighPrice0,Null);
PLow = TR;
PLowPrice0 = ValueWhen(PLow,L);
PLowPrice1 = IIf(PLowPrice0 AND BarsSince(Plow) > rightStrength,PLowPrice0,Null);
PLowPrice2 = IIf(PLowPrice0 AND BarsSince(Plow) <= rightStrength,PLowPrice0,Null);

//pk=ExRem(pk,tr);
//tr=ExRem(tr,pk);

px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);

ll=tr AND tl1<tl2;
hl=tr AND tl1>tl2;
hh=pk AND ph1>ph2;
lh=pk AND ph1<ph2;
dt=pk AND ph1==ph2;
db=tr AND tl1==tl2;

ll_h=IIf(ll,1,0);
hl_h=IIf(hl,2,0);
hh_h=IIf(hh,3,0);
lh_h=IIf(lh,4,0);
dt_h=IIf(dt,5,0);
db_h=IIf(db,6,0);
combi=ll_h+hl_h+lh_h+hh_h;

t0=ValueWhen(combi,combi,0);
t1=ValueWhen(combi,combi,1);
t2=ValueWhen(combi,combi,2);
t3=ValueWhen(combi,combi,3);
t4=ValueWhen(combi,combi,4);

GraphXSpace = 5;
SetChartOptions(0, chartShowDates);
Plot(C,"\nLast",colorWhite,64);

PlotShapes(shapeSmallCircle*tr,IIf(Lx-ValueWhen(tr,x)>=rightStrength,ColorRGB(0,100,0),colorWhite),0,L,-10);
PlotShapes(shapeSmallCircle*pk,IIf(Lx-ValueWhen(pk,x)>=rightStrength,ColorRGB(255,0,0),colorWhite),0,H,10);

Plot(PHighPrice1,"\nPHighPrice",colorOrange,styleLine);
Plot(PHighPrice2,"",colorOrange,styleDots | styleNoLine);
Plot(PLowPrice1,"\nPLowPrice",colorBrightGreen,styleLine);
Plot(PLowPrice2,"",colorBrightGreen,styleDots | styleNoLine);

PH =Phigh- Ref(Phigh,-1) != 0;
PHprice = ValueWhen(PH, H,1);
Pvalid = C > ValueWhen(PH, PHighPrice2,1 ) ;
Pvalid = ExRem(Pvalid, PH);
Buy=Cover=Pvalid ;

PL= Plow - Ref(Plow,-1) != 0;
PLPrice = ValueWhen(PL,L,1);
TValid = C < ValueWhen(PL, PLowPrice2,1) ;
TValid = ExRem(TValid, PL);
Sell=Short= TValid ;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

PlotShapes(IIf(Buy , shapeSmallUpTriangle, shapeNone) ,colorGreen, 0,L,-30);
PlotShapes(IIf(Short , shapeSmallDownTriangle, shapeNone) ,colorRed, 0,H,-30);
PlotShapes(IIf( Cover, shapeHollowSmallUpTriangle, shapeNone) ,colorPink, 0,L,-25);
PlotShapes(IIf( Sell, shapeHollowSmallDownTriangle, shapeNone) ,colorOrange, 0,H,-25);


Title = Name() + " # " +Date() +
"\nRight Bars: " + rightStrength +
"\nLeft Bars : " + leftStrength;

abcdy_up=32;
abcdy_dn=20;
function GetVisibleBarCount()
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
return Min(lvb-fvb,BarCount-fvb);
}
function GfxConvertPixelsToBarX(Pixels)
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
pxchartleft=Status("pxchartleft");
pxchartwidth=Status("pxchartwidth");
fac=pxchartwidth/Pixels;
bar=(lvb-fvb)/fac;
return Nz(bar);
}
function GfxConvertPixelToValueY(Pixels)
{
local Miny,Maxy,pxchartbottom,pxchartheight;
Miny=Status("axisminy");
Maxy=Status("axismaxy");
pxchartbottom=Status("pxchartbottom");
pxchartheight=Status("pxchartheight");
fac=pxchartheight/Pixels;
Value=(Maxy-Miny)/fac;
return Nz(Value);
}
function GfxConvertBarToPixelX(bar)
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
pxchartleft=Status("pxchartleft");
pxchartwidth=Status("pxchartwidth");
return Nz(pxchartleft+bar*pxchartwidth/(lvb-fvb+1));
}
function GfxConvertValueToPixelY(value)
{
local Miny,Maxy,pxchartbottom,pxchartheight;
Miny=Status("axisminy");
Maxy=Status("axismaxy");
pxchartbottom=Status("pxchartbottom");
pxchartheight=Status("pxchartheight");
return Nz(pxchartbottom-floor(0.5+(Value-Miny)*pxchartheight/(Maxy-Miny)));
}
AllVisibleBars=GetVisibleBarCount();
fvbx=Status("firstvisiblebar");
abcdy_up=GfxConvertPixelToValueY(abcdy_up);
abcdy_dn=GfxConvertPixelToValueY(abcdy_dn);

Labels = ParamToggle("Plot HH-LL","No|Yes" ,1);
for(i=0;i<AllVisibleBars;i++)
{ GfxSelectFont("Tahoma",8,500); GfxSetBkMode(1);


if(ll[i+fvbx]AND Labels )
{
lvix=i+fvbx;
GfxSetTextColor(colordarkYellow);GfxTextOut("LL",
GfxConvertBarToPixelX(i)-3,GfxConvertValueToPixelY(L[lvix]-abcdy_dn-3));
}
if(hl[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorYellow);GfxTextOut("HL",
GfxConvertBarToPixelX(i)-3,GfxConvertValueToPixelY(L[lvix]-abcdy_dn-3));
}

if(hh[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorYellow);GfxTextOut("HH",
GfxConvertBarToPixelX(i)-5,GfxConvertValueToPixelY(H[lvix]+abcdy_up+3));
}
if(lh[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colordarkYellow);GfxTextOut("LH",
GfxConvertBarToPixelX(i)-5,GfxConvertValueToPixelY(H[lvix]+abcdy_up+3));
}
if(dt[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorOrange);GfxTextOut("DT",
GfxConvertBarToPixelX(i)-5,GfxConvertValueToPixelY(H[lvix]+abcdy_up+3));
}
if(db[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorwhite);GfxTextOut("DB",
GfxConvertBarToPixelX(i)-3,GfxConvertValueToPixelY(L[lvix]-abcdy_dn-3));
}

}

Casoni

I've highlighted the code that gives future reference errors. There are four corrections spotted by me thus far.

First one SetBarsRequired may be commented out

Second one may also be commented out and two references to Lx may be replaced with x.

Third and fourth are for Ref statements and second parameter needs to be negative. so it should be Ref(..., -rightStrength) on both lines
 

mastermind007

Well-Known Member
#27
Hello Mastermind,
please correct the formula , after then we procced .
Thank you
I had not corrected the code first time just in case you too had made any changes. Anyway, attached here is the code that will no longer give future-reference error.

Code:
_SECTION_BEGIN("SMART TRADE ZONES"); 
x=BarIndex();
rightStrength=Param("Fractal Pivot Right side Strength",3,0,50,1); 
leftStrength=Param("Fractal Pivot Left side Strength",4,0,50,1); 
pk=H>Ref(HHV(H,leftStrength),-1) AND Ref(HHV(H,rightStrength),-rightStrength)<=H;
tr=L<Ref(LLV(L,leftStrength),-1) AND Ref(LLV(L,rightStrength),-rightStrength)>=L;
PHigh = PK;
PHighPrice0 = ValueWhen(PHigh,H);
PHighPrice1 = IIf(PHighPrice0 AND BarsSince(PHigh) > rightStrength,PHighPrice0,Null);
PHighPrice2 = IIf(PHighPrice0 AND BarsSince(PHigh) <= rightStrength,PHighPrice0,Null);
PLow = TR;
PLowPrice0 = ValueWhen(PLow,L); 
PLowPrice1 = IIf(PLowPrice0 AND BarsSince(Plow) > rightStrength,PLowPrice0,Null);
PLowPrice2 = IIf(PLowPrice0 AND BarsSince(Plow) <= rightStrength,PLowPrice0,Null);

//pk=ExRem(pk,tr);
//tr=ExRem(tr,pk);

px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);

ll=tr AND tl1<tl2;
hl=tr AND tl1>tl2;
hh=pk AND ph1>ph2;
lh=pk AND ph1<ph2;
dt=pk AND ph1==ph2;
db=tr AND tl1==tl2;

ll_h=IIf(ll,1,0);
hl_h=IIf(hl,2,0);
hh_h=IIf(hh,3,0);
lh_h=IIf(lh,4,0);
dt_h=IIf(dt,5,0);
db_h=IIf(db,6,0);
combi=ll_h+hl_h+lh_h+hh_h;

t0=ValueWhen(combi,combi,0);
t1=ValueWhen(combi,combi,1);
t2=ValueWhen(combi,combi,2);
t3=ValueWhen(combi,combi,3);
t4=ValueWhen(combi,combi,4);

GraphXSpace = 5;
SetChartOptions(0, chartShowDates);
Plot(C,"\nLast",colorWhite,64);

PlotShapes(shapeSmallCircle*tr,IIf(x-ValueWhen(tr,x)>=rightStrength,ColorRGB(0,100,0),colorWhite),0,L,-10);
PlotShapes(shapeSmallCircle*pk,IIf(x-ValueWhen(pk,x)>=rightStrength,ColorRGB(255,0,0),colorWhite),0,H,10);

Plot(PHighPrice1,"\nPHighPrice",colorOrange,styleLine);
Plot(PHighPrice2,"",colorOrange,styleDots | styleNoLine);
Plot(PLowPrice1,"\nPLowPrice",colorBrightGreen,styleLine);
Plot(PLowPrice2,"",colorBrightGreen,styleDots | styleNoLine);

PH =Phigh- Ref(Phigh,-1) != 0; 
PHprice = ValueWhen(PH, H,1);
Pvalid = C > ValueWhen(PH, PHighPrice2,1 ) ;
Pvalid = ExRem(Pvalid, PH);
Buy=Cover=Pvalid ; 

PL= Plow - Ref(Plow,-1) != 0;
PLPrice = ValueWhen(PL,L,1);
TValid = C < ValueWhen(PL, PLowPrice2,1) ;
TValid = ExRem(TValid, PL);
Sell=Short= TValid ;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

PlotShapes(IIf(Buy , shapeSmallUpTriangle, shapeNone) ,colorGreen, 0,L,-30); 
PlotShapes(IIf(Short , shapeSmallDownTriangle, shapeNone) ,colorRed, 0,H,-30);
PlotShapes(IIf( Cover, shapeHollowSmallUpTriangle, shapeNone) ,colorPink, 0,L,-25);
PlotShapes(IIf( Sell, shapeHollowSmallDownTriangle, shapeNone) ,colorOrange, 0,H,-25);


Title = Name() + " # " +Date() +
"\nRight Bars: " + rightStrength + 
"\nLeft Bars : " + leftStrength;

abcdy_up=32;
abcdy_dn=20;
function GetVisibleBarCount()
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
return Min(lvb-fvb,BarCount-fvb);
}
function GfxConvertPixelsToBarX(Pixels)
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
pxchartleft=Status("pxchartleft");
pxchartwidth=Status("pxchartwidth");
fac=pxchartwidth/Pixels;
bar=(lvb-fvb)/fac;
return Nz(bar);
}
function GfxConvertPixelToValueY(Pixels)
{
local Miny,Maxy,pxchartbottom,pxchartheight;
Miny=Status("axisminy");
Maxy=Status("axismaxy");
pxchartbottom=Status("pxchartbottom");
pxchartheight=Status("pxchartheight");
fac=pxchartheight/Pixels;
Value=(Maxy-Miny)/fac;
return Nz(Value);
}
function GfxConvertBarToPixelX(bar)
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
pxchartleft=Status("pxchartleft");
pxchartwidth=Status("pxchartwidth");
return Nz(pxchartleft+bar*pxchartwidth/(lvb-fvb+1));
}
function GfxConvertValueToPixelY(value)
{
local Miny,Maxy,pxchartbottom,pxchartheight;
Miny=Status("axisminy");
Maxy=Status("axismaxy");
pxchartbottom=Status("pxchartbottom");
pxchartheight=Status("pxchartheight");
return Nz(pxchartbottom-floor(0.5+(Value-Miny)*pxchartheight/(Maxy-Miny)));
}
AllVisibleBars=GetVisibleBarCount();
fvbx=Status("firstvisiblebar");
abcdy_up=GfxConvertPixelToValueY(abcdy_up);
abcdy_dn=GfxConvertPixelToValueY(abcdy_dn);

Labels = ParamToggle("Plot HH-LL","No|Yes" ,1); 
for(i=0;i<AllVisibleBars;i++)
{ GfxSelectFont("Tahoma",8,500); GfxSetBkMode(1);


if(ll[i+fvbx]AND Labels )
{
lvix=i+fvbx;
GfxSetTextColor(colorDarkYellow);GfxTextOut("LL",
GfxConvertBarToPixelX(i)-3,GfxConvertValueToPixelY(L[lvix]-abcdy_dn-3)); 
}
if(hl[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorYellow);GfxTextOut("HL",
GfxConvertBarToPixelX(i)-3,GfxConvertValueToPixelY(L[lvix]-abcdy_dn-3)); 
} 

if(hh[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorYellow);GfxTextOut("HH",
GfxConvertBarToPixelX(i)-5,GfxConvertValueToPixelY(H[lvix]+abcdy_up+3)); 
} 
if(lh[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorDarkYellow);GfxTextOut("LH",
GfxConvertBarToPixelX(i)-5,GfxConvertValueToPixelY(H[lvix]+abcdy_up+3)); 
} 
if(dt[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorOrange);GfxTextOut("DT",
GfxConvertBarToPixelX(i)-5,GfxConvertValueToPixelY(H[lvix]+abcdy_up+3)); 
} 
if(db[i+fvbx] AND Labels)
{
lvix=i+fvbx;
GfxSetTextColor(colorWhite);GfxTextOut("DB",
GfxConvertBarToPixelX(i)-3,GfxConvertValueToPixelY(L[lvix]-abcdy_dn-3)); 
} 

}
_SECTION_END();
 

Raghuveer

Well-Known Member
#30
Thanks casoni.
ST gap between B and E has been marked.
ST gap between D and G needs to be marked.

Also PL's and PH's which do not have ST gap must not have any lines/markings.

Am i going in right diection !!
kindly confirm
 

Similar threads