Discussion of article "Library for easy and quick development of MetaTrader programs (part XXIII): Base trading class - verification of valid parameters" - page 3

 
Alexander:
Hello! I downloaded the latest version of the library and Expert Part_23, put the visual mode and market mode on the tester
orders are opened, but all pending orders are not, in the journal writes "2019.10.27 10:13:32.157 2019.09.23 10:00:02 failed sell stop limit 2.00 RTS-12.19 at 135750 (135800) sl: 135900 tp: 135600 [Invalid expiration].
Exchange symbols, broker Otkritie, version 5.00 build 2190.
Also. In previous articles, I think in part 14 or 15, you promised to create classes for work along with the symbols collection.
with the glass, but for some reason you haven't created them, and these are the basic needs of the library along with symbols and accounts, and you've already left already

far into library improvements (resources, sounds, etc.) and I think you missed the basic tasks.

Thank you, the library is very much needed.

Hello. The work with the glass will be implemented later - after the creation of the trade class.

I think in this part of the library description there is a possibility to set correct expiry values automatically:

CTrading::SetCorrectTypeExpiration(const ENUM_ORDER_TYPE_TIME type=ORDER_TIME_GTC,const string symbol=NULL);
CTrading::SetCorrectTypeFilling(const ENUM_ORDER_TYPE_FILLING type=ORDER_FILLING_FOK,const string symbol=NULL);

If there is (I don't remember about this part, unfortunately), then in OnInit() call these two methods with values by mind, and all trade objects for each symbol used should be set correct values of fill and expiry types.

If not here, then wait for the next article to come out - it's been on check for a while - it's there.

 

In OnInit of Part23 advisor I wrote 2 lines

engine.TradingSetCorrectTypeExpiration();

engine.TradingSetCorrectTypeFilling();

nothing helped, it writes the same thing in the log.

 
Alexander:

In OnInit of Part23 advisor I wrote 2 lines

engine.TradingSetCorrectTypeExpiration();

engine.TradingSetCorrectTypeFilling();

nothing helped, it writes the same thing in the log.

Okay, I'll figure it out. Thanks.

 
Alexander:

In OnInit of Part23 advisor I wrote 2 lines

engine.TradingSetCorrectTypeExpiration();

engine.TradingSetCorrectTypeFilling();

nothing helped, it writes the same thing in the log.

Where do you insert these lines?

They should be inserted in OnInit() after creating the list of working symbols:

//--- Filling the array of used symbols
   used_symbols=InpUsedSymbols;
   CreateUsedSymbolsArray((ENUM_SYMBOLS_MODE)used_symbols_mode,used_symbols,array_used_symbols);

//--- Set the type of symbol list used in the symbol collection
   engine.SetUsedSymbols(array_used_symbols);

//--- Here you need to set correct values of execution and expiry types to the trade objects of all symbols

//--- Отображение выбранного режима работы с коллекцией объектов-символов
   Print(engine.ModeSymbolsListDescription(),TextByLanguage(". Number of characters used: ",". The number of symbols used: "),engine.GetSymbolsCollectionTotal());
 
No one noticed that the order type is StopLimit?
 
Алексей Тарабанов:
No one paid attention to the fact that the order type is StopLimit?

Yeah, I didn't notice that. Is there something else for it? In essence, a stop-limit order is a stop order that triggers a limit order. Aren't the conditions for this combination the same as for the separate use of stop and limit orders?

 
Artyom Trishkin:

Yeah, I wasn't paying attention. Is there something else for it? Basically, a stop-limit order is a stop order that triggers a limit order. Aren't the conditions for this combination the same as for the separate use of stop and limit orders?

The limits are different. And the timeout.

 
Алексей Тарабанов:

The limits are different. And timeout.

Where is this in the character specification? How to find out the necessary data?
 
Nowhere. To the developers, or to the logic.
 
Alexander:

In OnInit of Part23 advisor I wrote 2 lines

engine.TradingSetCorrectTypeExpiration();

engine.TradingSetCorrectTypeFilling();

nothing helped, it writes the same thing in the log.

In general, I checked on CFDs on the Binary.com-Server. It puts stop-limit pending orders (click to view video):

How do I check in Discover? Should I open an account?