Your code |
Documentation |
---|---|
double SlowMovingAverage = iMA( Symbol(), 0, MASlowPeriod, 0, MODE_SMA, PRICE_CLOSE, 0 ); |
int iMA( string symbol, // symbol name ENUM_TIMEFRAMES period, // period int ma_period, // averaging period int ma_shift, // horizontal shift ENUM_MA_METHOD ma_method, // smoothing type ENUM_APPLIED_PRICE applied_price // type of price or handle ); |
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
Creating an iMA indicator handle, getting indicator values.
How
to start with MQL5 - General - MQL5 programming forum - Page 3 #22
2020.03.08
Also see my example for encapsulating calls
Detailed
explanation of iCustom - MQL4 programming forum
hi.
I have error in my expert.
you can find my codes and errors in below. please advice me.
thanks.
my errors is in attachment.
In MQL5, the handle of the indicator is received ONE time (in OnInit) and then used CopyBuffer (to receive data from the indicator). Example:
Creating an iMA indicator handle, getting indicator values
- 2020.03.05
- www.mql5.com
Your code |
Documentation |
---|---|
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
Creating an iMA indicator handle, getting indicator values.
How
to start with MQL5 - General - MQL5 programming forum - Page 3 #22
2020.03.08
Also see my example for encapsulating calls
Detailed
explanation of iCustom - MQL4 programming forum
hi.
I followed this link in youtube. please see it.
- www.youtube.com
In MQL5, the handle of the indicator is received ONE time (in OnInit) and then used CopyBuffer (to receive data from the indicator). Example:
Creating an iMA indicator handle, getting indicator values
hi.
I followed this link in youtube. please see it.
- www.youtube.com
hi.
I followed this link in youtube. please see it.
I showed you how to create an indicator in MQL5. But you can continue to make a mistake and continue to watch video in MQL4.
hi.
I have error in my expert.
you can find my codes and errors in below. please advice me.
thanks.
my errors is in attachment.
double SlowMovingAverage = iMA(Symbol(),0,MASlowPeriod,0,MODE_SMA,PRICE_CLOSE); double LastSlowMovingAverage = iMA(Symbol(),0,MASlowPeriod,0,MODE_SMA,PRICE_CLOSE); double FastMovingAverage = iMA(Symbol(),0,MAFastPeriod,1,MODE_SMA,PRICE_CLOSE); double LastFastMovingAverage = iMA(Symbol(),0,MAFastPeriod,1,MODE_SMA,PRICE_CLOSE);
I showed you how to create an indicator in MQL5. But you can continue to make a mistake and continue to watch video in MQL4.
your right.
thanks.
can you advice me how can I find Slope of line for moving average curve.
my strategy is : when Slope of line of moving average curve change from negative to positive, this is a buy or sell time.
Slope = Δ Price × Δ Time
Show us your attempt (using the CODE button) and state the nature of your problem.No free help
Or pay someone. Top of every page is the link Freelance.
Hiring to write script
- General - MQL5 programming forum
me ajudem a resolver o erro na linha 38 coluna 11
//+------------------------------------------------------------------+ //| MeuExpert.mq5 | //| Direitos autorais 2024, MetaQuotes Software Corp. //| https://www.mql5.com | //+------------------------------------------------------------------+ #include <Comércio\Comércio.mqh> // Declarar objeto de negociação Comércio comercial; // Parâmetros de entrada entrada double lot_size = 0,01; // Tamanho do lote padrão input int take_profit_points = 100; // Obter lucro em pontos entrada int stop_loss_points = 300; // Stop loss em pontos entrada int fast_ma_period = 5; // Período da média móvel rápida entrada int slow_ma_period = 20; // Período da média móvel lenta //+------------------------------------------------------------------+ //| Função de inicialização especializada | //+------------------------------------------------------------------+ int OnInit() { retornar(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Função de desinicialização de especialista | //+------------------------------------------------------------------+ void OnDeinit(const int razão) { } //+------------------------------------------------------------------+ //| Função para obter o valor da média móvel | //+------------------------------------------------------------------+ duplo GetMovingAverage(int período_ma, int deslocamento) { retornar iMA(_Símbolo, 0, período_ma, 0, MODO_SMA, FECHAMENTO_DE_PREÇO, deslocamento); } //+------------------------------------------------------------------+ //| Função de marcação de especialista | //+------------------------------------------------------------------+ vazio OnTick() { double fast_ma_current = ObterMédiaMovimento(fast_ma_periodo, 0); double fast_ma_previous = ObterMédiaMovimental(fast_ma_período, 1); double slow_ma_current = ObterMédiaMovimento(período_ma_lento, 0); double slow_ma_previous = ObterMédiaMovimental(período_lento_ma_anterior, 1); preço_pedido_duplo = SymbolInfoDouble(_Símbolo, PEDIDO_DE_SÍMBOLO); preço_de_lance_duplo = SymbolInfoDouble(_Símbolo, LANCE_DE_SÍMBOLO); // Verificar cruzamento para compra (cruzamento para cima) se (ma_rápido_anterior < ma_lento_anterior && ma_rápido_atual > ma_lento_atual) { lucro_duplo = preço_pedido + pontos_lucro_de_retirada * _Ponto; stop_loss duplo = preço_de_venda - pontos_de_stop_loss * _Ponto; // Abre uma ordem de compra if(negociação.Comprar(tamanho_do_lote, _Símbolo, preço_de_venda, stop_loss, take_profit)) { Print("Pedido de compra aberto: ", GetLastError()); } } // Verificar cruzamento para venda (cruzamento para baixo) senão se (fast_ma_anterior > slow_ma_anterior && fast_ma_atual < slow_ma_atual) { lucro_duplo = preço_de_oferta - pontos_de_lucro_duplo * _Ponto; stop_loss duplo = preço_de_oferta + pontos_de_stop_loss * _Ponto; // Abre uma ordem de venda if(trade.Sell(tamanho_do_lote, _Símbolo, preço_de_oferta, stop_loss, take_profit)) { Print("Pedido de venda aberta: ", GetLastError()); } } } //+------------------------------------------------------------------+
- 2024.07.09
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi.
I have error in my expert.
you can find my codes and errors in below. please advice me.
thanks.
my errors is in attachment.