Hi everyone,
I am seeking help with my EA. I just created a simple EA just to see how trades are executed in an EA. the whole EA just places market orders and then market closes them. Plain and Simple.... until i'm HIT with Error Code 130.
I've read almost every help i can find, even cut and paste codes of others, followed the MQL tutorial format, and it still fails.
This problem only occurs when i input "values" as part of the StopLoss and TakeProfit arguments in the OrderSend() function. However, if i hard-code them to "0", the order is successful.
I've read somewhere that it could also be due to error in the values of SL or TP but both values are 300 pips away, so how could it be in error?
Please help me out here. Thank You.
Attached is my mql file.
For an example, when i ran this file, it will produce this output in the Expert Tab:
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
23:11:09 StupidOrderFunctions EURUSD,M1: loaded successfully
23:11:10 StupidOrderFunctions EURUSD,M1: Trade allowed
23:11:10 StupidOrderFunctions EURUSD,M1: initialized
23:11:15 StupidOrderFunctions EURUSD,M1: Bid:1.23055 Ask:1.23077 StopLoss:1.22755 TakeProfit:1.23355
23:11:15 StupidOrderFunctions EURUSD,M1: Trade -1 open: 2012.07.06 15:11:00 Buy EURUSD 0.1 Lots @ 1.23077 TP= 1.23377 SL= 1.22777
23:11:15 StupidOrderFunctions EURUSD,M1: OrderSend failed with error #130
23:11:46 StupidOrderFunctions EURUSD,M1: Bid:1.23036 Ask:1.23058 StopLoss:1.23358 TakeProfit:1.22758
23:11:46 StupidOrderFunctions EURUSD,M1: Trade -1 open: 2012.07.06 15:11:00 Sell EURUSD 0.1 Lots @ 1.23036 TP= 1.22736 SL= 1.23336
23:11:46 StupidOrderFunctions EURUSD,M1: OrderSend failed with error #130
23:12:17 StupidOrderFunctions EURUSD,M1: Bid:1.23043 Ask:1.23063 StopLoss:1.22743 TakeProfit:1.23343
23:12:17 StupidOrderFunctions EURUSD,M1: Trade -1 open: 2012.07.06 15:12:00 Buy EURUSD 0.1 Lots @ 1.23063 TP= 1.23363 SL= 1.22763
23:12:17 StupidOrderFunctions EURUSD,M1: OrderSend failed with error #130
23:12:48 StupidOrderFunctions EURUSD,M1: Bid:1.23052 Ask:1.23074 StopLoss:1.23374 TakeProfit:1.22774
23:12:48 StupidOrderFunctions EURUSD,M1: Trade -1 open: 2012.07.06 15:12:00 Sell EURUSD 0.1 Lots @ 1.23052 TP= 1.22752 SL= 1.23352
23:12:48 StupidOrderFunctions EURUSD,M1: OrderSend failed with error #130
23:12:53 StupidOrderFunctions EURUSD,M1: EA Terminated
23:12:53 StupidOrderFunctions EURUSD,M1: deinitialized
23:12:53 StupidOrderFunctions EURUSD,M1: uninit reason 1
23:12:53 StupidOrderFunctions EURUSD,M1: removed
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
I am seeking help with my EA. I just created a simple EA just to see how trades are executed in an EA. the whole EA just places market orders and then market closes them. Plain and Simple.... until i'm HIT with Error Code 130.
I've read almost every help i can find, even cut and paste codes of others, followed the MQL tutorial format, and it still fails.
This problem only occurs when i input "values" as part of the StopLoss and TakeProfit arguments in the OrderSend() function. However, if i hard-code them to "0", the order is successful.
I've read somewhere that it could also be due to error in the values of SL or TP but both values are 300 pips away, so how could it be in error?
Please help me out here. Thank You.
Attached is my mql file.
For an example, when i ran this file, it will produce this output in the Expert Tab:
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
23:11:09 StupidOrderFunctions EURUSD,M1: loaded successfully
23:11:10 StupidOrderFunctions EURUSD,M1: Trade allowed
23:11:10 StupidOrderFunctions EURUSD,M1: initialized
23:11:15 StupidOrderFunctions EURUSD,M1: Bid:1.23055 Ask:1.23077 StopLoss:1.22755 TakeProfit:1.23355
23:11:15 StupidOrderFunctions EURUSD,M1: Trade -1 open: 2012.07.06 15:11:00 Buy EURUSD 0.1 Lots @ 1.23077 TP= 1.23377 SL= 1.22777
23:11:15 StupidOrderFunctions EURUSD,M1: OrderSend failed with error #130
23:11:46 StupidOrderFunctions EURUSD,M1: Bid:1.23036 Ask:1.23058 StopLoss:1.23358 TakeProfit:1.22758
23:11:46 StupidOrderFunctions EURUSD,M1: Trade -1 open: 2012.07.06 15:11:00 Sell EURUSD 0.1 Lots @ 1.23036 TP= 1.22736 SL= 1.23336
23:11:46 StupidOrderFunctions EURUSD,M1: OrderSend failed with error #130
23:12:17 StupidOrderFunctions EURUSD,M1: Bid:1.23043 Ask:1.23063 StopLoss:1.22743 TakeProfit:1.23343
23:12:17 StupidOrderFunctions EURUSD,M1: Trade -1 open: 2012.07.06 15:12:00 Buy EURUSD 0.1 Lots @ 1.23063 TP= 1.23363 SL= 1.22763
23:12:17 StupidOrderFunctions EURUSD,M1: OrderSend failed with error #130
23:12:48 StupidOrderFunctions EURUSD,M1: Bid:1.23052 Ask:1.23074 StopLoss:1.23374 TakeProfit:1.22774
23:12:48 StupidOrderFunctions EURUSD,M1: Trade -1 open: 2012.07.06 15:12:00 Sell EURUSD 0.1 Lots @ 1.23052 TP= 1.22752 SL= 1.23352
23:12:48 StupidOrderFunctions EURUSD,M1: OrderSend failed with error #130
23:12:53 StupidOrderFunctions EURUSD,M1: EA Terminated
23:12:53 StupidOrderFunctions EURUSD,M1: deinitialized
23:12:53 StupidOrderFunctions EURUSD,M1: uninit reason 1
23:12:53 StupidOrderFunctions EURUSD,M1: removed
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Attached File(s)
StupidOrderFunctions.mq4
5 KB
|
114 downloads