Tengo experiencia en programación con otras plataformas, pero este es mi primer intento en metatrader más un lenguaje establecido en C y necesito ayuda. Quería comenzar con un indicador simple para trazar el máximo alto y mínimo bajo con diferentes marcos de tiempo en un solo gráfico. El código se compila pero nada se traza si se agrega a un gráfico:

Inserted Code #property copyright Internets #property Hyperlink #property indior_chart_window #property indior_buffers 4/- parámetros de entrada extern int timeframe1 = 15; extern int timeframe2 = 240;/- el indicador Buffers double ExtMapBuffer1 # 91; # 93 ;; double ExtMapBuffer2 # 91; # 93 ;; double ExtMapBuffer3 # 91; # 93 ;; double ExtMapBuffer4 # 91; # 93 ;;/ ----------------------------------------------- ------------------- /| Función de inicialización del indicador personalizado |/ ----------------------------------------------- ------------------- int init ()/- mapeo de buffers de indicador SetIndexBuffer (0, ExtMapBuffer1); SetIndexStyle (0, DRAW_LINE); SetIndexBuffer (1, ExtMapBuffer2); SetIndexStyle (1, DRAW_LINE); SetIndexBuffer (2, ExtMapBuffer3); SetIndexStyle (2, DRAW_LINE); SetIndexBuffer (3, ExtMapBuffer4); SetIndexStyle (3, DRAW_LINE);* - Indicadores Rectangle de Objetos ObjectCreate (sObjName, OBJ_RECTANGLE, 0, 0, 0, 0, 0); ObjectSet (sObjName, OBJPROP_STYLE, STYLE_SOLID); ObjectSet (sObjName, OBJPROP_COLOR, cObjColor); ObjectSet (sObjName, OBJPROP_BACK, bProp_Back); *return (0);/ ----------------------------------------------- ------------------- /| Función de desinitialización del indicador personalizado |/ ----------------------------------------------- ------------------- int deinit ()/-/- return (0);/ ----------------------------------------------- ------------------- /| Servicio de iteración de indicador personalizado |/ ----------------------------------------------- ------------------- int start () int counted_bars = IndiorCounted (); límite int; int pos = 0; doble highT1; doble lowT1; doble altaT2; doble lowT2;/- Script para contar el número de barras en el gráfico if (counted_barslt; 0) return (-1); should (counted_barsgt; 0) counted_bars--; limit = Bars-counted_bars;/- Código principal para (int I = 0; ilt; = timeframe1; I ) if (Top # 91; I # 93; gt; highT1) highT1 = Alto # 91; I # 93 ;; should (bajo # 91; I # 93; lt; lowT1) lowT1 = reducido # 91; I # 93 ;; for (int j = 1; jlt; = timeframe2; j ) if (Top # 91; j # 93; gt; highT2) highT2 = Top # 91; j # 93 ;; should (bajo # 91; j # 93; lt; lowT2) lowT2 = reducido # 91; j # 93 ;; for (pos = Bars; pos gt; = 0; pos--) ExtMapBuffer1 # 91; pos # 93; = altoT1; ExtMapBuffer2 # 91; pos # 93; = bajoT1; ExtMapBuffer3 # 91; pos # 93; = altoT2; ExtMapBuffer4 # 91; pos # 93; = lowT2; return (0);/ ----------------------------------------------- -------------------