not one advisor does not work in Metatrader 5 any currency pair - page 7

 

And here comes the cause:

10030

TRADE_RETCODE_INVALID_FILL

Unsupported balance order execution type specified

It has already been mentioned:

Forum on trading, automated trading systems and testing of trading strategies

not a single advisor works in metatrader 5 any currency pair

sandex, 2015.04.29 12:56

switched to dollars, in-house EA does not work, mine does

order execution type should be ORDER_FILLING_RETURN


 
Karputov Vladimir:

And here comes the cause:

10030

TRADE_RETCODE_INVALID_FILL

Unsupported balance order execution type specified

which has already been mentioned:


how to make the execution type to be?ORDER_FILLING_RETURN
 
So correctORDER_FILLING_ there maybe FOG to RETURN... I've tried it with MT5 too - the slightest interference in the code during trading and I lost $100 on it, new codes also didn't work on the demo until I added some of my features - maybe it was designed that way ... I don't know what for... I abandoned MT5 a long time ago, although I started with it - it seemed safer and simpler...
 
chipo:
So correctORDER_FILLING_ there maybe FOG to RETURN... I've tried it with MT5 too - the slightest interference in the code during trading and I lost $100 on it, new codes also didn't work on the demo until I added some of my features - maybe it was designed that way ... I don't know what for... I abandoned MT5 a long time ago, although I had started with it - it seemed more reliable and easy to use...
There are noORDER_FILLING-ORDER_FOK- FOK lines in 1 standard Expert Advisor.
 
all standard EAs are built on a standard library, you need to edit the library
 
Alexander Bereznyak:
all standard EAs are built on the standard library, the library should be corrected

There is no need to edit the standard library - this is the wrong approach. You should just save the EA under a new name and change the code a bit. For example, save Moving Averages.mq5 under a new name Moving Averages1.mq5.

In the header add a description that this EA uses the ORDER_FILLING_RETURN execution policy:

#property version   "1.00"
#property description "Политика исполнения: ORDER_FILLING_RETURN"
#include <Trade\Trade.mqh>

and add one line of code into functions of position closing and opening:

//+------------------------------------------------------------------+
//| Check for open position conditions                               |
//+------------------------------------------------------------------+
void CheckForOpen(void)
  {
   .
   .
   .
//--- additional checking
   if(signal!=WRONG_VALUE)
      if(TerminalInfoInteger(TERMINAL_TRADE_ALLOWED))
         if(Bars(_Symbol,_Period)>100)
           {
            CTrade trade;
            trade.SetTypeFilling(ORDER_FILLING_RETURN);
            trade.PositionOpen(_Symbol,signal,TradeSizeOptimized(),
                               SymbolInfoDouble(_Symbol,signal==ORDER_TYPE_SELL ? SYMBOL_BID:SYMBOL_ASK),
                               0,0);
           }
//---
  }
//+------------------------------------------------------------------+
//| Check for close position conditions                              |
//+------------------------------------------------------------------+
void CheckForClose(void)
  {
   .
   .
   .
//--- additional checking
   if(signal)
      if(TerminalInfoInteger(TERMINAL_TRADE_ALLOWED))
         if(Bars(_Symbol,_Period)>100)
           {
            CTrade trade;
            trade.SetTypeFilling(ORDER_FILLING_RETURN);
            trade.PositionClose(_Symbol,3);
           }
//---
  }
 
Karputov Vladimir:

There is no need to edit the standard library - this is the wrong approach. You should just save the EA under a new name and change the code a bit. For example, save Moving Averages.mq5 under a new name Moving Averages1.mq5.

In the header add a description that this EA uses the ORDER_FILLING_RETURN execution policy:

and add one line of code to close and open positions:

Great! Everything works. Thank you for your hard work and explanations!
 
Will the topic not be deleted? I might need it in the future :)