Need help with converting pine code to AFL

DELTA%20EMA

Hello,
I need help with converting this pine code to AFL.

Thanks a lot in advance.

/// @link https://forum.amibroker.com/t/need-help-with-converting-pine-code-to-afl/15679/2
/// conversion by fxshrat@gmail.com
EMA_len = Param( "EMA length", 21, 1, 300, 1);
ROC_len = Param( "ROC length", 5, 1, 300, 1);
src = C;

smooth = EMA(src, EMA_len);
EMA_Roc = ROC(smooth, ROC_len);
color = IIf(EMA_Roc > Ref(EMA_Roc, -ROC_len), colorGreen, colorRed);

Plot(EMA_Roc, "EMA_Roc", color, styleLine );
PlotGrid( 0, colorGold, 1, 1, True);
8 Likes

Thanks a lot !! :slight_smile:

@andy982183,

You should 'Like' @fxshrat's post and mark it (click) as 'Solution'.

2 Likes

yes, thanks a lot :slight_smile: