// Downloaded From https://www.WiseStockTrader.com
/* Forecast Oscillator */
// code - Milman //
/* Forecast oscillator - Default time period is 14 */

for( i = 1; i < 15; i++ ) 
{ 
VarSet( "C"+i, Ref( C, -i ) ); 
} 
fo= C- (( C14+ 6.5 * (6.5 * C + 5.5 * C1 + 4.5 
* C2 + 3.5 * C3 + 2.5 * C4 + 1.5 * C5 + 0.5 * 
C6 - 0.5 * C7 - 1.5 * C8 - 2.5 * C9 - 3.5 * 
C10 - 4.5 * C11 - 5.5 * C12 - 6.5 * C13) / 227.5));
trig= EMA(fo,3);
Plot(fo," Forecast Oscillator",1,2);
Color=IIf(fo>0,18,5);
Plot(fo, "" ,Color,4);
Plot (trig,"",6,styleDashed);
Plot(0,"",3);