Mira cómo descargar robots gratis
¡Búscanos en Twitter!
Pon "Me gusta" y sigue las noticias
Pon "Me gusta" y sigue las noticias
¿Es interesante este script?
Deje un enlace a él, ¡qué los demás también lo valoren!
Deje un enlace a él, ¡qué los demás también lo valoren!
¿Le ha gustado el script?
Evalúe su trabajo en el terminal MetaTrader 5
Evalúe su trabajo en el terminal MetaTrader 5
PriceChannel - librería para MetaTrader 5
- Visualizaciones:
- 1336
- Ranking:
- Publicado:
- 2019.02.01 07:30
- ¿Necesita un robot o indicador basado en este código? Solicítelo en la bolsa freelance Pasar a la bolsa
PriceChannel - precio máximo y mínimo para el período seleccionado.
Esta biblioteca multiplataforma permite calcular PriceChannel sin ajustar a las barras estándar (por los ticks).
Por tanto, PriceChannel puede calcularse en cualquier timeframe (inclusive usar el de los segundos). Así como, trabajar como canal en los ticks.
Ejemplo.
// Ejemplo de trabajo de la biblioteca PriceChannel input int inPeriod = 1; // Período del canal sinput bool inPriceChannel = true; // Activar/desactivar el cálculo del PriceChannel usando la biblioteca #define PRICECHANNEL_LOW_PRICE bid // bid/ask/last para la barra Low #include <fxsaber\PriceChannel\PriceChannel.mqh> // https://www.mql5.com/es/code/23418 // Precio máximo durante iPeriod barras double GetHigh( const int iPeriod ) { static double Highs[]; CopyHigh(_Symbol, PERIOD_CURRENT, 0, iPeriod, Highs); return(Highs[ArrayMaximum(Highs)]); } // Precio mínimo durante iPeriod barras double GetLow( const int iPeriod ) { static double Lows[]; CopyLow(_Symbol, PERIOD_CURRENT, 0, iPeriod, Lows); return(Lows[ArrayMinimum(Lows)]); } double Sum = 0; void OnTick() { static const int BarInterval = PeriodSeconds(PERIOD_CURRENT); static PRICECHANNEL PriceChannel(inPeriod); // Creamos el objeto PriceChannel con período establecido static int CountBars = 0; static datetime PrevTime = 0; if (inPriceChannel) PriceChannel.NewTick(); // Consideramos nuevo tick if (TimeCurrent() / BarInterval != PrevTime / BarInterval) // Nueva barra CountBars++; if (CountBars > MAX_BARS) // Empezamos los cálculos cuando se ha acumulado el historial correspondiente. Sum += inPriceChannel ? PriceChannel.GetHigh() - PriceChannel.GetLow() // Calculamos PriceChannel usando la biblioteca : GetHigh(inPeriod) - GetLow(inPeriod); // Calculamos PriceChannel usando el método estándar PrevTime = TimeCurrent(); } double OnTester() { return(Sum); }
En el Probador de Estrategias, este EA mostrará los resultados idénticos: método estándar y a través de la biblioteca.
Velocidad de funcionamiento.
Cálculo estándar
optimization finished, total passes 200 optimization done in 6 minutes 55 seconds shortest pass 0:00:01.061, longest pass 0:00:03.432, average pass 0:00:02.066
Usando la biblioteca
optimization finished, total passes 200 optimization done in 2 minutes 57 seconds shortest pass 0:00:00.764, longest pass 0:00:01.982, average pass 0:00:00.862
Particularidades.
- Cálculo en cada tick.
- La duración de la barra puede ser cualquiera.
- No hay vinculación a las barras estándar.
- El valor máximo predefinido (se puede establecer) se calcula por Bid, el mínimo, por Ask.
- La velocidad de funcionamiento prácticamente no depende del período.
Traducción del ruso realizada por MetaQuotes Ltd
Artículo original: https://www.mql5.com/ru/code/23418
Stochastic_RSI
Indicador Stochastic RSI
MTF_LRMAIndicador Multi Timeframe Linear Regression MA with signal line
MTF_Stochastic_RSI
Indicador Multi timeframes Stochastic RSI
ZigZag_OscillatorIndicador ZigZag Oscillator