CheckTrailingStopLong in the built in TrailingMA object giving overload error when called

 

I am getting the following error when I try and call CheckTrailingStopLong inside of TrailingMA and I cannot seem to figure out what the issue is. I feel like I am missing something basic.

Error:

'CheckTrailingStopLong' - no one of the overloads can be applied to the function call


Pertinent Code:

//--- Includes
#include <Expert\Trailing\TrailingMA.mqh>
#include <Trade\PositionInfo.mqh>

//--- Global Variables
CTrailingMA trailingMA;
CPositionInfo positionInfo;
double normalizedStopLossLevel;
double normalizedEntryLevel;
double normalizedTakeProfitLevel;

//--- Code inside of onTick()
if (PriceDataTable[0].high >= normalizedTakeProfitLevel) 
{
        trailingMA.CheckTrailingStopLong(positionInfo, normalizedStopLossLevel, normalizedTakeProfitLevel);
} 


If you would like me to come back and edit this with more of my code for whatever reason let me know. I am using the built in PositionInfo and TrailingMA files

 
cgleckman:

I am getting the following error when I try and call CheckTrailingStopLong inside of TrailingMA and I cannot seem to figure out what the issue is. I feel like I am missing something basic.

Error:


Pertinent Code:


If you would like me to come back and edit this with more of my code for whatever reason let me know. I am using the built in PositionInfo and TrailingMA files

So check your parameters.

Try this :

        trailingMA.CheckTrailingStopLong(&positionInfo, normalizedStopLossLevel, normalizedTakeProfitLevel);

In case it doesn't work, then you would need to post code that compiles to be able to check.

 

Hi Alan,

Thank you for the response. That does make it compile however I then get new errors:

invalid pointer access in 'TrailingMA.mqh' (127,88)

OnTester critical error

I have been trying to figure out why that new error is occurring but I seem to be coming up empty. Is it sounds as if it is an issue in the TrailingMA file but I have made no changes in there and am using the base one provided so I am assuming the issue is actually in my file and not TrailingMA.

Reason: