¿Puedo obtener cualquier valor calculado de un indicador?

 

Publi

Resultados 1 al 2 de 2

Tema: ¿Puedo obtener cualquier valor calculado de un indicador?

  1. #1
    ¿Cómo podría capturar el valor de O [_I] de este indicador en un EA?
    O [_] es el precio de apertura del gráfico de superposición en interiores.

    Código insertado/ --------------------------------------------- --------------------- /| OverlayChart.mq5 |/| Copyright 2014-2016, EarnForex.com |/| http://www.earnforex.com |/| Convertido de la versión MT4 por http://www.irxfx.com |/ ----------------------------------------------- ------------------- #property copyright Copyright 2014-2016, EarnForex.com #property Hipervínculo http://www.earnforex.com #property versión 1.01 #property indior_chart_window #property indior_buffers 5 #property indior_plots 1 #property indior_type1 DRAW_COLOR_BARS #property indior_color1 clrMediumSeaGreen, clrOrange #property indior_width1 1/Indior Parameters input string SubSymbol; Entrada bool Reflejando = falso; entrada ENUM_DRAW_TYPE DrawType = DRAW_COLOR_BARS; color de entrada GridColor = clrBlack;/Indior Buffers double O # 91; # 93 ;; doble H # 91; # 93 ;; doble L # 91; # 93 ;; doble C # 91; # 93 ;; doble color # 91; # 93 ;;/Variables globales doble SubOpen # 91; # 93 ;; doble sub-alto # 91; # 93 ;; doble SubLow # 91; # 93 ;; doble Subclose # 91; # 93 ;; prefijo de cadena = OverlayChart;/Indior Prefix int Grid = 10;/Grid Lines int SnapPips = 10;/Snap Pips para líneas de cuadrícula/ ---------------------------------------- -------------------------- /| Función de inicialización personalizada indior |/ ----------------------------------------------- ------------------- int OnInit () IndiorSetString (INDICATOR_SHORTNAME, OverLay Chart ( SubSymbol )); SetIndexBuffer (0, O, INDICATOR_DATA); SetIndexBuffer (1, H, INDICATOR_DATA); SetIndexBuffer (2, L, INDICATOR_DATA); SetIndexBuffer (3, C, INDICATOR_DATA); SetIndexBuffer (4, Color, INDICATOR_COLOR_INDEX); ArraySetAsSeries (O, true); ArraySetAsSeries (H, true); ArraySetAsSeries (L, true); ArraySetAsSeries (C, true); ArraySetAsSeries (Color, true); PlotIndexSetDouble (0, PLOT_EMPTY_VALUE, 0); PlotIndexSetInteger (0, PLOT_DRAW_TYPE, DrawType); ArraySetAsSeries (SubOpen, true); ArraySetAsSeries (SubHigh, true); ArraySetAsSeries (SubLow, true); ArraySetAsSeries (SubClose, true); return (INIT_SUCCEEDED);/ ----------------------------------------------- ------------------- /| Función de desinicialización indior personalizada |/ ----------------------------------------------- ------------------- void OnDeinit (constante razón) ObjectsDeleteAll (0, Prefix);* para (int _I ​​= 1; _I lt; = Grid; _I ) ObjectDelete (0, Prefix Grid IntegerToString (_I)); ObjectDelete (0, Prefix Price IntegerToString (_I)); *// --------------------------------------------- --------------------- /| Función de iteración indior personalizada |/ ----------------------------------------------- ------------------- int OnCalculate (const int rat rates_total, const int prev_calculated, const datetimeTime # 91; # 93 ;, const double Open # 91; # 93 ;, const double High # 91; # 93 ;, const double Low # 91; # 93 ;, const double Close # 91; # 93 ;, const long tick_volume # 91; # 93 ;, const. volumen largo # 91; # 93 ;, const int spread # 91; # 93; -RRB- int _BarsCount; doble _CurRangeHigh, _CurRangeLow, _CurRangeCenter; double _SubRangeHigh, _SubRangeLow, _SubRangeCenter; doble _SubPoint; int _SubDigit; doble _SubOpen, _SubHigh, _SubLow, _SubClose; doble _PipsRatio; doble _GridPips, _GridPrice; int _I; ArraySetAsSeries (Open, true); ArraySetAsSeries (Alto, verdadero); ArraySetAsSeries (bajo, verdadero); ArraySetAsSeries (Close, true); ArraySetAsSeries (Time, true); ArrayInitialize (O, 0); ArrayInitialize (H, 0); ArrayInitialize (L, 0); ArrayInitialize (C, 0);/Calcular barras visibles _BarsCount = (int) ChartGetInteger (0, CHART_VISIBLE_BARS) 1; int _FirstBar = (int) ChartGetInteger (0, CHART_FIRST_VISIBLE_BAR); int _LastBar = _FirstBar - _BarsCount 1; if (_LastBar lt; 0) _LastBar = 0; _BarsCount = _FirstBar 1;/Calcular proporción de gráfico _CurRangeHigh = High # 91; ArrayMaximum (High, _LastBar, _BarsCount) # 93 ;; _CurRangeLow = Low # 91; ArrayMinimum (Low, _LastBar, _BarsCount) # 93 ;; _CurRangeCenter = (_CurRangeHigh _CurRangeLow)2; int n; n = CopyOpen (SubSymbol, 0, _LastBar, _BarsCount, SubOpen); if (! CheckData (n, _BarsCount)) return (0); n = CopyHigh (SubSymbol, 0, _LastBar, _BarsCount, SubHigh); if (! CheckData (n, _BarsCount)) return (0); n = CopyLow (SubSymbol, 0, _LastBar, _BarsCount, SubLow); if (! CheckData (n, _BarsCount)) return (0); n = CopyClose (SubSymbol, 0, _LastBar, _BarsCount, SubClose); if (! CheckData (n, _BarsCount)) return (0); doble SubMax = SubHigh # 91; ArrayMaximum (SubHigh) # 93; doble SubMin = SubLow # 91; ArrayMinimum (SubLow) # 93 ;; if (Mirroring) _SubRangeHigh = SubMin; _SubRangeLow = SubMax; else _SubRangeHigh = SubMax; _SubRangeLow = SubMin; _SubRangeCenter = (_SubRangeHigh _SubRangeLow)2; _SubPoint = SymbolInfoDouble (SubSymbol, SYMBOL_POINT); _SubDigit = (int) SymbolInfoInteger (SubSymbol, SYMBOL_DIGITS); if (_SubRangeHigh - _SubRangeLow == 0) return (0); _PipsRatio = (_CurRangeHigh - _CurRangeLow)(_SubRangeHigh - _SubRangeLow); _GridPips = (_SubRangeHigh - _SubRangeLow)Grid; _GridPips = MathRound ((_ SubRangeHigh - _SubRangeLow)Grid(_SubPoint * SnapPips)) * (_SubPoint * SnapPips);/Dibujar candelabros para (_I = _LastBar; _I lt; _LastBar _BarsCount; _I ) int I = _I - _LastBar; _SubOpen = SubOpen # 91; I # 93; - _SubRangeCenter; _SubHigh = SubHigh # 91; I # 93; - _SubRangeCenter; _SubLow = SubLow # 91; I # 93; - _SubRangeCenter; _SubClose = SubClose # 91; I # 93; - _SubRangeCenter; if (Mirroring) if (_SubOpen lt; _SubClose)H # 91; _I # 93; = _CurRangeCenter _SubHigh * _PipsRatio; L # 91; _I # 93; = _CurRangeCenter _SubLow * _PipsRatio; Color # 91; _I # 93; = 0; de lo contrario L # 91; _I # 93; = _CurRangeCenter _SubLow * _PipsRatio; H # 91; _I # 93; = _CurRangeCenter _SubHigh * _PipsRatio; Color # 91; _I # 93; = 1; C # 91; _I # 93; = _CurRangeCenter _SubClose * _PipsRatio; O # 91; _I # 93; = _CurRangeCenter _SubOpen * _PipsRatio; si no (_SubOpen lt; _SubClose) H # 91; _I # 93; = _CurRangeCenter _SubHigh * _PipsRatio; L # 91; _I # 93; = _CurRangeCenter _SubLow * _PipsRatio; Color # 91; _I # 93; = 0; de lo contrario L # 91; _I # 93; = _CurRangeCenter _SubLow * _PipsRatio; H # 91; _I # 93; = _CurRangeCenter _SubHigh * _PipsRatio; Color # 91; _I # 93; = 1; C # 91; _I # 93; = _CurRangeCenter _SubClose * _PipsRatio; O # 91; _I # 93; = _CurRangeCenter _SubOpen * _PipsRatio; para (_I = 1; _I lt; = Grid; _I ) _GridPrice = MathRound (_SubRangeCenter(_SubPoint * SnapPips)) * (_SubPoint * SnapPips); _GridPrice = ((_GridPrice _GridPips2) _GridPips * (Grid2 - 1)) - (_GridPips * (_I - 1)); string grid_string = Prefix Grid IntegerToString (_I); ObjectCreate (0, grid_string, OBJ_TREND, 0, 0, 0); ObjectSetInteger (0, grid_string, OBJPROP_TIME, 0, Time # 91; _FirstBar # 93; -RRB-; ObjectSetDouble (0, grid_string_es_as_es_es_es_es_es_es_es_es_es_es_es _es_es_es_es_es_es_es_es_es_es_es_es_es_es_es_es_e s_es_es_es_es_es_es_es_es_es_es_es_es_es_es_es_es_ es_es_es_es_es_es_es] , 1, Time # 91; _LastBar # 93; -RRB-; ObjectSetDouble (0, grid_string, OBJPROP_PRICE, 1, _CurRangeCenter (_GridPrice como: , grid_string, OBJPROP_STYLE, STYLE_DOT); ObjectSetInteger. , 0, 0); ObjectSetInteger (0, grid_string, OBJPROP_TIME, 0, Time # 91; _FirstBar - _BarsCount10 # 93; -RRB-; ObjectSetDuP.Contactualiz.com) _PipsRatio ); ObjectSetInteger (0, grid_string, OBJPROP_COLOR, GridColor); ObjectSetString (0, grid_string, OBJPROP_TEXT, DoubleToString (_GridPrice, _SubDigit)); retorno (tasas_total);/Verifica la Cantidad de barras de series temporales y devuelve verdadero (OK) o falso (Error). Bool CheckData (int n, int _BarsCount) if (n == -1) Imprimir (Datos de gráfico inaccesibles:, SubSymbol); falso retorno); if (n!) = _BarsCount) Imprimir (los datos del gráfico aún se están cargando para:, SubSymbol); falso retorno); retorno (verdadero);/ ----------------------------------------------- -------------------

  2. #2
    Debe utilizar en su EA la función iCustom () que llama al búfer correcto. Por ejemplo, si necesita el valor O [], el búfer para el iCustom () es el 0 (cero).

Permisos de publicación

  • No puedes crear nuevos temas
  • No puedes responder temas
  • No puedes subir archivos adjuntos
  • No puedes editar tus mensajes
  •  
Cookies
Utilizamos cookies propias y de terceros para mejorar nuestros servicios y mostrarle publicidad relacionada con sus preferencias mediante el análisis de sus hábitos de navegación. Si continua navegando, consideramos que acepta su uso. Puede cambiar la configuración u obtener más información y política de cookies aquí.