Discussion of article "DoEasy. Controls (Part 31): Scrolling the contents of the ScrollBar control" - page 4

 
Artyom Trishkin #:
I got it. Thanks.

Cured by adding the line this.m_request.type_filling = this.m_type_filling;

in CTradeObj::ClosePosition

 
leonerd #:

is cured by adding the line this.m_request.type_filling = this.m_type_filling;

in CTradeObj::ClosePosition

Everything is much simpler.

Initially, all test EAs have an example of library initialisation - a function launched from the OnInit() handler

//+------------------------------------------------------------------+
//| Initialising the DoEasy library|
//+------------------------------------------------------------------+
void OnInitDoEasy()
  {
   .....

Inside this function there are such lines:

//--- Setting correct order expiry and fill types for all trade objects
   engine.TradingSetCorrectTypeExpiration();
   engine.TradingSetCorrectTypeFilling();

Tested the work on the symbol DKKSEK. It has a Return|IOC order filling policy.

Positions are opened and closed. Orders are set.