Loading Signals Indicators in mql5 iCustom

 

Please tell us.

I am using a translation tool to convert the data into English.

Is it possible to load a single signal indicator into iCustom, for example, a buy signal when SMA20 and SMA80 cross golden and a sell signal when they cross dead?
I was able to do this in mql4, but not in mql5, so I asked this question.
Thank you very much for your help.
 

https://www.mql5.com/ja/docs/indicators/icustom

Look at the sample program.

It read SMA21 into "Label1Buffer" with "iCustom" function.

MQL5のドキュメンテーション: テクニカル指標 / iCustom
MQL5のドキュメンテーション: テクニカル指標 / iCustom
  • www.mql5.com
iCustom - テクニカル指標 - MQL5 リファレンス - MetaTrader 5 のためのアルゴリズムの/自動化されたトレーディング言語のリファレンス
 
Thank you for your reply.
I looked at the reference but it didn't tell me what I wanted to know, so I put it on the forum.

In mql5 you get it as a handle.
Do I just read the indicator in iCustom and then select the buffer number in CopyBuffer?

I tried that, but it didn't work.
Some excerpts

OnInit()
//--- create handle
   h_UP = iCustom(_Symbol, PERIOD_CURRENT, indiname);
   if(h_UP==INVALID_HANDLE) {
      Print("Error INVALID_HANDLE h_UP - error:",GetLastError(),"!!");
      return INIT_FAILED;
   }


OnCalculate()
//---
   if(CopyBuffer(h_UP, 0, 0, count, _UP)<0){
      Alert("Error copying UPsig indicator Buffers - error:",GetLastError(),"!!");
      return 0;
   }
   if(CopyBuffer(h_UP, 1, 0, count, _DN)<0){
      Alert("Error copying DNsig indicator Buffers - error:",GetLastError(),"!!");
      return 0;
   }
 
e_mql_hiyoko:
Do I just read the indicator in iCustom and then select the buffer number in CopyBuffer?

That's right.

I made a sample program to display the MACD in MT5. There is absolutely nothing wrong with it.

(You can omit the input parameters)

Files:
 

Thank you for the sample code.


I have tried everything.

I was able to load the signatures in the same place as the UP/DN original sign indicator!

Thank you very much!


Is it possible to omit parameters?

Now I have to comment out the external parameters and enter the values respectively, as it is a self-made sign indicator.

Does this mean that when I load the file in iCutome, I can just use the file name and leave out the external parameters of the sign indicator?

 
MACD_handle = iCustom(NULL, 0, "Examples\\MACD");

In this case, the default input value of the original indicator will be used.

MACD_handle = iCustom(NULL, 0, "Examples\\MACD", InpFastEMA, InpSlowEMA, InpSignalSMA,InpAppliedPrice);

In this case, the input value of the iCustom indicator will be used. (InpFastEMA..... are input parameters in the iCustom indicator)

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
 

Thank you very much for your kind attention.

 I understand now! :)