Some aesthetic problems in the Chart that I cannot solve

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?

image

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!

Hi Svaztej,

Your code snippet is incomplete,so we can't see what is actually going in to the sector variable, nor functions that could affect things before (or after) your section, so its hard to tell what's going on.

I used your code with static variables on my end in your PlotForeign() call, and did get what I'd expect:

Sector title for svaztej

As you probably know, SetForeign() function replaces the current price/volume arrays with those of the foreign security - but we don't know what that is in the rest of your code.

http://www.amibroker.com/guide/afl/setforeign.html

That being the case, your image in the tooltip appears that it is referencing a sector ($SP1500CSCP), but it also shows the time value is blank... so without complete code, I can't tell where all the information on your screen is coming from, or how its getting processed.

1 Like

Apparently I'm unable to edit my own posts once I close the tab... here's the picture that I had wanted to include - using a contrived sector just to show output to the title and the tooltip:

Sector title 2 for svaztej

1 Like

I really thought that it was not necessary to show all the code (to save space), since it is a switch case structure to load the sector to which the value corresponds.
The code is used in a template with the real value in one window and in another the sector to which it belongs.
The code seems to work well, the doubt I raise is, as I was saying purely aesthetic, because at the limits of maximum and minimum channels, the bars are shown outside them, despite giving correct results.
Here is the complete code:

// IDENTIFICACION DEL SECTOR AL QUE PERTENECE EL VALOR EN ESTUDIO
// CREADO POR SANTIAGO VAZQUEZ 2018

SetChartOptions(0,chartShowDates);

_SECTION_BEGIN("Sector");
// Sector GICS
switch (GicsID(0))
	{
// 10 Energy
		case "10":						sector = "$SP1500E";		break;
			case "1010":				sector = "$SP1500EN";		break;
				case "101010":			sector = "$SP1500ENS";		break;
					case "10101010":	sector = "$SP1500OILD";		break; 
					case "10101020":	sector = "$SP1500OILW";		break;
				case "101020":			sector = "$SP1500OIG";		break;
					case "10102010":	sector = "$SP1500OILI";		break;
					case "10102020":	sector = "$SP1500OILP";		break;
					case "10102030":	sector = "$SP1500ENRM";		break;
					case "10102040":	sector = "$SP1500OILS";		break;
					case "10102050":	sector = "$SP1500COAL";		break; 

// 15 Materials
		case "15":						sector = "$SP1500M";		break;
			case "1510":				sector = "$SP1500MA";		break;
				case "151010":			sector = "$SP1500PM";		break;		
					case "15101010":	sector = "$SP1500CHCC";		break;
					case "15101020":	sector = "$SP1500CHMD";		break;
					case "15101030":	sector = "$SP1500CHFA";		break;
					case "15101040":	sector = "$SP1500CHEM";		break;
					case "15101050":	sector = "$SP1500CHMC";		break; 
				case "151020":			sector = "$SP1500COM";		break; 
					case "15102010":	sector = "$SP1500CEMT";		break;
				case "151030":			sector = "$SP1500COP";		break; 
					case "15103010":	sector = "$SP1500CONM";		break; 
					case "15103020":	sector = "$SP1500CONP";		break; 
				case "151040":			sector = "$SP1500MTM";		break;
					case "15104010":	sector = "$SP1500ALUM";		break; 
					case "15104020":	sector = "$SP1500METL";		break; 
					case "15104025":	sector = "$SP1500MMCO";		break; 
					case "15104030":	sector = "$SP1500GOLD";		break; 
					case "15104040":	sector = "$SP1500MTM";		break; 
					case "15104045":	sector = "$SP1500MTM";		break;
					case "15104050":	sector = "$SP1500STEEL";	break;
				case "151050":			sector = "$SP1500AFP";		break;
					case "15105010":	sector = "$SP1500FRPD";		break;
					case "15105020":	sector = "$SP1500PAPR";		break;
		
// 20 Industrial
		case "20":						sector = "$SP1500I";		break;
			case "2010":				sector = "$SP1500IC";		break;
				case "201010":			sector = "$SP1500AED";		break;
					case "20101010":	sector = "$SP1500AERO";		break;
				case "201020":			sector = "$SP1500BUI";		break;
					case "20102010":	sector = "$SP1500BULD";		break;
				case "201030":			sector = "$SP1500CSE";		break;
					case "20103010":	sector = "$SP1500CONT";		break;
				case "201040":			sector = "$SP1500ELQ";		break;
					case "20104010":	sector = "$SP1500ELCE";		break;
					case "20104020":	sector = "$SP1500HEEQ";		break;
				case "201050":			sector = "$SP1500ICON";		break;
					case "20105010":	sector = "$SP1500MAND";		break;
				case "201060":			sector = "$SP1500MAC";		break;
					case "20106010":	sector = "$SP1500MCHD";		break;
					case "20106015":	sector = "$SP1500AGFM";		break;
					case "20106020":	sector = "$SP1500INDM";		break;
				case "201070":			sector = "$SP1500TRA";		break;
					case "20107010":	sector = "$SP1500TKCD";		break;
			case "2020":				sector = "$SP1500CS";		break;
				case "202010":			sector = "$SP1500CSS";		break;
					case "20201010":	sector = "$SP1500PRNT";		break;
					case "20201020":	sector = "$SP1500CSS";		break;
					case "20201030":	sector = "$SP1500CSS";		break;
					case "20201040":	sector = "$SP1500CSS";		break;
					case "20201050":	sector = "$SP1500PROP";		break;
					case "20201060":	sector = "$SP1500OFFS";		break;
					case "20201070":	sector = "$SP1500DSSR";		break;
					case "20201080":	sector = "$SP1500SASR";		break;
				case "202020":			sector = "$SP1500PS";		break;
					case "20202010":	sector = "$SP1500HRES";		break;		
					case "20202020":	sector = "$SP1500RCSR";		break;
			case "2030":				sector = "$SP1500TRN";		break;
				case "203010":			sector = "$SP1500AC";		break;
					case "20301010":	sector = "$SP1500TRNM";		break;		
				case "203020":			sector = "$SP1500ALI";		break;
					case "20302010":	sector = "$SP1500AIR";		break;
				case "203030":			sector = "$SP1500MRIN";		break;
					case "20303010":	sector = "$SP1500MARN";		break;
				case "203040":			sector = "$SP1500RAR";		break;
					case "20304010":	sector = "$SP1500RAIL";		break;
					case "20304020":	sector = "$SP1500TRCK";		break;
				case "203050":			sector = "$SP1500TRN";		break;
					case "20305010":	sector = "$SP1500TRN";		break;		
					case "20305020":	sector = "$SP1500TRN";		break;				
					case "20305030":	sector = "$SP1500TRN";		break;		
			
// 25 Consumer Discretionary
		case "25":						sector = "$SP1500D";		break;
			case "2510":				sector = "$SP1500AU";		break;
				case "251010":			sector = "$SP1500AUC";		break;
					case "25101010":	sector = "$SP1500AUTP";		break;
					case "25101020":	sector = "$SP1500TIRE";		break;
				case "251020":			sector = "$SP1500AUTO";		break;
					case "25102010":	sector = "$SP1500AUTM";		break;
					case "25102020":	sector = "$SP1500MOTR";		break;
			case "2520":				sector = "$SP1500LP";		break;
				case "252010":			sector = "$SP1500HHD";		break;
					case "25201010":	sector = "$SP1500CNEL";		break;
					case "25201020":	sector = "$SP1500FURN";		break;
					case "25201030":	sector = "$SP1500HOME";		break;
					case "25201040":	sector = "$SP1500APPL";		break;
					case "25201050":	sector = "$SP1500HWAR";		break;
				case "252020":			sector = "$SP1500LEP";		break;
					case "25202010":	sector = "$SP1500TOYS";		break;
					case "25202020":	sector = "$SP1500LEP";		break;
				case "252030":			sector = "$SP1500TEX";		break;	
					case "25203010":	sector = "$SP1500TEXT";		break;
					case "25203020":	sector = "$SP1500SHOE";		break;
					case "25203030":	sector = "$SP1500TX";		break;
			case "2530":				sector = "$SP1500HR";		break; 
				case "253010":			sector = "$SP1500HRL";		break;
					case "25301010":	sector = "$SP1500CCGL";		break;
					case "25301020":	sector = "$SP1500HOTL";		break;
					case "25301030":	sector = "$SP1500LFA";		break;
					case "25301040":	sector = "$SP1500REST";		break;
				case "253020":			sector = "$SP1500DCS";		break;
					case "25302010":	sector = "$SP1500EDUS";		break;
					case "25302020":	sector = "$SP1500SCSV";		break;					
			case "2540":				sector = "$SP1500D";		break;
				case "254010":			sector = "$SP1500D";		break;
					case "25401010":	sector = "$SP1500D";		break;				
					case "25401020":	sector = "$SP1500D";		break;				
					case "25401025":	sector = "$SP1500D";		break;			
					case "25401030":	sector = "$SP1500D";		break;			
					case "25401040":	sector = "$SP1500D";		break;				
			case "2550":				sector = "$SP1500MS";		break; 
				case "255010":			sector = "$SP1500DIST";		break;
					case "25501010":	sector = "$SP1500DBTR";		break;
				case "255020":			sector = "$SP1500INR";		break;
					case "25502010":	sector = "$SP1500INR";		break;
					case "25502020":	sector = "$SP1500INRT";		break;					
				case "255030":			sector = "$SP1500MULR";		break;					
					case "25503010":	sector = "$SP1500RETD";		break;						
					case "25503020":	sector = "$SP1500RETM";		break;
				case "255040":			sector = "$SP1500SPR";		break;	
					case "25504010":	sector = "$SP1500RETA";		break;
					case "25504020":	sector = "$SP1500CCCE";		break;
					case "25504030":	sector = "$SP1500RETS";		break;
					case "25504040":	sector = "$SP1500CCRS";		break;
					case "25504050":	sector = "$SP1500AURE";		break;
					case "25504060":	sector = "$SP1500HMRT";		break;										
		
// 30 Consumer Staples		
		case "30":						sector = "$SP1500S";		break;
			case "3010":				sector = "$SP1500FD";		break;
				case "301010":			sector = "$SP1500FDGR";		break;
					case "30101010":	sector = "$SP1500DRG";		break;
					case "30101020":	sector = "$SP1500FODW";		break;
					case "30101030":	sector = "$SP1500RETF";		break;
					case "30101040":	sector = "$SP1500HYSC";		break;
			case "3020":				sector = "$SP1500FBT";		break;
				case "302010":			sector = "$SP1500BVGS";		break;
					case "30201010":	sector = "$SP1500BEVA";		break;
					case "30201020":	sector = "$SP1500DSVN";		break;
					case "30201030":	sector = "$SP1500BEVS";		break;
				case "302020":			sector = "$SP1500FDPR";		break;
					case "30202010":	sector = "$SP1500BMAG";		break;
					case "30202020":	sector = "$SP1500FDPR";		break;
					case "30202030":	sector = "$SP1500FOOD";		break;
				case "302030":			sector = "$SP1500TOBA";		break;
					case "30203010":	sector = "$SP1500TOBC";		break;
			case "3030":				sector = "$SP1500HHPE";		break;
				case "303010":			sector = "$SP1500HOPR";		break;
					case "30301010":	sector = "$SP1500PROD";		break;
				case "303020":			sector = "$SP1500PEPR";		break;
					case "30302010":	sector = "$SP1500COMS";		break;
			
// 35 Health Care
		case "35":						sector = "$SP1500A";		break;
			case "3510":				sector = "$SP1500HC";		break;
				case "351010":			sector = "$SP1500HCEQ";		break;
					case "35101010":	sector = "$SP1500MED";		break;
					case "35101020":	sector = "$SP1500HCSP";		break;
				case "351020":			sector = "$SP1500HCPS";		break;
					case "35102010":	sector = "$SP1500HCSS";		break;
					case "35102015":	sector = "$SP1500CARE";		break;
					case "35102020":	sector = "$SP1500HCLT";		break;
					case "35102030":	sector = "$SP1500HMO";		break;
				case "351030":			sector = "$SP1500HCT";		break;
					case "35103010":	sector = "$SP1500HCTC";		break;
			case "3520":				sector = "$SP1500PHB";		break;
				case "352010":			sector = "$SP1500BIOT";		break;
					case "35201010":	sector = "$SP1500TKBI";		break;
				case "352020":			sector = "$SP1500CARG";		break;
					case "35202010":	sector = "$SP1500CARD";		break;
				case "352030":			sector = "$SP1500LSCI";		break;
					case "35203010":	sector = "$SP1500LISCI";	break;
		
// 40 Financials
		case "40":						sector = "$SP1500F";		break;
			case "4010":				sector = "$SP1500BK";		break;
				case "401010":			sector = "$SP1500BKS";		break;
					case "40101010":	sector = "$SP1500RBNK";		break;
					case "40101015":	sector = "$SP1500BNKS";		break;
				case "401020":			sector = "$SP1500TMF";		break;
					case "40102010":	sector = "$SP1500TMFN";		break;
			case "4020":				sector = "$SP1500DF";		break;
				case "402010":			sector = "$SP1500DIFN";		break;
					case "40201010":	sector = "$SP1500DIFN";		break;
					case "40201020":	sector = "$SP1500DIFN";		break;
					case "40201030":	sector = "$SP1500MSUT";		break;
					case "40201040":	sector = "$SP1500DIFN";		break;
				case "402020":			sector = "$SP1500CFI";		break;
					case "40202010":	sector = "$SP1500PERS";		break;
				case "402030":			sector = "$SP1500CMK";		break;
					case "40203010":	sector = "$SP1500AMCB";		break;
					case "40203020":	sector = "$SP1500INVB";		break;
					case "40203030":	sector = "$SP1500CMK";		break;
					case "40203040":	sector = "$SP1500CMFE";		break;
				case "402040":			sector = "$SP1500MORE";		break;
					case "40204010":	sector = "$SP1500MORS";		break;
			case "4030":				sector = "$SP1500INSC";		break;
				case "403010":			sector = "$SP1500INSE";		break;
					case "40301010":	sector = "$SP1500INSU";		break;				
					case "40301020":	sector = "$SP1500LIFE";		break;				
					case "40301030":	sector = "$SP1500INSM";		break;				
					case "40301040":	sector = "$SP1500INPC";		break;				
					case "40301050":	sector = "$SP1500REIN";		break;				
			case "4040":				sector = "$SP1500F";		break;				
				case "404010":			sector = "$SP1500F";		break;
					case "40401010":	sector = "$SP1500F";		break;
					case "40401020":	sector = "$SP1500F";		break;	
				case "404020":			sector = "$SP1500F";		break;
					case "40402010":	sector = "$SP1500F";		break;				
					case "40402020":	sector = "$SP1500F";		break;				
					case "40402030":	sector = "$SP1500F";		break;				
					case "40402035":	sector = "$SP1500F";		break;				
					case "40402040":	sector = "$SP1500F";		break;				
					case "40402045":	sector = "$SP1500F";		break;				
					case "40402050":	sector = "$SP1500F";		break;
					case "40402060":	sector = "$SP1500F";		break;					
					case "40402070":	sector = "$SP1500F";		break;					
				case "404030":			sector = "$SP1500F";		break;					
					case "40403010":	sector = "$SP1500F";		break;						
					case "40403020":	sector = "$SP1500F";		break;					
					case "40403030":	sector = "$SP1500F";		break;					
					case "40403040":	sector = "$SP1500F";		break;					

// 45 Information Technology
		case "45":						sector = "$SP1500T";		break;
			case "4510":				sector = "$SP1500IS";		break;
				case "451010":			sector = "$SP1500IS";		break;
					case "45101010":	sector = "$SP1500IS";		break;
				case "451020":			sector = "$SP1500ITCS";		break;
					case "45102010":	sector = "$SP1500TKCS";		break;
					case "45102020":	sector = "$SP1500TKDP";		break;
					case "45102030":	sector = "$SP1500INSS";		break;
				case "451030":			sector = "$SP1500SOFW";		break;
					case "45103010":	sector = "$SP1500CMSF";		break;
					case "45103020":	sector = "$SP1500SYSF";		break;
					case "45103030":	sector = "$SP1500SOFW";		break;		
			case "4520":				sector = "$SP1500TEHW";		break;
				case "452010":			sector = "$SP1500COEQ";		break;
					case "45201010":	sector = "$SP1500COEQ";		break;
					case "45201020":	sector = "$SP1500COMM";		break;
					case "45201030":	sector = "$SP1500COEQ";		break;
				case "452020":			sector = "$SP1500COPE";		break;		
					case "45202010":	sector = "$SP1500COPE";		break;
					case "45202020":	sector = "$SP1500COPE";		break;
					case "45202030":	sector = "$SP1500THSP";		break;
				case "452030":			sector = "$SP1500ELEQ";		break;
					case "45203010":	sector = "$SP1500EEIS";		break;
					case "45203015":	sector = "$SP1500ELCO";		break;		
					case "45203020":	sector = "$SP1500ELMS";		break;
					case "45203030":	sector = "$SP1500TDIS";		break;
				case "452040":			sector = "$SP1500TEHW";		break;
					case "45204010":	sector = "$SP1500TEHW";		break;
				case "452050":			sector = "$SP1500TEHW";		break;
					case "45205010":	sector = "$SP1500TEHW";		break;		
					case "45205020":	sector = "$SP1500TEHW";		break;
			case "4530":				sector = "$SP1500SE";		break;
				case "453010":			sector = "$SP1500SEQP";		break;
					case "45301010":	sector = "$SP1500TKSM";		break;
					case "45301020":	sector = "$SP1500ELCS";		break;

// 50 Comunication Services
		case "50":						sector = "$SP1500L";		break;
			case "5010":				sector = "$SP1500TS";		break;
				case "501010":			sector = "$SP1500DTES";		break;
					case "50101010":	sector = "$SP1500ALCA";		break;
					case "50101020":	sector = "$SP1500TELP";		break;
				case "501020":			sector = "$SP1500WTES";		break;
					case "50102010":	sector = "$SP1500CSCP";		break;
			case "5020":				sector = "$SP1500ME";		break;
				case "502010":			sector = "$SP1500MDIA";		break;
					case "50201010":	sector = "$SP1500CCAM";		break;
					case "50201020":	sector = "$SP1500MEDA";		break;
					case "50201030":	sector = "$SP1500CBSA";		break;
					case "50201040":	sector = "$SP1500PUBL";		break;
				case "502020":			sector = "$SP1500ENT";		break;
					case "50202010":	sector = "$SP1500ENTE";		break;
					case "50202020":	sector = "$SP1500ENTS";		break;
				case "502030":			sector = "$SP1500IMS";		break;
					case "50203010":	sector = "$SP1500IMSE";		break;

// 55 Utilities
		case "55":						sector = "$SP1500U";		break;
			case "5510":				sector = "$SP1500UL";		break;
				case "551010":			sector = "$SP1500ELUT";		break;
					case "55101010":	sector = "$SP1500ELEC";		break;
				case "551020":			sector = "$SP1500GAUT";		break;
					case "55102010":	sector = "$SP1500NGAS";		break;
				case "551030":			sector = "$SP1500MUUT";		break;
					case "55103010":	sector = "$SP1500PPIN";		break;
				case "551040":			sector = "$SP1500WTR";		break;
					case "55104010":	sector = "$SP1500WUT";		break;
				case "551050":			sector = "$SP1500PPE";		break;
					case "55105010": 	sector = "$SP1500PPET";		break;
					case "55105020":	sector = "$SP1500PPE";		break;

// 60 Real Estate
		case "60":						sector = "$SP1500R";		break;
			case "6010":				sector = "$SP1500REC";		break;
				case "601010":			sector = "$SP1500REITS";	break;
					case "60101010":	sector = "$SP1500REID";		break;
					case "60101020":	sector = "$SP1500REII";		break;
					case "60101030":	sector = "$SP1500REHO";		break;
					case "60101040":	sector = "$SP1500REIO";		break;
					case "60101050":	sector = "$SP1500REHC";		break;
					case "60101060":	sector = "$SP1500REIR";		break;
					case "60101070":	sector = "$SP1500RERD";		break;
					case "60101080": 	sector = "$SP1500RESP";		break;
				case "601020":			sector = "$SP1500REMG";		break;
					case "60102010":	sector = "$SP1500REMD";		break;
					case "60102020":	sector = "$SP1500REMG";		break;
					case "60102030":	sector = "$SP1500REDV";		break;
					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();

and the complete template too.

image
Thank you very much for your answer.

Do not consider the template in the image above.
The correct one is the following one:
image

Just as a comment, you don't need to use the extensive Switch command when using Norgate Data.

You can use the NorgateIndustryIndexCorresponding call which is detailed here:

eg.

indexsymbol = NorgateIndustryIndexCorresponding("$SP1500",4,"PR");

Cheers,
Richard.

1 Like

The extra code didn't reveal anything odd or an answer to why the characters are cut off on the last part of your symbol. But, after experimenting, it seems that the Name value is limited to 71/72 characters in Plot() and PlotForeign() functions - anything beyond that gets cut off. (The new line character "\n" counts as one character in your case.)

I tried multiple ways to get the scaling of your min/max dotted lines to remain fixed based on the scaling of the price graph, but couldn't get anything to work consistently, and that would automatically scale with price fluctuations. (I'm a relative AB novice, but I did try just about every variation of Plot/PlotForeign with automatic and custom scaling, styleOwnScale, styleLeftAxisScale, minvalue, maxvalue and styleNoScale.)

When you think about it programmatically, I suspect it would be a lot of work to try to provide that visually regardless of zoom and scale. The primary chart is continually changing based on the range displayed onscreen, and trying to map that to indicators based on foreign data of various scales which are beyond the edges of the screen... and keep it all in perfect harmony for each spot on the screen/time segment that the user chooses to focus on? Whew! That would be no small feat!!

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.