# Zero lag ROC

#### XRAY27

##### Well-Known Member
Dear members; please post zero lag ROC afl:thanx:

#### XRAY27

##### Well-Known Member
Dear members; please post zero lag ROC afl:thanx:
Dear members
Please post ROC(Rate of Change) zero lag:thanx:

#### XRAY27

##### Well-Known Member
Dear members
Please post ROC(Rate of Change) zero lag:thanx:
Dear seniors ,
ROC ZERO LAG not possible ??? some body help me

#### mastermind007

##### Well-Known Member
Dear seniors ,
ROC ZERO LAG not possible ??? some body help me
First define meaning of the following terms.

ROC

ZERO and

LAG!

#### XRAY27

##### Well-Known Member
First define meaning of the following terms.

ROC

ZERO and

LAG!
ROC: Rate of change
Zero lag: with each candle movement previous values should not be repainted...:thanx:

#### mastermind007

##### Well-Known Member
ROC: Rate of change
Zero lag: with each candle movement previous values should not be repainted...:thanx:
Do You mean recalculated?

ROC is calculated over current and previous candle. As long as current shifts, ROC will. Past values of ROCs will not change, but it will be continously recalculatd

Last edited:

#### mastermind007

##### Well-Known Member
Do You mean recalculated?

ROC is calculated over current and previous candle. As long as current shifts, ROC will. Past values of ROCs will not change, but it will be continously recalculatd
Found function that does zero lag thing

Code:
``````function ZeroLagMA( data, periods )
{
MA1 = MA( data, periods );
MA2 = MA( MA1, periods );
Diff = MA1 - MA2;
return MA1 + Diff;
}``````
you can use it like this.

Code:
``````z1 = ZeroLagMA( C, 10 );
zR = ZeroLagMA( ROC(C, 10), 10 );``````