Help My code is very easy and not works Help.. Error = 129

 

T.T Moderator this the code and not works....I not idea what do? Help T.T

Try.....

1.

RefreshRates();

2.

int count = 0;
while ((result == -1) && (count < 10))

{

RefreshRates();

result = OrderSend(...)

count++;

}

3.

OpenPrice = NormalizeDouble(OpenPrice,5);
OrderSend(Symbol(), OP_BUY, 1, OpenPrice,...);


#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{

RefreshRates();
OrderSend(Symbol(),OP_BUY,0.1,Bid,5,Bid-(500*Point),NULL);
Alert("Error = ",GetLastError());
return(0);
}

//+------------------------------------------------------------------+

 

Post the code by attaching the MQ4 file

Say what its supposed to do

Say any errors seen

-BB-

 
  1. OrderSend(Symbol(),OP_BUY,0.1,Bid,5,Bid-(500*Point),NULL);

    Buy: Open at the Ask close at the Bid.

    Sell: Open at the Bid close at the Ask.


  2. EA's should adjust for 5 digit brokers, TP, SL, AND slippage. On ECN brokers you must open and THEN set stops

    //++++ These are adjusted for 5 digit brokers.
    int     pips2points;    // slippage  3 pips    3=points    30=points
    double  pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
    int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
    int     init(){
        if (Digits == 5 || Digits == 3){    // Adjust for five (5) digit brokers.
                    pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
        } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
        // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
    
Reason: