// Licencia #property copyright "GNU GPL v3.0 Programando Forex" #property link "http://www.programandoforex.com" // Propiedades generales #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Red // Buffers double ExtMapBuffer1[]; // Esto se ejecuta al cargar el indicador int init() { // Propiedades gráficas SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); // Mostrar una linea de texto sobre el indicador string nombre = "¡El primer indicador funcionando!"; IndicatorShortName(nombre); return(0); } int start() { // Variables double vOpen, vClose; // Contar número de barras int counted_bars = IndicatorCounted(); int pos = Bars - counted_bars; // Para cada barra dar un valor en el buffer while(pos>=0) { vOpen = Open[pos]; vClose = Close[pos]; ExtMapBuffer1[pos]= MathAbs(vOpen - vClose); pos--; } return(0); }