This indicator is calculated the following way:
LRMA[ = 3.0 * LWMA(Price) – 2.0 * SMA(Price)
where:
All calculation are made on the current bar and with the current price value.
This indicator clearly shows market trends dividing a price chart into two sectors. If a price is above the indicator line, the trend is going upwards. If a price is below the indicator line, the trend is going downwards.
Converted from MT5 following a request made in our ProRealTime indicators’forum section.
//PRC_LRMA | indicator
//04.09.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT5 code version
// --- settings
period=14
// --- end of settings
price=customclose
if barindex>period then
tmpS=0
tmpW=0
wsum=0
for i=0 to period-1 do
tmpS=tmpS+price[i]
tmpW=tmpW+(price[i]*(period-i))
wsum=wsum+(period-i)
next
tmpS=tmpS/period
tmpW=tmpW/wsum
Res=3.0*tmpW-2.0*tmpS
endif
return res