Title = EncodeColor(4)+ _DEFAULT_NAME()+";
"+EncodeColor(1) + StrFormat("{{NAME}} -
{{INTERVAL}}; {{DATE}}; O=%g, H=%g, L=%g, C=%g (%.1f%%)
{{VALUES}}", O, H, L, C,
SelectedValue( ROC( C, 1 ) ) );
PrefSol=ParamToggle("Display
Preferred Solution","No|Yes",1);// Default: manual
Dual_Single_Plot=ParamToggle("Dual|Single
Plot","Dual|Single",0);// Default: manual
//MA14Shift=Param("MA14Shift-PlotColor",0.00003,0,1,0.00001);//Forex
values
MA14Shift=Param("MA14Shift-PlotColor",3,0,10,1)/100000;//Forex values
MASlopeShift=Param("MASlopeShift-PlotColor",3,0,10,1)/100000;//Forex values
MA14=MA(C,14);
MASlope= MA(C,14)-MA(Ref(C,-1),14);
PlotColor=IIf(MASlope<=0,colorGreen,4);
//========Preferred Solution 1:PlotColor
>
if(PrefSol)
{
Plot(MA14+MA14Shift,"\nMA14
With PlotColor", PlotColor, styleLeftAxisScale|styleThick); //typically the
best solution
Plot(MASlope+MASlopeShift, "MASlope
With PlotColor", PlotColor, styleThick);//===========Different
Styles===========
}
//========Preferred Solution 2:
Continuous Lines; Preferred Solution: Less discontinuity========================
Plot(IIf(MASlope> 0, MA14,Null
), "\nMA14
- MASlope Pos", PlotColor, styleLeftAxisScale|styleThick);
Plot(IIf(MASlope> 0, MASlope, Null),
"MASlope
Pos", colorViolet, styleThick);
Plot(0,"",1,5);
if(!Dual_Single_Plot) //Continuous
Lines;
{
Plot(IIf(MASlope<= 0, MA14, MA14), "\nMA14 -
MASlope Neg", PlotColor, styleLeftAxisScale|styleDashed); //Null replaced
by value
Plot(IIf(MASlope<= 0,
MASlope,MASlope), "MASlope Neg", colorBlue, styleDashed);
//Null
replaced by value
}
//========Solution 3: Discontinous
Lines========================
else
{
Plot(IIf(MASlope<= 0, MA14, Null),
"\nMA14
- MASlope Neg", PlotColor, styleLeftAxisScale|styleDashed);
Plot(IIf(MASlope<= 0, MASlope, Null),
"MASlope
Neg", colorBlue,styleDashed);
}
From:
amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Mike
Sent: Sunday, December 06, 2009 7:35 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: How do you plot dashed and solid line on same
variable