i have this error 'if' - expressions are not allowed on a global scope

 

 Hi.

please i have this error in the place highlighted red, how do i solve it

//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//-------------------------------------------------------------------+
if(Strategy_1==true){
{
STEP=Step*MathPow(StepMultiplier,buy);
if(buy>0 && NormalizeDouble(Ask,Digits)<=NormalizeDouble((buy_open-(STEP*M*Point)),Digits) && New_Bar==true)
{
 L=NormalizeDouble((buy_lot*LotMultiplier),Digits);
 int tb1=OrderSend(Symbol(), OP_BUY, L, Ask, 2, 0, 0, Com, MagicNumber, 0, clrBlue);
 Sleep(1500);
 RefreshRates();
 B_TP=NormalizeDouble((Buy_Breakeven(MagicNumber)+TP*M*Point), Digits);
 Buy_Modify(MagicNumber, B_TP);
//  Alert("B_BE= ",B_BE);
 // Alert("Close Price= ",NormalizeDouble((B_BE+(Breakeven*M*Point)),Digits));
}
//+----------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------

 
profedet:

 Hi.

please i have this error in the place highlighted red, how do i solve it 

 


You obviously don't have that code inside a function, hence it's appearing in the global scope. You need to put it either in it's own dedicated function or within the Init/Start function
 

Okay,

will do that.

Thanks a million 

Reason: