Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Indicator | MM

Oscillator MM (Market Mode) allows assessing the market state: In trend state or in cyclic state.

It has three configurable parameters:

  • Period - calculation period;
  • Delta - coefficient to calculate market waves;
  • Fraction - half-width of the channel.

Calculations:

Mode = SMA(BP, Period2)  Peak = Fraction * SMA(FPeak, 50)  Valley = Fraction * SMA(FValley, 50)  

where:

BP = 0.25 * (1-Alpha) * (High + Low - High[2] - Low[2]) + Beta * (1+Alpha) * PrevBP - Alpha * BP[2]

If PrevBP > BP and PrevBP > BP[2]:

FPeak = PrevBP

otherwise:

FPeak = PrevFPeak

If PrevBP < BP and PrevBP < BP[2]:

FValley = PrevBP

otherwise:

FValley = PrevFValley
Period2 = 2*Period + 5  Alpha = Gamma - Sqrt(Gamma*Gamma - 1),  Gamma = 1/cos(4*Pi*Delta/Period),  Beta = cos(2*Pi/Period)  

MetaTrader Experts, Indicators, Scripts and Libraries

21240

Best MetaTrader Indicators + Profitable Expert Advisors