Good morning and Happy Holidays!
Someone could give me a hint about these problems I have encountered?
I have created a template to draw the GICS sector (as Norgate catalogues them) to which the loaded ticker belongs as well as its line of maximums and minimums of a certain period and I don't know why when I paint it it doesn't correspond with the values of the price (of the bars) in the drawing (although I have checked that the values seem correct in the title of the chart). It seems to be due to some problem I have with autoscaling, as it changes as I move through the graph.
On the other hand, is there a maximum number of characters in the parameter "name" of the plot function, because it doesn't draw the full name, as you can see in the attached graphic?
I show you the part of the code after "switch and case statements" to locate the corresponding sector, where you can see the lines that run where I find the problem)
/* case "60102040": sector = "$SP1500RESR"; break;
// Cuando no haya sector tomará el Ăndice NYSE
default: sector = "$NYA";
}
*/
PintarSector = ParamToggle("Pintar Sector","No|Yes", 1);
if(PintarSector==1)
{
PlotForeign(sector, "\nSector GICS: " + GicsID(2) + " (" + sector + ") " , colorBlue);
}
_SECTION_END();
Title = EncodeColor(colorDefault) + StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) );
SetForeign(sector);
_SECTION_BEGIN("Media ponderada");
r1 = ParamColor ("Color alcista", colorBlue );
r2 = ParamColor ("Color bajista", colorRed );
r3 = ParamStyle ("Style", styleLine + styleThick + styleNoLabel);
P = ParamField("Price field",3);
Periods = Param("Periods", 30, 2, 300, 1, 10 );
Plot( WMA( P, Periods ), "\n" + "Media Ponderada" , IIf ( WMA( P, Periods )>= Ref( WMA( P, Periods ), -1), r1, r2), r3 );
_SECTION_END();
_SECTION_BEGIN("Máximo Minimo de periodo");
// creado por Javier Alfayate
// Adaptado a Amibroker por Santiago Vázquez
// para la plantilla profesional de medio plazo
periodoMax = Param ("periodo Maximos", 52, 1, 500, 1);
periodoMin = Param ("periodo MĂnimos", 52, 1, 500, 1);
maxi = HHV (Close, periodoMax);
minim = LLV (Close, periodoMin);
r1 = ParamColor ("Color Máximos", colorGreen);
r2 = ParamColor ("Color MĂnimos", colorRed);
r3 = ParamStyle ("Style", styleLine + styleThick + styleDashed);
Plot (maxi, "\nLĂnea de Máximos", r1, r3 );
Plot (minim, "LĂnea de MĂnimos", r2, r3 );
_SECTION_END();
Thank you very much and happy New Year!