According to https://www.mql5.com/en/docs/basis/operators/return,  ; we should enclose the value or expression to be returned in parentheses, for example: int CalcSum( int x, int y) { return (x+y); } But
I've created an indicator that calls an internal function. This function uses an array internally for intermediate calculations . So far, everything works. The indicator is displayed in the indicator chart. However, I'm wondering if I should define
According to the CExpert class (of StandardLib), we must always use the current symbol (_Symbol) or period (_Period): // See line 240 //+------------------------------------------------------------------+ //| Initialization and
I have an array-based index (i.e., the index comes not from a time series based array). Now I want to use this index : double high[]; m_high.GetData( index , numberOfBars, high); // Method from Indicator.GetData() with calls common
According to https://www.mql5.com/en/docs/series/copybuffer , we can simple use double indicatorArr[]; CopyBuffer (m_indicator.Handle(), 0 , 0 , 10 , indicatorArr); // puts the latest 10 indicator values into array But why do I see many examples
According to https://www.mql5.com/en/docs/standardlibrary/technicalindicators/cindicators/cindicator/cindicatorrefresh, it is recommended to always call Refresh() when retrieving data with GetData(). However, looking at the standard lib code (e.g
Is this if (pointerObj == NULL || CheckPointer (pointerObj)== POINTER_INVALID ){..} the same as this: if (!pointerObj){..} As it is said in https://www.mql5.com/en/docs/basis/types/object_pointers ; > To quickly validate the pointer
I have a custom indicator with the following inputs (in the following order): input int period = 10 ; // first position in the indicator settings input bool Bold = true ; // second position in the indicator settings and register the
How can I test or use classes derived from CExpertSignal without using the StrategyTester? For example, I have CSignalMA (a child from CExpertSignal, located in Expert/Signal) . I want to have something like this: 1. go to the last 200 bars 2
I use CExpert and initialize the constructors in int OnInit() : int OnInit () { if (!myExpert.Init( Symbol (), Period (),ExpertEveryTick,ExpertMagicNumber)) {
In MQL4, OrderSend() has a color parameter (see https://docs.mql4.com/trading/ordersend ). Since I'm using MQL5 with the CExpert class, I added the standard CTrade class to the CExpert instance. CTrade has an OrderOpen() function, which unfortunately
I have a mqproject (consisting of a MyEa.mq5 and a .mqproj file within the folder called "custom") and would like to use indicators from MQL5/Indicators/Examples in my EA. With a simple EA without embedding it in a .mqproj , indicators can be