Hello ,

I wish to draw a segment line AFTER that 2 MA have crossed .
For the instant I have draw 3 lines but before the crossing point . 

My idea is to extend to the right the resistance's line until she is
reaching the price's curve .

Thanks …

Here is my code

aire1 = WMA(C,150);
aire2 = MA(C,260);

Croisement = 0 ;
bi = BarIndex();
beforebar =0 ;
barnum = 0;
barvalue=0 ;

periode = Param("Période choisie",160,1,720,1);
barnum = IIf( Cross(WMA(C,150),MA(C,260))== 1,int(bi),False);  
beforebar = IIf(Cross(WMA(C,150),MA(C,260))== 1,int(bi) -periode,False);  
barvalue =  IIf(Cross(WMA(C,150),MA(C,260))== 1 ,
ValueWhen(Cross(WMA(C,150),MA(C,260)),WMA(C,150)),False);
resist = IIf(Cross(WMA(C,150),MA(C,260))== 1 , HHV(High,periode),False);

support = IIf(Cross(WMA(C,150),MA(C,260))== 1 , LLV(Low,periode),False);
 

yresist = 0 ;
ysupport = 0 ;
prixlimite = 0;
resistance =0;

for(i=periode;i<BarCount -1 ;i++)
{
if (barnum[i] != 0 AND barvalue[i] != 0) 
{
x0 = beforebar[i];
y0 = barvalue[i];
x1 = barnum[i];
y1 = y0;

fondations =LineArray(x0,y0,x1,y1,0);  
Plot( fondations , "Kind of support", colorRed);
PlotText("FONDATIONS",x0,y0,colorGreen);
yresist =resist[i];
resistance =LineArray(x0,yresist,x1,yresist,0);  
Plot( resistance, "RESISTANCE", colorRed);
PlotText("Résistance = "+ yresist,x0,yresist,colorGreen);

prixlimite = resist[i]+ 0.25 ;     
ysupport =support[i];
supportfinal =LineArray(x0,ysupport,x1,ysupport,0);  
Plot( supportfinal, "SUPPORT", colorRed);
PlotText("Support ="+ ysupport,x0,ysupport,colorGreen);

}
}

/*while (C < resist)
{
x0 = afterbar[i];   // how to say AFTER the crossing bar ?
y0 = barvalue[i];
x1 = barnum[i];
y1 = y0;

yresist =resist[i];
resistance =LineArray(x1,yresist,x0,yresist,0);  
Plot( resistance, "RESISTANCE", colorRed);
barnum++ ;
}*/


Reply via email to