• Join us

Operator ERROR

To add comments, please log in or register
mo798ua
104
mo798ua  

HI

im having a bit of problem im facing these errros 

';' - unexpected token

)' - unexpected token

'stopp' - some operator expected

if any one can give hand i will be thankful

void opennew(int ordertype){
    RefreshRates();
    double openprice=0;
    double closeprice=0;
    double stopp=0;
    double takep=0;
    
    if(ordertype==OP_BUY)(
            openprice=Ask;
            stopp=openprice-sl;
            takep=openprice+tp;
        )
    if(ordertype==OP_SELL){
        openprice=Bid;
            stopp=openprice+sl;
            takep=openprice-tp;
    }
    OrderSend(Symbol(),ordertype ,calculateLotSize(sl*10),openprice,10,NormalizeDouble(stopp,Digits),NormalizeDouble(takep,Digits),NULL,0,0,clrBlue);
     
    return;
}

Files:
amando
2396
amando  
mo798ua:

HI

im having a bit of problem im facing these errros 

';' - unexpected token

)' - unexpected token

'stopp' - some operator expected

if any one can give hand i will be thankful


In your buy part you have 

() instead of {} used in the if work

To add comments, please log in or register