0% found this document useful (0 votes)
62 views5 pages

Multi-Ribbon Strategy Overview

The document discusses plotting multiple ribbons on a chart using the MultiRibbon function. It defines the MultiRibbon function, which takes the ribbon color, position number, and label as parameters. It then provides examples of calling MultiRibbon to plot 11 ribbons of different technical indicator colors and labels on the chart.

Uploaded by

Suresh Ram R
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views5 pages

Multi-Ribbon Strategy Overview

The document discusses plotting multiple ribbons on a chart using the MultiRibbon function. It defines the MultiRibbon function, which takes the ribbon color, position number, and label as parameters. It then provides examples of calling MultiRibbon to plot 11 ribbons of different technical indicator colors and labels on the chart.

Uploaded by

Suresh Ram R
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

_SECTION_BEGIN("MultipleRibbon");

// You plot a Ribbon by calling the function as follows: MultiRibbon("Color", "R


ibbon Number", "Name To Display");
// The "Ribbon Number" is simply the order of the ribbon, starting with 1 as the
bottom Ribbon. You can add as many
// ribbons as you want, until you run out of chart space. Just keep track of the
'Serial Number' (Ribbon Number). :-)
RibbonThickness = Param("Ribbon Thickness", 8, 1, 15, 0.1);
Font
= ParamList("Font:","Arial|Calibri|Futura|Tahoma
|Times New Roman");
"";
function GfxConvertBarToPixelX(Bar)
{
lvb = Status("lastvisiblebar"); fvb = Status("firstvisiblebar");
pxchartleft = Status("pxchartleft"); pxchartwidth = Status("pxchartwidth");
return pxchartleft + Bar * pxchartwidth / (Lvb - fvb + 1);
}
procedure MultiRibbon(RibbonColor, Position, Label)
{
LineColor
= colorLightGrey;
Position
= RibbonThickness * Position;
x2 = Status("pxchartright");
y2 = Status("pxchartbottom");
RibbonColor = IIf(GfxConvertBarToPixelX(BarIndex()-Status("firstvisiblebarindex
")) > y2/1.5 * (RibbonThickness/100) * 18 ,
RibbonColor, colorYellow);
Plot(0, "", LineColor, styleOwnScale | styleNoLabel, 0, 100);
Plot(Position, "", LineColor, styleOwnScale | styleNoLabel, 0, 100);
Plot(Position, "", RibbonColor, styleArea | styleOwnScale | styleNoLabel, 0, 10
0);
GfxSetTextColor(colorBlack);
GfxSelectFont(Font, y2/1.5 * (RibbonThickness/100), 400);
GfxDrawText(Label, 8, y2 * 1.001 -(y2 * Position/100) , y2/1.5 * (RibbonThickne
ss/100) * 17, y2, 2 + 32 + 256);
}
//==============================================================================
===================================
//TRENDADVISOR
pointer[0] = 0;
/* Phase filter */

Cond1 = Close > MA(Close, 50)AND NOT(Close > MA(Close, 200))AND NOT(MA(Close, 50
) > MA(Close, 200));
Cond2 = Close > MA(Close, 50)AND Close > MA(Close, 200)AND NOT(MA(Close, 50) > M
A(Close, 200));
Cond3 = Close > MA(Close, 50)AND Close > MA(Close, 200)AND MA(Close, 50) > MA(Cl
ose, 200);
Cond4 = NOT(Close > MA(Close, 50))AND Close > MA(Close, 200)AND MA(Close, 50) >
MA(Close, 200);
Cond5 = NOT(Close > MA(Close, 50))AND NOT(Close > MA(Close, 200))AND MA(Close, 5
0) > MA(Close, 200);
Cond6 = NOT(Close > MA(Close, 50))AND NOT(Close > MA(Close, 200))AND NOT(MA(Clos
e, 50) > MA(Close, 200));
for (i = 1; i < BarCount; i++)
{
if (Cond1[i])
pointer[i] =
if (Cond2[i])
pointer[i] =
if (Cond3[i])
pointer[i] =
if (Cond4[i])
pointer[i] =
if (Cond5[i])
pointer[i] =
if (Cond6[i])
pointer[i] =

1;
2;
3;
4;
5;
6;

}
/* Plot Graphic */
//GraphXSpace= 15 ;
dynamic_color = IIf(pointer < 4, colorGreen, colorRed);
//Plot(pointer, "TrendAdv2", dynamic_color, styleHistogram | styleThick, Null, N
ull, 0);
//SetChartBkGradientFill(ParamColor("BgTop", colorWhite), ParamColor("BgBottom",
colorLightYellow));
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// haDelta-CV-Valcu-Original
//HEIKIN-ASHI
//SetChartOptions(0,chartShowArrows | chartShowDates);
HaClose = (O + H + L + C)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
xDiff = (HaClose - HaLow);
//barcolor = IIf(HaClose >= HaOpen,colorGreen,colorRed);
//barcolor= IIf(HaClose>=HaOpen,colorGreen,colorRed) ;
//SetBarFillColor(IIf(HaClose>=HaOpen,colorLime,colorRed));
//PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "", barcolor, styleCandle );
HaDelta= (HaClose-HaOpen) ;
MA1= MA(Hadelta,3) ;
//Plot(Hadelta,"haDelta",colorBlack) ;
//Plot(0,"",colorBrown) ;
//Plot( MA1, "MA3", colorRed );
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxx
//BB HISTOGRAM
_SECTION_BEGIN("BB Histogram");
bbhist=((C+2*StDev(C,20) - MA(C,18)) / ((4*StDev(C,18)))*4) - 2;
//Plot(bbhist, "BBands Histogram", IIf(bbhist > 0, colorLime, colorRed),styleHis
togram + styleThick);
//Plot(0,"",colorBrown) ;
_SECTION_END();
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxx
//VOLATILITY RATIO
//n = Param("movn",10,1,50,1);
nTSM = Param("TSMper",15,5,34,1,0) ;
nMATSM = Param("MATSMper",3,3,17,1,0) ;
ratio = C / Ref(C,-1);
natlog = log(ratio);
TSMVolatilityRatio = MA(natlog, nTSM);
MATSM = MA(TSMVolatilityRatio,nMATSM) ;
//Plot(TSMVolatilityRatio, "VolatilityRatio", colorRed,styleLine);
//Plot(0,"",colorBrown) ;
//Plot(MATSM,"MATSM",colorBlue) ;
TSMup= TSMVolatilityRatio>0 AND TSMVolatilityRatio>MA(TSMVolatilityRatio,nMATSM)
;
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxx
//============================================ MAhaDelta =======================
===============
r1= IIf(MA(Hadelta,3)>0 ,colorGreen,colorRed);
//============================================ CupSAR ==========================
============
r2 = IIf (C>SAR(0.02,0.2),colorGreen,colorRed);
//============================================ BBhistogram =====================
==
//PL = (H + C+ L)/3;
r3 = IIf (bbhist>0,colorGreen,colorRed);
//--------------------------------------------------------------------------//============================================ Volatility ======================
=
//PL = (H + C+ L)/3;
r4 = IIf (TSMVolatilityRatio>0,colorGreen,colorRed);
//--------------------------------------------------------------------------//========================================== MACD ===========================
RSI21 = EMA(RSI(21),5);
//r2 = IIf (RSI21 >BBandTop(RSI21,5,0.5),colorGreen,IIf (RSI21 <BBandBot(RSI21,5
,0.5),colorRed,colorYellow));
r5 = IIf (MACD()>Signal(),colorGreen,colorRed);
//--------------------------------------------------------------------------//======================================== Stoch ==============================

//r4 = IIf(EMA(PDI(7),3) > EMA(MDI(7),3),colorGreen,colorRed);


//r4 = IIf(ADX()>Ref(ADX(),-1),colorGreen,colorRed);
r6 = IIf(StochK()>StochD() AND StochK()>20 OR StochK()>80,colorGreen,colorRed);
//======================================== PDIupMDI ============================
==
//r3 = IIf (MACD(3,34) >BBandTop(MACD(3,34),5,0.5),colorGreen,IIf (MACD(3,34) <B
BandBot(MACD(3,34),5,0.5),colorRed,colorYellow));
r7 = IIf (PDI()>MDI(),colorGreen,colorRed);
//--------------------------------------------------------------------------//======================================== Top2Up ==============================
//r4 = IIf(EMA(PDI(7),3) > EMA(MDI(7),3),colorGreen,colorRed);
r8 = IIf(BBandTop(C,20,2)>=Ref(BBandTop(C,20,2),-1),colorGreen,colorRed);
//======================================== TrendAdviser ========================
======
//r4 = IIf(EMA(PDI(7),3) > EMA(MDI(7),3),colorGreen,colorRed);
//r6 = IIf(MA(C,50)>=Ref(MA(C,50),-1),colorGreen,colorRed);
r9 = IIf(pointer < 4,colorGreen,colorRed);
//======================================== MFI ==============================
//r4 = IIf(EMA(PDI(7),3) > EMA(MDI(7),3),colorGreen,colorRed);
r10 = IIf(MFI()>EMA(MFI(),5) OR MFI()>50,colorBrown,colorRose);
//========================================Limita ==============================
//r4 = IIf(EMA(PDI(7),3) > EMA(MDI(7),3),colorGreen,colorRed);
r11 = IIf((ADX()<50 AND MFI()>30),colorGreen,colorRed);
/*
EMA21
EMA34
EMA55
EMA21
EMA34

=
=
=
=
=

IIf (MACD(34,55) >Ref(MACD(34,55),-1),colorGreen,colorRed);


IIf (MACD(55,89) >Ref(MACD(55,89),-1),colorGreen,colorRed);
IIf (MACD(3,34) >Ref(MACD(3,34),-1),colorGreen,colorRed);
IIf(PDI(5) > MDI(5),colorGreen,colorRed);
IIf(PDI(9) > MDI(9),colorGreen,colorRed);

//========================================ADX trend ============================


==
r6 = IIf(ADX(7) > Ref(ADX(7),-1) AND ADX(7) > 20 AND (ADX(7) > PDI(7) OR ADX(7)
> MDI(7)),colorBlue,
IIf(ADX(7) > Ref(ADX(7),-1) , colorAqua,colorBlack));
//--------------------------------------------------------------------------*/
MultiRibbon(r11, 1, "Limita");
MultiRibbon(r10, 2, "MFI");
MultiRibbon(r9, 3, "TrendAdviser");
MultiRibbon(r8, 4, "Top2Up");
MultiRibbon(r7, 5, "PDIupMDI");
MultiRibbon(r6, 6, "Stoch");
MultiRibbon(r5, 7, "MACD");
MultiRibbon(r4, 8, "Volatility");
MultiRibbon(r3, 9, "BBhistogram");
MultiRibbon(r2, 10, "CupSAR");
MultiRibbon(r1, 11, "MAhaDelta");
/*
//==================interpretation============================

WriteIf(EMA( Close,13)>EMA( Close,39),"EMA says : UP TREND \n EMA -50 SL of "+ W


riteVal(EMA(Close,50)),
"EMA says : DOWN TREND \n EMA "+ WriteVal(EMA(Close,50)));
WriteIf (Trix( 9 ) > Ref( Trix( 9 ) , -1 ),"\n TRIX =" + WriteVal(Trix( 9 ))+ "
: UP","\n TRIX =" + WriteVal(Trix( 9 ))+" : DOWN");
WriteIf (MACD( 12, 26 ) > Ref( MACD( 12, 26 ) , -1 ), "MACD ="+ WriteVal(MACD( 1
2, 26 ))+ " :
UP","MACD ="+ WriteVal(MACD( 12, 26 ))+ " : DOWN");
WriteIf(ADX( 9 ) > Ref( ADX( 9 ) , -1 ),"ADX ="+WriteVal (ADX(9))+" :TREND-ING
","ADX ="+WriteVal (ADX(9))+" : ----");
WriteIf (RSI( 7 ) > Ref( RSI(7) , -1 ), "RSI ="+ WriteVal(RSI( 7))+ " : UP","RSI
="+ WriteVal(RSI( 7))+ " : DOWN");
WriteIf (CCI( 10 ) > Ref( CCI(10) , -1 ), "CCI ="+ WriteVal(CCI( 10))+ " : UP","
CCI ="+ WriteVal(CCI( 10))+ " : DOWN");
WriteIf(StochK( 14)< Ref (StochK( 14),1) ,"stochastic ="+WriteVal (StochK(14))+"
: UP " ,"stochastic =
"+WriteVal (StochK( 14))+" : DOWN ");
"";
WriteIf (Close > SAR( 0.02, 0.2 ),"SAR says : go LONG at "+Close+" \n with a Sto
p-Loss = " + WriteVal( SAR( 0.02, 0.2 )),
"SAR says : go Short at "+Close+"\n with a Stop-Loss = " + WriteVal( SA
R( 0.02, 0.2 )));
*/
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

You might also like