Download MetaTrader 5

One ea multiple currencies dashboard

To add comments, please log in or register
g97iulio
221
g97iulio  

i wrote this code and i would like to know if it will work or not. Thank you very much .

//Dashboard Symbols

   count=count+1;

   if(count==1)

     {

      i="EURUSD";

     }



   if(count==2)

     {

      i="GBPUSD";

     }



   if(count==3)

     {

      i="USDJPY";

     }



   if(count==4)

     {

      i="USDCHF";

     }



   if(count==5)

     {

      i="AUDUSD";

     }

   if(count==6)

     {

      i="AUDCAD";

     }



   if(count==7)

     {

      i="AUDCHF";

     }



   if(count==8)

     {

      i="AUDJPY";

     }



   if(count==9)

     {

      i="AUDNZD";

     }



   if(count==10)

     {

      i="EURAUD";

     }

   if(count==11)

     {

      i="EURCAD";

     }



   if(count==12)

     {

      i="EURCHF";

     }



   if(count==13)

     {

      i="EURGBP";

     }



   if(count==14)

     {

      i="EURJPY";

     }



   if(count==15)

     {

      i="EURNZD";

     }

   if(count==16)

     {

      i="GBPAUD";

     }



   if(count==17)

     {

      i="GBPCAD";

     }



   if(count==18)

     {

      i="GBPCHF";

     }

.....

double s05k=iStochastic(i,PERIOD_M5,InpKPeriod,InpDPeriod,InpSlowing,MODE_SMA,0,MODE_MAIN,0);

......
Marco vd Heijden
Moderator
5660
Marco vd Heijden  

If i is a string then yes.

And you can also do it the other way around:

  for(int i=0;i<SymbolsTotal(1);i++)
     {
      Print("SYMBOL: ",SymbolName(i,1)," Found At: ",i);
     }
g97iulio
221
g97iulio  
Marco vd Heijden:

If i is a string then yes.


yes it is thank you . Another little question please (if i can of course ) : i have this indicator (i will attach it) that seems to have bufer=0, for bearish, buffer=1 for bullish. So i use icustom like this    

double pindown=iCustom(NULL,PERIOD_CURRENT,"PinBar",0,0);
double pindown=iCustom(NULL,PERIOD_CURRENT,"PinBar",1,0);


 But it doesn't work , why ?

Files:
PinBar.mq4 21 kb
Marco vd Heijden
Moderator
5660
Marco vd Heijden  

If it isn't working find out by printing all buffer values to see when something changes at what time and etc.

Print("Buffer 0: ",iCustom(Symbol(),PERIOD_CURRENT,"PinBar",0,0));
Print("Buffer 1: ",iCustom(Symbol(),PERIOD_CURRENT,"PinBar",1,0));
Print("Buffer 2: ",iCustom(Symbol(),PERIOD_CURRENT,"PinBar",2,0));
Print("Buffer 3: ",iCustom(Symbol(),PERIOD_CURRENT,"PinBar",3,0));
Print("Buffer 4: ",iCustom(Symbol(),PERIOD_CURRENT,"PinBar",4,0));
Print("Buffer 5: ",iCustom(Symbol(),PERIOD_CURRENT,"PinBar",5,0));
Print("Buffer 6: ",iCustom(Symbol(),PERIOD_CURRENT,"PinBar",6,0));
Print("Buffer 7: ",iCustom(Symbol(),PERIOD_CURRENT,"PinBar",7,0));
Osama Shaban
1624
Osama Shaban  

If you search for Daily forex signal indicator "mq4 version", you will get very clear idea from the code.

Sorry, I got painful back pain. Can't go in details for the time being.

But that indicator is really will tell you all the story.

Good luck.

honest_knave
Moderator
2318
honest_knave  
g97iulio:


yes it is thank you . Another little question please (if i can of course ) : i have this indicator (i will attach it) that seems to have bufer=0, for bearish, buffer=1 for bullish. So i use icustom like this    


 But it doesn't work , why ?


There is no point checking the current bar (0) with iCustom and this indicator:

int start()
{
   int NeedBarsCounted;
   double NoseLength, NoseBody, LeftEyeBody, LeftEyeLength;

   if (LastBars == Bars) return(0);
   NeedBarsCounted = Bars - LastBars;
   if ((CountBars > 0) && (NeedBarsCounted > CountBars)) NeedBarsCounted = CountBars;
   LastBars = Bars;
   if (NeedBarsCounted == Bars) NeedBarsCounted--;

   for (int i = NeedBarsCounted; i >= 1; i--)
   {

Try checking an earlier bar instead

whroeder1
16096
whroeder1  
g97iulio: i wrote this code and i would like to know if it will work or not.
//Dashboard Symbols

   count=count+1;

   if(count==1)

     {

      i="EURUSD";

     }
:
.....
Simplified
//Dashboard Symbols
const string pairs[] = {"EURUSD", "GBPUSD", "USDJPY", "USDCHF",
                        "AUDUSD", "AUDCAD", "AUDCHF", "AUDJPY",
                        "AUDNZD", "EURAUD", "EURCAD", "EURCHF",
                        "EURGBP", "EURJPY", "EURNZD", "GBPAUD",
                        "GBPCAD", "GBPCHF"};
i = pairs[count++];
.....





g97iulio
221
g97iulio  
whroeder1:
Simplified





oh thank you very much .
To add comments, please log in or register