How to Use Built-in Trailing Functions in MQL5?

 

Hello,
I 've Tried Checking the Trailing Functions,
But with no luck ,

I tried calling the Trailing Stops functions but they don't appear to work on the strategy tester using MQL5

Lets say positions are opened on the OnTick() function we called our TrailAllPositions() 

#include <Expert\Trailing\TrailingFixedPips.mqh>
CTrailingFixedPips TrailPips;

...
...


void OnTick(){
if(positions_total > 0){

      TrailAllPositions ();

}

...
...
...

}


Now Inside TrailAllPositions how do we call the Built-in functions in here to start trailing?

The Trail functions cannot be initialized for some reason, or is there something I am missing?

//+------------------------------------------------------------------+
//|                   Trailing Stop Function                         |
//+------------------------------------------------------------------+
void TrailAllPositions()
  {
   
   //TrailPips.Init(); // Nothing Happens
   TrailPips.StopLevel(15);
   TrailPips.ProfitLevel(15);
   
  }

I am coming from MQL4 , SO I am a bit new here at MQL5
Attached is what the strategy looks like , There are no SL being created or moved.

Your Help is Appreciated

PS: I don't want to re-invent the wheel and code another trailing strategy while there are built in ones, In this case I tried

Thanks

Documentation on MQL5: Standard Library / Strategy Modules / Trailing Stop Classes
Documentation on MQL5: Standard Library / Strategy Modules / Trailing Stop Classes
  • www.mql5.com
Trailing Stop Classes - Strategy Modules - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5