jeemba2012:
The function I use to calculate my lots
My code that I used to set my stop and place orders is
Don't you read any other threads on this Forum ? plenty of threads about error 130 and how to address it . . .
Where is the code that actually places the Order ? OpenBuyOrder() is not an MQL4 function . . .
Is your Broker an ECN Broker ?
I am using MBtrading. it is EXN
my code to place the order is
int OpenBuyOrder(string argSymbol, double argLotSize, double argSlippage,double argSL, double argTP, double argMagicNumber, string argComment = "Buy Order") { while(IsTradeContextBusy()) Sleep(10); // Place Buy Order int Ticket = OrderSend(argSymbol,OP_BUY,argLotSize,MarketInfo(argSymbol,MODE_ASK),argSlippage,argSL,argTP,argComment,argMagicNumber,0,Green); // Error Handling if(Ticket == -1) { int ErrorCode = GetLastError(); string ErrDesc = ErrorDescription(ErrorCode); string ErrAlert = StringConcatenate("Open Buy Order - Error ",ErrorCode,": ",ErrDesc); Alert(ErrAlert); string ErrLog = StringConcatenate("Bid: ",MarketInfo(argSymbol,MODE_BID)," Ask: ",MarketInfo(argSymbol,MODE_ASK)," Lots: ",argLotSize); Print(ErrLog); ErrorCheck( ErrorCode ); } return(Ticket); }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The function I use to calculate my lots
My code that I used to set my stop and place orders is
The print out statements of the bull take profit and stoploss at time of error Invalid 130 invalid stops
bull.TP1 = 0.81948000
bull.TP2 = 0.81948000
bull.SL1 = 0.81608000
bull.SL1 = 0.81608000
ATR 24 = 0.00169792
Bid: 0.8175 Ask: 0.8178