EA31337 / EA31337-classes

📦📈 EA31337 framework (MQL library for writing trading Expert Advisors, indicators and scripts)
https://ea31337.github.io/EA31337-classes
GNU General Public License v3.0
186 stars 98 forks source link

OrderTest: Finish test with closing condition #185

Closed kenorb closed 3 years ago

kenorb commented 4 years ago
  1. Uncomment and fix fixme's in OrderTest.mq5.
  2. The following code needs improvements:

    if (_request.type == ORDER_TYPE_SELL) {
    MqlParam _cond_args[] = {{TYPE_INT, ORDER_TYPE_TIME}, {TYPE_INT, 0}};
    _cond_args[1].integer_value = PeriodSeconds() * (MAX_ORDERS + _index); // Argument to fix.
    _oparams.SetConditionClose(ORDER_COND_LIFETIME_GT_ARG, _cond_args); // Uncomment this line.
    }

The expected result is to close sell orders by the condition at the right time (in sequence), so the test will pass.

kenorb commented 3 years ago

Fixed in 8a7da42c3302c2fe3e15e5699e661ac23fc4723e.