implicit conversion from 'number' to 'string' warning - page 3

Jr Morales
10
Jr Morales  

Please help the NEWBIE,  Getting 5 error, 11 warnings and impicit conversion from number to string  error messages.

//+------------------------------------------------------------------+

//|                                                       BBands.mq4 |
//|                                                    |
//|                                        |
//+------------------------------------------------------------------+
#property copyright "Testing"
#property link      "https://www.testing.net"
#property version   "1.00"
#property strict
int bbperiod = 20;
int band1Std = 1;
int band2Std = 4;
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
    {
//---
    Alert("");
    
    double bblower1; = iBands(NULL,0,bbperiod,band1Std,0,PRICE_CLOSE,MODE_LOWER,0);
    double bbupper1; = iBands(NULL,0,bbperiod,band1Std,0,PRICE_CLOSE,MODE_UPPER,0);
    double bbmid; = iBands(NULL,0,bbperiod,band1Std,0,PRICE_CLOSE,0,0);
    
    double bblower2; = iBands(NULL,0,bbperiod,band2Std,0,PRICE_CLOSE,MODE_LOWER,0);
    double bbupper2; = iBands(NULL,0,bbperiod,band2Std,0,PRICE_CLOSE,MODE_UPPER,0);
          
   if(Ask < bblower1)//buying
   {
      Alert("Price is below bblower1, Sending buy order");
      double stopLossPrice = bblower2;
      double takeProfitPrice = bbmid;
      Alert("Stop Loss Price = " + stopLossPrice);
      Alert("Take Profit Price = " + takeProfitPrice);
      
      //Send buy order
   }
   else if(Bid >bbupper1)//shorting
   {
      Alert("Price is above bbupper1, Sending short order");
      double stopLossPrice = bbupper2;
      double takeProfitPrice = bbmid;
      Alert("Entry Price = " + Bid);
      Alert("Stop Loss Price = " + stopLossPrice);
      Alert("Take Profit Price = " + takeProfitPrice);
  //Send short order
}

}

William Roeder
26425
William Roeder  
double bblower1;
= iBands(NULL,0,bbperiod,band1Std,0,PRICE_CLOSE,MODE_LOWER,0);
Does that look correct to you?
Revo Trades
644
Revo Trades  
wow. a response to a newbie without the usual snide remark from him.
William Roeder
26425
William Roeder  
Revo Trades #: wow. a response to a newbie without the usual snide remark from him.

Because he was not rude, ignorant, and insulting unlike you.

Revo Trades
644
Revo Trades  
William Roeder #:

Because he was not rude, ignorant, and insulting unlike you.

pot -- meet kettle! haha

lippmaje
1711
lippmaje  
Jr Morales #:

Please help the NEWBIE,  Getting 5 error, 11 warnings and impicit conversion from number to string  error messages.

Why do you ask for help with such a bad piece of code? Even if we fix it for you, are you really intending to trade with that? I've seen someone who lost all of his account (real money) within 30 seconds due to a malfunctioning EA.

The right answer to your issue is: Learn to code. There's a lot of free tutorials to get started, I'd go with some basic Java  lessions and then MQL tutorials on Youtube.

No offence, but you're probably not getting anywhere if you rely on the forum with these kind of issues.

Alexandre Borela
7088
lippmaje #:

Why do you ask for help with such a bad piece of code? Even if we fix it for you, are you really intending to trade with that? I've seen someone who lost all of his account (real money) within 30 seconds due to a malfunctioning EA.

The right answer to your issue is: Learn to code. There's a lot of free tutorials to get started, I'd go with some basic Java  lessions and then MQL tutorials on Youtube.

No offence, but you're probably not getting anywhere if you rely on the forum with these kind of issues.

His code is clearly a test code and while his mistakes look simple to us, we all have our brain fart moments, beginners will just have more.
The fact the he tried to write a piece of code is already good thing.

Suggesting that he learns Java will only confuse him more because of the garbage collection and syntax differences, specially the idea
where everything has to be inside a class which is bad design of the language itself and leads to a lot of poorly designed applications.