mt5 strategy tester ticks - page 15

 
WhooDoo22:

Hello MQL5 community,

While coding in meta editor I tried using the order type function and was alerted by an error in meta editor's toolbox (see snapshot below).


As you should see, the order type function isn't defined yet its seemingly defined by docs (https://www.mql5.com/en/docs/standardlibrary/tradeclasses/chistoryorderinfo/chistoryorderinfoordertype).

A condition I'm attempting is

How can the order type function be used in meta editor if it isn't defined?

Thank you

This is a method of CHistoryOrderInfo class. You have to define a variable of CHistoryOrderIndo type, that give you an object and then you can call this method :

#include <Trade\HistoryOrderInfo.mqh>   

...

CHistoryOrderInfo myOrderInfo;

myOrderInfo.OrderType();
 
angevoyageur:

This is a method of CHistoryOrderInfo class. You have to define a variable of CHistoryOrderIndo type, that give you an object and then you can call this method :

Hello Alain,

Yes, I do wish to explore Trade\HistoryOrderInfo.mqh's content, I haven't had a look inside Trade\HistoryOrderInfo.mqh yet. I've skimmed through

#include <Trade\Trade.mqh>

and noticed certain EAs possess this Trade\Trade.mqh. This include file possibly hastens EA construction time (a universal shortcut approach to building an EA core body). I like it, :) but personally believe I'd prefer coding it all out to an EA template without using an include file (so all code could be accessed within a single file). Could you provide a link for me so I can access the Trade\HistoryOrderInfo.mqh file please? I can search MQL5.com for it in the meantime but may be better off if you give me a path. I did find this (https://www.mql5.com/en/docs/standardlibrary/tradeclasses/chistoryorderinfo).

Thank you

Documentation on MQL5: Standard Library / Trade Classes / CHistoryOrderInfo
Documentation on MQL5: Standard Library / Trade Classes / CHistoryOrderInfo
  • www.mql5.com
Standard Library / Trade Classes / CHistoryOrderInfo - Documentation on MQL5
 
WhooDoo22:

Hello Alain,

Yes, I do wish to explore Trade\HistoryOrderInfo.mqh's content, I haven't had a look inside Trade\HistoryOrderInfo.mqh yet. I've skimmed through

and noticed certain EAs possess this Trade\Trade.mqh. This include file possibly hastens EA construction time (a universal shortcut approach to building an EA core body). I like it, :) but personally believe I'd prefer to just code it all out in an EA template without using an include file (so all code could be accessed within a single file). Could you provide a link for me so I can access the Trade\HistoryOrderInfo.mqh file please? I can search MQL5.com for it in the meantime but may be better off if you give me a path. I did find this (https://www.mql5.com/en/docs/standardlibrary/tradeclasses/chistoryorderinfo).

Thank you

  • If you don't like include file, don't use classes. You're not forced to use them, it's just an option.
  • You can find this file in your computer. Open metaeditor, and check this path MQL5\Include\Trade.
 
angevoyageur:
  • If you don't like include file, don't use classes. You're not forced to use them, it's just an option.
  • You can find this file in your computer. Open metaeditor, and check this path MQL5\Include\Trade.

Understood.

Thank you

 
thanks
 

I have the same issue ,

my indicator is showing crazy numbers with e in them and e- is different then e+ so

DoubleToString() will do the job for me but if you want more in detail code of how to convert it see source code in this page[its JavaScript]:

Scientific Notation To Decimal Notation Converter (easysurf.cc)