MQ4 Multicurrency Expert Advisor for 10 Currency Pairs

 
Hi Guys? The below ia an MQ4 MultiCurrency Expert Advisor code for 10 Currency Pairs.However, the code compiles with 11 warnings.
Warnings are:return values of 'Order Send' should be checked.Please how should I fix these warnings? Please advise me and I shall 
 appreciate.Thanks!!! 	
void OnTick(){
     //We calculate the Ask price
     // double Ask=NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK),_Digits);
     
     //We calculate the Ask price
     double USDCADAsk=NormalizeDouble(SymbolInfoDouble ("USDCAD",SYMBOL_ASK),_Digits);
     
     //We calculate the Ask price
     double AUDUSDAsk=NormalizeDouble(SymbolInfoDouble ("AUDUSD",SYMBOL_ASK),_Digits);
     
     //We calculate the Ask price
     double NZDUSDAsk=NormalizeDouble(SymbolInfoDouble ("NZDUSD",SYMBOL_ASK),_Digits);
     
     //We calculate the Ask price
     double USDCHFAsk=NormalizeDouble(SymbolInfoDouble ("USDCHF",SYMBOL_ASK),_Digits);
     
     //We calculate the Ask price
     double EURSEKAsk=NormalizeDouble(SymbolInfoDouble ("EURSEK",SYMBOL_ASK),_Digits);
     
        //We calculate the Ask price
     double EURCZKAsk=NormalizeDouble(SymbolInfoDouble ("EURCZK",SYMBOL_ASK),_Digits);  
     
       //We calculate the Ask price
     double EURMXNAsk=NormalizeDouble(SymbolInfoDouble ("EURMXN",SYMBOL_ASK),_Digits);
     
     
     //We calculate the Ask price
     double USDJPYAsk=NormalizeDouble(SymbolInfoDouble ("USDJPY",SYMBOL_ASK),_Digits);
     
       
      //We calculate the Ask price
     double GBPUSDAsk=NormalizeDouble(SymbolInfoDouble ("GBPUSD",SYMBOL_ASK),_Digits);
     
            //We calculate the Bid price
    // double Bid=NormalizeDouble(SymbolInfoDouble (_Symbol,SYMBOL_BID),_Digits);
     
    //We calculate the Bid price
     double USDCADBid=NormalizeDouble(SymbolInfoDouble ("USDCAD",SYMBOL_BID),_Digits);
     
      //We calculate the Bid price
     double AUDUSDBid=NormalizeDouble(SymbolInfoDouble ("AUDUSD",SYMBOL_BID),_Digits);
     
        //We calculate the Bid price
     double NZDUSDBid=NormalizeDouble(SymbolInfoDouble ("NZDUSD",SYMBOL_BID),_Digits);
     
      //We calculate the Bid price
     double USDCHFBid=NormalizeDouble(SymbolInfoDouble ("USDCHF",SYMBOL_BID),_Digits);
     
      //We calculate the Bid price
     double EURSEKBid=NormalizeDouble(SymbolInfoDouble ("EURSEK",SYMBOL_BID),_Digits);
     
      //We calculate the Bid price
     double EURCZKBid=NormalizeDouble(SymbolInfoDouble ("EURCZK",SYMBOL_BID),_Digits);
     
      //We calculate the Bid price
     double EURMXNBid=NormalizeDouble(SymbolInfoDouble ("EURMXN",SYMBOL_BID),_Digits);
     
      //We calculate the Bid price
     double EURCADBid=NormalizeDouble(SymbolInfoDouble ("EURCAD",SYMBOL_BID),_Digits);
     
     
          //We calculate the Bid price
     double USDJPYBid=NormalizeDouble(SymbolInfoDouble ("USDJPY",SYMBOL_BID),_Digits);   
     
          //We calculate the Bid price
     double GBPUSDBid=NormalizeDouble(SymbolInfoDouble( "GBPUSD",SYMBOL_BID),_Digits);       
     
     //We create a string variable for the signal
        string signal= " ";
     
        //initialize the random generator
       MathSrand(GetTickCount());
       
       //calculate the random number
       double RandomNumber=MathRand()%2;
       
         //if random number is 0 it is a buy signal 
          if(RandomNumber==0)signal="buy";
     
     
         //if random number is 1 it is a sell signal 
          if(RandomNumber==1)signal="sell";
          
              //buy signal
          if(signal=="buy")
             if(OrdersTotal()==0)
            {
             
         OrderSend(_Symbol,OP_SELL,0.10,Bid,3,0,Bid-150* _Point,NULL,0,0,Red);   
               
              OrderSend("GBPUSD",OP_SELL,0.10,GBPUSDBid,3,0,GBPUSDBid-150* _Point,NULL,0,0,Red);
              OrderSend("AUDUSD",OP_SELL,0.10,AUDUSDBid,3,0,AUDUSDBid-150* _Point,NULL,0,0,Red);
              OrderSend("NZDUSD",OP_SELL,0.10,NZDUSDBid,3,0,NZDUSDBid-150* _Point,NULL,0,0,Red);
              OrderSend("USDCHF",OP_SELL,0.10,USDCHFBid,3,0,USDCHFBid-150* _Point,NULL,0,0,Red);
              OrderSend("EURSEK",OP_SELL,0.10,EURSEKBid,3,0,EURSEKBid-150* _Point,NULL,0,0,Red);
              OrderSend("EURCZK",OP_SELL,0.10,EURCZKBid,3,0,EURCZKBid-150* _Point,NULL,0,0,Red);
              OrderSend("EURMXN",OP_SELL,0.10,EURMXNBid,3,0,EURMXNBid-150* _Point,NULL,0,0,Red);
               OrderSend("EURCAD",OP_SELL,0.10,EURCADBid,3,0,EURCADBid-150* _Point,NULL,0,0,Red);
              OrderSend("USDJPY",OP_SELL,0.10,USDJPYBid,3,0,GBPUSDBid-150* _Point,NULL,0,0,Red); 
              OrderSend("USDCAD",OP_SELL,0.10,USDCADBid,3,0,USDCADBid-150* _Point,NULL,0,0,Red);
 
          //Chart output for the signal
            Comment("The current signal is: ","signal","\n", "The current symbol is: ","Symbol");
                  
  }
 }
    
 
JESSE TANU:

Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.

 
  1. JESSE TANU: return values of 'Order Send' should be checked.Please how should I fix these warnings?

    So check them, duh! Check your return codes, and report your errors (including market prices and your variables). Don't look at GLE/LE unless you have an error. Don't just silence the compiler (MT5/MT4+strict), it is trying to help you.
              What are Function return values ? How do I use them ? - MQL4 programming forum (2012)

  2. double USDCADBid=NormalizeDouble(SymbolInfoDouble ("USDCAD",SYMBOL_BID),_Digits);

    You can not use any predefine variables. Those are the current chart symbol only.

  3. Prices you get from the terminal are already normalized.

  4. OrderSend(_Symbol,OP_SELL,0.10,Bid,3,0,Bid-150* _Point,NULL,0,0,Red);   

    You buy at the Ask and sell at the Bid. Pending Buy Stop orders become market orders when hit by the Ask.

    1. Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?

    2. Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger close at a specific Bid price, add the average spread.
                MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25

    3. The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)

      Most brokers with variable spreads widen considerably at end of day (5 PM ET) ± 30 minutes.
      My GBPJPY shows average spread = 26 points, average maximum spread = 134.
      My EURCHF shows average spread = 18 points, average maximum spread = 106.
      (your broker will be similar).
                Is it reasonable to have such a huge spreads (20 PIP spreads) in EURCHF? - General - MQL5 programming forum (2022)