ForceIndexCrossRegions

Force index regions
Description
Alexander Elder's Force Index smoothed with a fast and a slow EMA. Displayed as two horizontal regions of color bands where alternating colors indicate whether the index is above or below the zero line.
Category
Price Volume Indicators
Parameters
FASTPERIOD ( Default: 2 Min: 1 Max: 100 )
SLOWPERIOD ( Default: 13 Min: 1 Max: 100 )
Chart Script

RAW:= V * (C - REF(C,1));
FFI:= EMA(RAW, FASTPERIOD);
SFI:=EMA(RAW, SLOWPERIOD);
FastUp:= IF( (FFI > 0), 1, 0);
FastDn:= IF( (FFI < 0), 1, 0);
SlowUp:= IF( (SFI > 0), 1, 0);
SlowDn:= IF( (SFI < 0), 1, 0);
FastForceUp:=EXTENDSIGNAL(FastUp, FastDn),stickline;
FastForceDn:=EXTENDSIGNAL(FastDn, FastUp),stickline;
SlowForceUp:=EXTENDSIGNAL(SlowUp, SlowDn),stickline;
SlowForceDn:=EXTENDSIGNAL(SlowDn, SlowUp),stickline;
FastPlotUp:FILLRGN(FastForceUp, 1, 2),ExtendLR,Brush#FF00FF00;
FastPlotDn:FILLRGN(FastForceDn, 1, 2),ExtendLR,Brush#FFFF0000;
PlotMidline:1,colorWhite;
@SETHLINE(1);
SlowPlotUp:FILLRGN(SlowForceUp, 0, 1),ExtendLR,Brush#FF00FF00;
SlowPlotDn:FILLRGN(SlowForceDn, 0, 1),ExtendLR,Brush#FFFF0000;
FastLabel:DRAWTEXTAXISY(FastPlotUp, 'Fast Force', 55),ColorBlue,Font(Verdana, 10pt);
SlowLabel:DRAWTEXTAXISY(SlowPlotUp, 'Slow Force', 55),ColorBlue,Font(Verdana, 10pt);