Strange error related with declaring global variable in Metaeditor

 

Dear all,

please help me with an issue I faced in the very beginning of my code.

Please, have a look at the image below.

When I try to declare a global variable  (type bool) and compile the program, I receive a strange error: 'bool' - name expected

I tried to search more info about that error in the net, so I found its code - 282.


Unfortunately, there is almost no information how should I fix it.

Even if I assign it true or false condition the error still appears.


My question would be, is it some general error that will cause my code not working properly and needs to be fixed or I can live with such errors.



Please, see the code below... almost no rows but still error.


//--- input parameters

input int      StopLoss = 30;

input double   Lots = 0.1;

input int      TakeProfit = 100;

input bool     UseMoneyManagement = true;

input double   RiskPercent = 2;


//--- include files and libraries

#include <Trade\Trade.mqh>

#include <Breakthrough.mqh>

#include <Trade\SymbolInfo.mqh>


//--- declare global variables

bool isBuyPlaced;

bool isSellPlaced;


#define ABC "123"

int OnInit()

  { 

  return(0);

  }

void OnDeinit(const int reason)

  {

  }

void OnTick()

  {

  }


Thanks in advance

 

Please use the </> button to insert your code.


 
//--- input parameters
input int      StopLoss = 30;
input double   Lots = 0.1;
input int      TakeProfit = 100;
input bool     UseMoneyManagement = true;
input double   RiskPercent = 2;

//--- include files and libraries
#include <Trade\Trade.mqh>
#include <Breakthrough.mqh>
#include <Trade\SymbolInfo.mqh>

//--- declare global variables
bool isBuyPlaced;
bool isSellPlaced;

//--- declare constants
#define ABC "123"

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  { 
  
  return(0);
  
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  
  }
//+------------------------------------------------------------------+


 
  1. When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum

    You should have edited your original post.
              Messages Editor

  2. Thanks, for the prompt reply.
    Please, see it below
    
    Hopefully, someone could explain why this error appears.
    Please don't add text inside quoted text or CODE blocks, put it outside.
              MQL4 forum editor problem - MQL4 and MetaTrader 4 - MQL4 programming forum

 
thedeathkiss:

Dear all,

please help me with an issue I faced in the very beginning of my code.

Please, have a look at the image below.

When I try to declare a global variable  (type bool) and compile the program, I receive a strange error: 'bool' - name expected

I tried to search more info about that error in the net, so I found its code - 282.


Unfortunately, there is almost no information how should I fix it.

Even if I assign it true or false condition the error still appears.


My question would be, is it some general error that will cause my code not working properly and needs to be fixed or I can live with such errors.



Please, see the code below... almost no rows but still error.


//--- input parameters

input int      StopLoss = 30;

input double   Lots = 0.1;

input int      TakeProfit = 100;

input bool     UseMoneyManagement = true;

input double   RiskPercent = 2;


//--- include files and libraries

#include <Trade\Trade.mqh>

#include <Breakthrough.mqh>

#include <Trade\SymbolInfo.mqh>


//--- declare global variables

bool isBuyPlaced;

bool isSellPlaced;


#define ABC "123"

int OnInit()

  { 

  return(0);

  }

void OnDeinit(const int reason)

  {

  }

void OnTick()

  {

  }


Thanks in advance

weird, try adding _ before name like _isBuy

 
thedeathkiss:


Check the Breakthrough.mqh file.
 
Alain Verleyen:
Check the Breakthrough.mqh file.

This. It's definitely an error in one of the includes, and most likely not one from the STL, unless OP has modded them. 

 

Solved.

Thanks to all of you guys!

Really, appreciate it!

Reason: