filter symbols to find signal

 

is it possible to make expert or script to search all symbols with special conditions and filter them and show in market watch or anywhere else?if yes how?

for example i want to filter symbols to show me symbols by macd best postion to buy.

 
Mahdi Khoshroo:

is it possible to make expert or script to search all symbols with special conditions and filter them and show in market watch or anywhere else?if yes how?

for example i want to filter symbols to show me symbols by macd best postion to buy.

Yes, it's possible, the best solution is to develop an indicator for this, instead of EA or script, since EA is better to trade single symbol.

 
Mohammad Hossein Sadeghi:

Yes, it's possible, the best solution is to develop an indicator for this, instead of EA or script, since EA is better to trade single symbol.

but how ?how can i apply this to all symbols by code?
 
Mahdi Khoshroo:
but how ?how can i apply this to all symbols by code?

You can make use of the functions here: https://www.mql5.com/en/docs/marketinformation and https://www.mql5.com/en/docs/series.

Documentation on MQL5: Market Info
Documentation on MQL5: Market Info
  • www.mql5.com
Market Info - Reference on algorithmic/automated trading language for MetaTrader 5
 
Mahdi Khoshroo:

is it possible to make expert or script to search all symbols with special conditions and filter them and show in market watch or anywhere else?if yes how?

for example i want to filter symbols to show me symbols by macd best postion to buy.

Yes it is possible,

To get the name of all the symbols in the market watch, use SymbolsTotal() in a loop like this:

  string  arrSymbols[];
     for(int j=0;j<=SymbolsTotal(true)-1;j++)
           { 
                arrSymbols[j]=SymbolName(j,true);
           }

And function for filter like this:

string Chiko_Filter(string symbol,int period,int shift) {

 if( iIchimoku(symbol,period,InpTenkan,InpKijun,InpSenkou,MODE_CHIKOUSPAN,shift)< iLow(symbol,period,shift))

     return "bear";

 else if( iIchimoku(symbol,period,InpTenkan,InpKijun,InpSenkou,MODE_CHIKOUSPAN,shift)>iHigh(symbol,period,shift)

     return "bull";

  return "no signal"; 

}

At the end check symbols by a function and put the results in an other array:

   int intPeriod=Period();
   string  arrSignals[];
   int intShift=0;  //Current candle;
     for(int j=0;j<=SymbolsTotal(true)-1;j++)
           { 
               if(Chiko_Filter(arrSymbols[j],intPeriod,shift)=="bull")
                  arrSignals[j]="bull";
               else if(Chiko_Filter(arrSymbols[j],intPeriod,shift)=="bear")
                  arrSignals[j]="bear";
               else                   
                  arrSignals[j]="no signal";
           }

Of course you can also check all the time-frames

I don't think the details needed.

 
Seyedfazel Hosseini:

Yes it is possible,

To get the name of all the symbols in the market watch, use SymbolsTotal() in a loop like this:

And function for filter like this:

At the end check symbols by a function and put the results in an other array:

Of course you can also check all the time-frames

I don't think the details needed.

Thanks a lot.