Error on trading stock JFD broker - page 2

To add comments, please log in or register
lippmaje
862
lippmaje  
Javad Nejati:

Can you please explain a little more ? we have no error of compiling of code , we have no error on live , we have only error on backtest

============================================

Its obvious the code has no  problem because its MACD simple!

I cant find nowhere this error returning form server after execution  order

The problem is in class CTrade. Under 2 conditions PositionOpen() quits without leaving an explanation to the caller, that is if order type check or filling check failed.

To fix this you can add these lines to Trade.mqh file in function CTrade::PositionOpen (line 330):

//--- check order type
   if(!OrderTypeCheck(symbol))
     {
      m_result.retcode=TRADE_RETCODE_INVALID;
      m_result.comment="Order type check failed";
      return(false);
     }
//--- check filling
   if(!FillingCheck(symbol))
     {
      m_result.retcode=TRADE_RETCODE_INVALID;
      m_result.comment="Filling check failed";
      return(false);
     }

Then compile the MACD sample and test again.

Post the findings here to get it examined further.


https://www.metatrader5.com/en/metaeditor/help/development/debug
Code debugging - Developing programs - MetaTrader 5
Code debugging - Developing programs - MetaTrader 5
  • www.metatrader5.com
MetaEditor has a built-in debugger allowing you to check a program execution step by step (by individual functions). Place breakpoints in the code. These are the places where the program execution should be paused. Then launch the program on a regular chart or the strategy tester. As soon as the program reaches a breakpoint, it is paused. This...
12
To add comments, please log in or register