Fractal_WeightOscillator – indicator MetaTrader 5

Oscillator, representing the weighted smoothed sum of four indicators: Fractal_RSI, Fractal_MFI, Fractal_WPR and Fractal_DeMarker.

The compilation of the Fractal_WeightOscillator indicator requires the compiled indicator files Fractal_RSI.mq5, Fractal_MFI.mq5, Fractal_WPR.mq5 and Fractal_DeMarker.mq5. Place them in <terminal_data_folder>\MQL5\Indicators.

After compilation, the Fractal_WeightOscillator.ex5 indicator file contains the those indicators as resources, and therefore, they are not required to be present in the terminal folder for the compiled indicator to work! For this purpose, the corresponding code has been added to the indicator code in order to include the indicators in the executable file.

The indicator executable files have been added as resources at the global scope

//—- Include the indicators in the EA code as resources
#resource “\\Indicators\\Fractal_RSI.ex5”
#resource “\\Indicators\\Fractal_MFI.ex5”
#resource “\\Indicators\\Fractal_WPR.ex5”
#resource “\\Indicators\\Fractal_DeMarker.ex5”

Changed the string paths to the indicators used as resources in the block of the OnInit() function

//—- getting handle of the Fractal_RSI indicator
   RSI_Handle=iCustom(NULL,0,“::Indicators\\Fractal_RSI”,e_period,normal_speed,RSIPrice);
   if(RSI_Handle==INVALID_HANDLE)
     {
      Print(” Failed to get handle of the Fractal_RSI indicator”);
      return(INIT_FAILED);
     }
//—- getting handle of the Fractal_MFI indicator
   MFI_Handle=iCustom(NULL,0,“::Indicators\\Fractal_MFI”,e_period,normal_speed,MFIPrice,MFIVolumeType);
   if(MFI_Handle==INVALID_HANDLE)
     {
      Print(” Failed to get handle of the Fractal_MFI indicator”);
      return(INIT_FAILED);
     }
//—- getting handle of the Fractal_WPR indicator
   WPR_Handle=iCustom(NULL,0,“::Indicators\\Fractal_WPR”,e_period,normal_speed);
   if(WPR_Handle==INVALID_HANDLE)
     {
      Print(” Failed to get handle of the Fractal_WPR indicator”);
      return(INIT_FAILED);
     }
//—- getting handle of the Fractal_DeMarker indicator
   DeMarker_Handle=iCustom(NULL,0,“::Indicators\\Fractal_DeMarker”,e_period,normal_speed);
   if(DeMarker_Handle==INVALID_HANDLE)
     {
      Print(” Failed to get handle of the Fractal_DeMarker indicator”);
      return(INIT_FAILED);
     }
Alternative:  ADXm smoothed - indicator MetaTrader 5

Thus, the compiled executable file of the Fractal_WeightOscillator indicator can be used on other trade terminals on its own without the original indicator.

The indicator uses the classes of SmoothAlgorithms.mqh library (copy it to <terminal_data_folder>\MQL5\Include). The use of the classes was thoroughly described in the article “Averaging Price Series for Intermediate Calculations Without Using Additional Buffers”.

Compilation order of files:

  1. Fractal_RSI.mq5, Fractal_MFI.mq5, Fractal_WPR.mq5 and Fractal_DeMarker.mq5
  2. Fractal_WeightOscillator.mq5

Fig1. The Fractal_WeightOscillator indicator

Fig1. The Fractal_WeightOscillator indicator


📈 ROBOTFX MetaTrader Expert Advisors and Indicators to maximize profits and minimize the risks