Are CalcLots and LotSize both declared as double ? or int ?
RaptorUK:
Are CalcLots and LotSize both declared as double ? or int ?
Are CalcLots and LotSize both declared as double ? or int ?
Both are doubles
RaptorUK:
What about in the definition of the OpenSellOrder function ?
What about in the definition of the OpenSellOrder function ?
int OpenSellOrder(string argSymbol, double argLotSize, double argSlippage,double argSL,double argTP ,int argMagicNumber, string argComment = "Sell Order") { while(IsTradeContextBusy()) Sleep(10); // Place Sell Order int Ticket = OrderSend(argSymbol,OP_SELL,argLotSize,MarketInfo(argSymbol,MODE_BID),argSlippage,argSL,argTP,argComment,argMagicNumber,0,Red); // Error Handling if(Ticket == -1) { int ErrorCode = GetLastError(); string ErrDesc = ErrorDescription(ErrorCode); string ErrAlert = StringConcatenate("Open Sell Order - Error ",ErrorCode,": ",ErrDesc); Alert(ErrAlert); string ErrLog = StringConcatenate("Bid: ",MarketInfo(argSymbol,MODE_BID)," Ask: ",MarketInfo(argSymbol,MODE_ASK)," Lots: ",argLotSize); Print(ErrLog); } return(Ticket); }
Sorry, I don't see what is causing your problem . . . what I would suggest is ad a Print() statement after LotSize = CalcLots; to print all the variables involved in calculating CalcLots then see if all the values are what you expect.
Replace
LotSize = CalcLots;
to
LotSize = NormalizeDouble(CalcLots,2); if(LotSize<0.01)LotSize=0.01;
and remember - TP in sell-order should be less then open-price.
RaptorUK:
Sorry, I don't see what is causing your problem . . . what I would suggest is ad a Print() statement after LotSize = CalcLots; to print all the variables involved in calculating CalcLots then see if all the values are what you expect.
Sorry, I don't see what is causing your problem . . . what I would suggest is ad a Print() statement after LotSize = CalcLots; to print all the variables involved in calculating CalcLots then see if all the values are what you expect.
I think I see where the problem is. My entry is based on the pivots but for some reason my pivot values are wrong. Can you see where my code is err. I used the pivots from https://www.mql5.com/en/code/8685
the input is -2 since my server is GMT+2.
I am trying make the pivots from London open to London open. for some reason it does not work. I am trying to run it on July 26, 2011 on strategy tester but no results
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
I tried to place an run my EA last night during London Market on the EURJPY pair but I get an error4051 (invalid parameters in Ordersend). It shows that my lot size is 0. Is there something wrong on how I calculate my lots in my code.