same old, good friend - error 130.

 

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);
 
hello my friend ask for buy bid for sell it's easy
 
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);
 

))))))))) 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

 
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.

 

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); 
 
OrderSend(Symbol(),OP_BUY,LotSize,Ask,Slippage,0,0,"BUY",MagicNumber,0,clrGreen); try this
 
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?
 
if it work that mean you calculate sl or tp wrong
 
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!

 
you are welcome
Reason: