Download MetaTrader 5
To add comments, please log in or register
Do you need a trading robot? Orderit via Freelance service!
MetaQuotes Software Corp.
Moderator
177072
MetaQuotes Software Corp. 2014.03.10 09:32 

exad...:

My first exad.....comment if any not modified and improve ment running..

Author: jkp2277

magikrat
11
magikrat 2014.03.12 13:57  
I tried testing on MT4 Build 610 but I just get Ordersend error 130 over and over
MQL4 Comments
16309
MQL4 Comments 2014.03.20 16:03  

magikrat:I get the same error 130 too. It's about an illegal stop. I used the same pair, time frame and parameters and get this error.


I tried testing on MT4 Build 610 but I just get Ordersend error 130 over and over
Fernando Carreiro
1428
Fernando Carreiro 2014.03.24 15:36  
magikrat: I tried testing on MT4 Build 610 but I just get Ordersend error 130 over and over
9149: I get the same error 130 too. It's about an illegal stop. I used the same pair, time frame and parameters and get this error.

Unfortunately this code does not adjust for 5 digit brokers and does not check minimum stop levels, so using the original settings as is, will most probably fail.

You will have to adjust the parameters accordingly with this in mind.

Also, it uses hard coded timeframe signals and the code is somewhat flawed, so be careful and do not use this EA on a real account.

I leave a recommendation for the author, that he address these issues and polish up the code, as it is very crude.

MQL4 Comments
16309
MQL4 Comments 2014.03.26 18:43  
magikrat:
I tried testing on MT4 Build 610 but I just get Ordersend error 130 over and over

the error depend from a mistake in the code:

//Buy

if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

if(!IsTrade) {

//Check free margin

if (AccountFreeMargin() < (1000 * Lots)) {

Print("We have no money. Free Margin = ", AccountFreeMargin());

return(0);

}


if (UseStopLoss) StopLossLevel =Ask - StopLoss * Point; else StopLossLevel = 0.0; the correct code is : Bid - StopLoss * Point; else StopLossLevel = 0.0;

if (UseTakeProfit) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;


Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

if(Ticket > 0) {

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {

Print("BUY order opened : ", OrderOpenPrice());

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");

} else {

Print("Error opening BUY order : ", GetLastError());

}

}

if (EachTickMode) TickCheck = True;

if (!EachTickMode) BarCount = Bars;

return(0);

}

}

the same from sell

magikrat
11
magikrat 2014.03.12 13:57  
I tried testing on MT4 Build 610 but I just get Ordersend error 130 over and over
MQL4 Comments
16309
MQL4 Comments 2014.03.20 16:03  

magikrat:I get the same error 130 too. It's about an illegal stop. I used the same pair, time frame and parameters and get this error.


I tried testing on MT4 Build 610 but I just get Ordersend error 130 over and over
Fernando Carreiro
1428
Fernando Carreiro 2014.03.24 15:36  
magikrat: I tried testing on MT4 Build 610 but I just get Ordersend error 130 over and over
9149: I get the same error 130 too. It's about an illegal stop. I used the same pair, time frame and parameters and get this error.

Unfortunately this code does not adjust for 5 digit brokers and does not check minimum stop levels, so using the original settings as is, will most probably fail.

You will have to adjust the parameters accordingly with this in mind.

Also, it uses hard coded timeframe signals and the code is somewhat flawed, so be careful and do not use this EA on a real account.

I leave a recommendation for the author, that he address these issues and polish up the code, as it is very crude.

MQL4 Comments
16309
MQL4 Comments 2014.03.26 18:43  
magikrat:
I tried testing on MT4 Build 610 but I just get Ordersend error 130 over and over

the error depend from a mistake in the code:

//Buy

if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

if(!IsTrade) {

//Check free margin

if (AccountFreeMargin() < (1000 * Lots)) {

Print("We have no money. Free Margin = ", AccountFreeMargin());

return(0);

}


if (UseStopLoss) StopLossLevel =Ask - StopLoss * Point; else StopLossLevel = 0.0; the correct code is : Bid - StopLoss * Point; else StopLossLevel = 0.0;

if (UseTakeProfit) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;


Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

if(Ticket > 0) {

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {

Print("BUY order opened : ", OrderOpenPrice());

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");

} else {

Print("Error opening BUY order : ", GetLastError());

}

}

if (EachTickMode) TickCheck = True;

if (!EachTickMode) BarCount = Bars;

return(0);

}

}

the same from sell

/
To add comments, please log in or register