Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Rainbow Oscillator and Nifty

1 min read


 

Another Trend Following Indicator under my observation other than NMA Swing Trading is Rainbow Oscillator

The Rainbow Charts and Rainbow Oscillator indicators were created by Mel Widner, Ph.D. and originally introduced in the July 1997 issue of Stocks and Commodities magazine.

The Rainbow Oscillator is a trend-following indicator .The Rainbow Oscillator is derived from a consensus of the Rainbow Charts trends. It defines the highest high and lowest low of those moving averages to create an oscillator and bandwidth lines based on those calculations.Rainbow Charts uses 2-period simple moving average. Recursive smoothing is then applied to the original moving average thereby creating 9additional moving averages; each new moving average is based on the previous moving average. Rainbow Oscillator is applied to Nifty Charts. And to Simply Understand the chart Blue lines between the Rainbow Band indicates upper trend and the Red lines between the Rainbow Band Indicates negative trend.

AFL Code for Rainbow Oscillator

_SECTION_BEGIN(“Rainbow Oscillator”);
/* Rainbow Oscillator */
/* July 1997 TASC Traders Tips*/
/* Coded by Anthony Faragasso */

MaxGraph =16;

avg1= Max (MA(C,2),
Max (MA(MA(C,2),2),
Max (MA(MA(MA(C,2),2),2),
Max (MA(MA(MA(MA(C,2),2),2),2),
Max(MA(MA(MA(MA(MA(C,2),2),2),2),2),
Max(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),
Max(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),
Max(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2),
Max(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2),2),

MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2),2),2))))))))));;;;;;;;;

avg2 = Min(MA(C,2),
Min(MA(MA(C,2),2),
Min(MA(MA(MA(C,2),2),2),
Min(MA(MA(MA(MA(C,2),2),2),2),
Min(MA(MA(MA(MA(MA(C,2),2),2),2),2),
Min(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),
Min(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),
Min(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2),
Min(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2),2),

MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2),2),2))))))))));;;;;;;;;;

/* Rainbow Oscillator */

Graph0 = 100 * (Close – ((MA(C,2)+
MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) + MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2),2)+

MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2),2),2))
/10))/(HHV(C,10)-LLV(C,10));

/* Lower Rainbow Band */

Graph1 = -100 *( avg1 – avg2) /
(HHV(C,10) – LLV(C,10));

/* Upper Rainbow Band */

Graph2 = 100 * (avg1 – avg2) /
(HHV(C,10) – LLV(C,10));

Graph0Style = 3;
Graph2Style = Graph1Style = 1;
Graph2Color = Graph1Color =3;
Graph3 = 0;
Graph3Color =8;

downbar =Graph0 <Ref( Graph3,-1);
upbar = Graph0 > Ref(Graph3,-1);
barcolor = IIf( downbar,4, IIf( upbar, 6, 0 ) );
Graph0BarColor = ValueWhen( barcolor != 0, barcolor );

Title = Name() +” Rainbow Oscillator : “+WriteVal(Graph0,format=1.2) +” % “;
_SECTION_END();

Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Download Camarilla AFL code for Amibroker

Camarilla AFL code for amibroker is posted here as per request from one of the regular member of marketcalls (Mr.Veer). Camarilla AFL code in...
Rajandran R
57 sec read

SMV Trading System v1.0 – AFL code for Amibroker

SMV Trading system V1.0 - An Intraday Trading Approach with Combination of SDA2 Trend Trading System + Market Profile + Volume Profile (SMV Trading...
Rajandran R
1 min read

Modified 5 EMA High-Low AFL code

Simple 5 EMA High-Low AFL with Interactive dashboard. Strategy suits for higher timeframe like daily, weekly, monthly
Rajandran R
1 min read

7 Replies to “Rainbow Oscillator and Nifty”

  1. @mahisRainbow Oscillator uses Recusive moving average technique to for optimization which is missing in Elder Bull ray and Bear ray. Its compleletly different in producing signals

  2. When put this AFL–there is some error:ERROR-29:Variable UPBAR used without being initialized–How can I correct it ?(AMI-4.80.2 PROF)

  3. Sir Waiting for Three White Shoulders and Three Black Crows Patterns and understanding……….. coz u r the perfect roll model for technical

Leave a Reply to Asis Ghosh Cancel reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More