Domande dai principianti MQL5 MT5 MetaTrader 5 - pagina 1287

 

Per favore, consigliatemi!

Come calcolare l'EMA dal volume in MQL5. In MQL4 c'era una funzione iMAonArray(), ma in MQL5 ho capito che non c'è questa funzione.

 
Madmas:

Per favore, consigliatemi!

In MQL5 come calcolare l'EMA dal volume. In MQL4 aveva la funzione iMAonArray(), ma in MQL5 credo sia assente.

Devo creare un manico per l' indicatore iVolumes. Poi create un manico dell'indicatore iMA, ma usate il manico iVolumes invece del prezzo:

//--- create handle of the indicator
   handle_iVolumes=iVolumes(Symbol(),Period(),Inp_Volumes_applied_volume);
//--- if the handle is not created
   if(handle_iVolumes==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code
      PrintFormat("Failed to create handle of the iVolumes indicator for the symbol %s/%s, error code %d",
                  Symbol(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early
      return(INIT_FAILED);
     }
//--- create handle of the indicator iMA
   handle_iMA=iMA(Symbol(),Period(),Inp_MA_ma_period,Inp_MA_ma_shift,
                  Inp_MA_ma_method,handle_iVolumes);
//--- if the handle is not created
   if(handle_iMA==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code
      PrintFormat("Failed to create handle of the iMA indicator for the symbol %s/%s, error code %d",
                  Symbol(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early
      return(INIT_FAILED);
     }

Risultato:

MAOnVolumesOnMA

File:
 
Vladimir Karputov:

Dobbiamo creare un handle per l'indicatore iVolumes. Poi create un manico dell'indicatore iMA, ma sostituite il manico iVolumes al posto del prezzo:

Risultato:


Grazie, ci darò un'occhiata)))).... imparare

 
Madmas:

Grazie, ci darò un'occhiata)))).... imparare

Solo una nota: QUESTO potrebbe non dare i dati corretti...

 
Сергей Таболин:

Solo una nota: QUESTO potrebbe non dare i dati corretti...

Perché? Cosa c'entra? E se è così, quali altre opzioni ci sono?

 
Madmas:

Perché? Con che cosa ha a che fare?

Non ne ho idea... Fatto questa domanda sul forum - nessuna risposta...

 
Сергей Таболин:

Non ne ho idea... Fatto questa domanda sul forum - nessuna risposta...

Qual è il problema con i dati? Visivamente, sembra corrispondere all'indicatore Volume+MA, ho fatto scorrere la cronologia

 
Сергей Таболин:

Non ne ho idea... Fatto questa domanda sul forum - nessuna risposta...

L'unica differenza è il tipo di dati lungo e doppio

 
Madmas:

L'unica differenza è il tipo di dati long e double

Date un'occhiata a questo. Forse non è un glitch generale, ma è anche teso in un caso particolare...

MT5 :: Где искать ошибку? Или ошибка индикатора, работающего по данным другого индикатора?
MT5 :: Где искать ошибку? Или ошибка индикатора, работающего по данным другого индикатора?
  • 2020.10.13
  • www.mql5.com
Здравствуйте. У меня есть тиковый индикатор, который не привязан ни к какому ТФ. На его основе, я написал советник...
 
I commenti non relativi a questo argomento sono stati spostati in "Domande dai principianti di MQL4 MT4 MetaTrader 4".