iCustom MQL5 return zero when test multitimeframe ....... a shameful anomaly

 

Dear sirs,

this is not a contribution to the forum, this is a scream protest for an unacceptable anomaly of the MT5

invoking a custom indicator is a fundamental operation, it makes for great flexibility in use within an EA, or even just within an indicator. MT4 performs this function without problems.


So it is unacceptable that a platform that defines itself as professional, it happens that the ENUM_TIMEFRAMES parameter is totally unusable and useless, in fact if I try to change Timeframe different by PERIOD_CURRENT, it always returns zero. By crazy.

Maybe I'm ignorant, so someone explain to me what it is for and how I can use this parameter in iCustom ? I would not like "workaround", I would like a native solution, like for MT4.

Please ask for someone to give me support, for those who have solved the problem, let's make sure that the choice to migrate to MT5 is not was a fatal mistake.

Cordiality, Sabino
 
Sabino Martiradonna:

Dear sirs,

this is not a contribution to the forum, this is a scream protest for an unacceptable anomaly of the MT5

invoking a custom indicator is a fundamental operation, it makes for great flexibility in use within an EA, or even just within an indicator. MT4 performs this function without problems.


So it is unacceptable that a platform that defines itself as professional, it happens that the ENUM_TIMEFRAMES parameter is totally unusable and useless, in fact if I try to change Timeframe different by PERIOD_CURRENT, it always returns zero. By crazy.

Maybe I'm ignorant, so someone explain to me what it is for and how I can use this parameter in iCustom ? I would not like "workaround", I would like a native solution, like for MT4.

Please ask for someone to give me support, for those who have solved the problem, let's make sure that the choice to migrate to MT5 is not was a fatal mistake.

Cordiality, Sabino

Actually I ran the example provided in https://www.mql5.com/en/docs/indicators/icustom

Does not return 0 with any of the timeframes I tried - why not give that a try?

Did you get the problem with 0? The documentation says:

[in] The value of the period can be one of the ENUM_TIMEFRAMES values, 0 means the current timeframe.

Documentation on MQL5: Technical Indicators / iCustom
Documentation on MQL5: Technical Indicators / iCustom
  • www.mql5.com
iCustom - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Sabino Martiradonna: Please ask for someone to give me support,
  1. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

    We can't see your broken code.

  2. Sabino Martiradonna: MT4 performs this function without problems.

    Perhaps you should read the manual, especially the examples.
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

    They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick/OnCalculate (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
              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
              How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 (2020)
              How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020)
              MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors - MQL5 Articles (2010)
              How to call indicators in MQL5 - MQL5 Articles (2010)

 
Sabino Martiradonna:

Dear sirs,

this is not a contribution to the forum, this is a scream protest for an unacceptable anomaly of the MT5

invoking a custom indicator is a fundamental operation, it makes for great flexibility in use within an EA, or even just within an indicator. MT4 performs this function without problems.


So it is unacceptable that a platform that defines itself as professional, it happens that the ENUM_TIMEFRAMES parameter is totally unusable and useless, in fact if I try to change Timeframe different by PERIOD_CURRENT, it always returns zero. By crazy.

Maybe I'm ignorant, so someone explain to me what it is for and how I can use this parameter in iCustom ? I would not like "workaround", I would like a native solution, like for MT4.

Please ask for someone to give me support, for those who have solved the problem, let's make sure that the choice to migrate to MT5 is not was a fatal mistake.

Cordiality, Sabino


Thank you for making my laught.

You should not blame and put the responsablilty on Metaquotes when your non professionnal code is boggus.

So help yourself.