iMACD parameters on MQL5 - page 2

 
for(int s=0;s<SymbolsTotal(false);s++){
Print(SymbolName(s,0));
}
There can be many dead symbolnames on the server they are frozen and do not have a active price feed.
 
Marco vd Heijden:
There can be many dead symbolnames on the server they are frozen and do not have a active price feed.

Look it in a simpler way, I'm having no signals.

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart(){
   double Main[],Signal[];
   ArraySetAsSeries(Main,true);
   ArraySetAsSeries(Signal,true);
   for(int i=0;i<SymbolsTotal(true);i++){
      string SName=SymbolName(i,true);
      int MACD=iMACD(SName,PERIOD_H4,12,26,9,PRICE_CLOSE);
      CopyBuffer(MACD,0,0,100,Main);CopyBuffer(MACD,0,0,100,Signal);
      if(Main[1]<0&&Main[1]>Signal[1]){Alert(SName," BUY");}
      if(Main[1]>0&&Main[1]<Signal[1]){Alert(SName," SELL");}
      }
   }
 

You are not handling possible errors.

Check if MACD is != INVALID_HANLDE and copybuffer>0.

And also, you are copying the same buffer to both Main and Signal.

 

https://www.mql5.com/en/articles/81

About 3/4 through there is an example of MQL4 vs MQL5 

Migrating from MQL4 to MQL5
Migrating from MQL4 to MQL5
  • www.mql5.com
Practical Application Of Databases For Markets Analysis Working with data has become the main task for modern software - both for standalone and network applications. To solve this problem a specialized software were created. These are Database Management Systems (DBMS), that can structure, systematize and organize data for their computer...
 
Fabio Cavalloni:

You are not handling possible errors.

Check if MACD is != INVALID_HANLDE and copybuffer>0.

How I do this, please?
 
Fabio Cavalloni:

You are not handling possible errors.

Check if MACD is != INVALID_HANLDE and copybuffer>0.

And also, you are copying the same buffer to both Main and Signal.

Read it.

 
Fabio Cavalloni:

Read it.

Ok, that's the fail. I got it, very thank you Fabio and Marco.
 

You made a script maybe you used the wrong template.

Try again with the indicator template.

 
Marco vd Heijden:

You made a script maybe you used the wrong template.

Try again with the indicator template.

It seems too complicated, must be an easier way.

 
Yes build an EA directly.
Reason: