Download MetaTrader 5

same old, good friend - error 130.

To add comments, please log in or register
Find out how to install MetaTrader on Mac OS
Nauris Mucenieks
839
Nauris Mucenieks 2015.04.21 13:40 

but im starting to rip my hair out.

i might actually say ive tried everything - removed TP,SL, edited prices, Asks, Bids, all of it.

i still get it - my fave' - error 130.


could some good ol' chap point my mistake out here, please?

i tried to compare it with a bunch of other lines, and codes, and orders and everything - i just dont see the difference there.

so, what im trying to get it to do, is when a condition is triggered it sends out an order with these settings.


 if(nBuy  >  nSell  )
        OrderSend(Symbol(),OP_SELL,LotSize,Ask,Slippage,TP,0,clrGreen);
    if(nSell  >  nBuy )     
        OrderSend(Symbol(),OP_BUY,LotSize,Bid,Slippage,TP,0,clrGreen);
Aleksei Beliakov
24391
Aleksei Beliakov 2015.04.21 13:53  
hello my friend ask for buy bid for sell it's easy
Nauris Mucenieks
839
Nauris Mucenieks 2015.04.21 13:54  
goverkms:
hello my friend ask for buy bid for sell it's easy

hey there.

i switched them, forgot to switch back - same thing.


heres the full code.


 if(KICKER){
  if(AccountEquity()<=accountbalance-(accountbalance/100*KICKER_Percent)){
     first=true;
                 Print(" KICKER ");

     

   if(nBuy  >  nSell  )
        OrderSend(Symbol(),OP_SELL,LotSize,Bid,Slippage,TP,0,clrGreen);
     
  if (nSell  >  nBuy )     
        OrderSend(Symbol(),OP_BUY,LotSize,Ask,Slippage,TP,0,clrGreen);
Aleksei Beliakov
24391
Aleksei Beliakov 2015.04.21 13:56  

))))))))) so lot of mistakes in one line

int  OrderSend(
   string   symbol,              // symbol
   int      cmd                // operation
   double   volume,              // volume
   double   price,               // price
   int      slippage,            // slippage
   double   stoploss           // stop loss
   double   takeprofit,          // take profit
   string   comment=NULL,        // comment
   int      magic=0            // magic number
   datetime expiration=0,        // pending order expiration
   color    arrow_color=clrNONE  // color

   );


you use TP instead SL

Nauris Mucenieks
839
Nauris Mucenieks 2015.04.21 13:58  
goverkms:

))))))))) so lot of mistakes in one line

int  OrderSend(
   string   symbol,              // symbol
   int      cmd                // operation
   double   volume,              // volume
   double   price,               // price
   int      slippage,            // slippage
   double   stoploss           // stop loss
   double   takeprofit,          // take profit
   string   comment=NULL,        // comment
   int      magic=0            // magic number
   datetime expiration=0,        // pending order expiration
   color    arrow_color=clrNONE  // color

   );


you use TP instead SL

i know..

eh. guess you cant just skip a few lines..

alright, ill try to compile it anew.


thanks.

Nauris Mucenieks
839
Nauris Mucenieks 2015.04.21 14:03  

well, i made it like this :

same 130.

   if(nBuy  >  nSell  )
        OrderSend(Symbol(),OP_SELL,LotSize,Bid,Slippage,close_d,TP,"SELL",MagicNumber,0,clrGreen);
     
  if (nSell  >  nBuy )     
        OrderSend(Symbol(),OP_BUY,LotSize,Ask,Slippage,close_d,TP,"BUY",MagicNumber,0,clrGreen); 
Aleksei Beliakov
24391
Aleksei Beliakov 2015.04.21 14:05  
OrderSend(Symbol(),OP_BUY,LotSize,Ask,Slippage,0,0,"BUY",MagicNumber,0,clrGreen); try this
Nauris Mucenieks
839
Nauris Mucenieks 2015.04.21 14:09  
goverkms:
OrderSend(Symbol(),OP_BUY,LotSize,Ask,Slippage,0,0,"BUY",MagicNumber,0,clrGreen); try this
hmm, 0 on TP and/or SL will disable them?
Aleksei Beliakov
24391
Aleksei Beliakov 2015.04.21 14:10  
if it work that mean you calculate sl or tp wrong
Nauris Mucenieks
839
Nauris Mucenieks 2015.04.21 14:13  
goverkms:
if it work that mean you calculate sl or tp wrong

yeah, i figured. thats a bit weird, because im using the same old calculations in the EA.


well, hey, big thanks!

Aleksei Beliakov
24391
Aleksei Beliakov 2015.04.21 14:18  
you are welcome
12
To add comments, please log in or register