Hi all
I wanted to share my "MultiShow" indicator !
It's a MultiShow, because you can select multiple indicators, but also
select the base for these indicators in parameters.
I created one simple criteria for long/short
This gives a great presentation of good buy or sell opportunities, and it may well lay foundation to a system
Thanks to KelvinHand I know how to combine parameters !
_SECTION_BEGIN("_MultiShow Indicator");
GraphXSpace = 25;
////////////////////////////////////////////////////////////////////////////////
function DetrendedPriceOsc( Periods )
{
return C- AMA(Ref( MA( C, Periods ), -( 1 + Periods/2 ) ),0.5);
}
////////////////////////////////////////////////////////////////////////////////
indyOpt = ParamList("Indicator", "EMA|MA|TEMA|DEMA|WMA|Wilders");
periods = Optimize("period ",Param("DPO periods ",7,1,50,1),1,50,2);
Fast = Optimize("Fast",Param("Fast-Line ( blue )",9,1,28,1),1,28,1);
Slow = Optimize("Slow",Param("Slow-Line ( red )",26,1,28,1),1,28,1);
Base = ParamList("Based On", "DPO|Open|High|Low|Close|OHLC|HLC|HL|RSIa");
switch (Base)
{
case "DPO":
ArrayBase = DetrendedPriceOsc( Periods );
break;
case "Open":
ArrayBase = Open;
break;
case "High":
ArrayBase = High;
break;
case "Low":
ArrayBase = Low;
break;
case "Close":
ArrayBase = Close;
break;
case "OHLC":
ArrayBase = (O+H+L+C)/4;
break;
case "HLC":
ArrayBase = (H+L+C)/3;
break;
case "HL":
ArrayBase = (H+L)/2;
break;
case "RSIa":
ArrayBase = RSIa(DetrendedPriceOsc( Periods ),Periods);
break;
}
switch (indyOpt)
{
case "EMA":
ArrayFast = EMA ( ArrayBase, Fast );
ArraySlow = EMA ( ArrayBase, Slow );
break;
case "MA":
ArrayFast = MA ( ArrayBase, Fast );
ArraySlow = MA ( ArrayBase, Slow );
break;
case "TEMA":
ArrayFast = TEMA ( ArrayBase, Fast );
ArraySlow = TEMA ( ArrayBase, Slow );
break;
case "DEMA":
ArrayFast = DEMA ( ArrayBase, Fast );
ArraySlow = DEMA ( ArrayBase, Slow );
break;
case "WMA":
ArrayFast = WMA( ArrayBase, Fast );
ArraySlow = WMA( ArrayBase, Slow );
break;
case "Wilders":
ArrayFast = Wilders ( ArrayBase, Fast );
ArraySlow = Wilders ( ArrayBase, Slow );
break;
}
Shortname = " USE_"+indyOpt+"";
Plot ( ArrayFast , Shortname , colorBlue);
Plot ( ArraySlow , Shortname , colorRed);
PlotOHLC (ArrayFast ,ArrayFast ,ArraySlow ,ArraySlow ,"Cloud",ColorBlend( colorWhite, colorBlue, 0.1 ), styleCloud | styleNoRescale, Null, Null, Null, -1 );;
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("Buy/Sell Criteria");
//Entry Criteria Long
Long1 = (ArraySlow -ArrayFast ) < Ref((ArraySlow -ArrayFast ),-1) ;
//Entry Criteria Short //
Short1 = (ArraySlow -ArrayFast ) > Ref((ArraySlow -ArrayFast ),-1) ;
Buy= Long1 ;
Sell=0;
Short= Short1 ;
Cover=0;
Buy=ExRem(Buy,Short);
Short=ExRem(Short,Buy);
PlotShapes( Buy * shapeUpArrow , colorDarkGreen, 0);
PlotShapes( Short * shapeDownArrow , colorDarkRed, 0);
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("Ribbon");
ShowRibbon = ParamToggle("Ribbon","No|Yes",0);
uptrend=Buy;
downtrend=Short;
if (ShowRibbon ) Plot( 2, "Ribbon",IIf( uptrend, colorGreen, IIf( downtrend, colorRed, colorLavender )), styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("Bollinger Bands (Area)");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorLightGrey );
Style = ParamStyle("Style") | styleNoRescale;;
Plot( bbt = BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style );
Plot( bbb = BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style );
PlotOHLC( bbt, bbt, bbb, bbb, "", ColorBlend( Color, colorWhite, 0.9 ), styleCloud | styleNoRescale, Null, Null, Null, -1 );
bbm = ((bbt +bbb )/2);
Plot( bbm , "BBMid" + _PARAM_VALUES(), Color, styleDashed );
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////
I wanted to share my "MultiShow" indicator !
It's a MultiShow, because you can select multiple indicators, but also
select the base for these indicators in parameters.
I created one simple criteria for long/short
This gives a great presentation of good buy or sell opportunities, and it may well lay foundation to a system
Thanks to KelvinHand I know how to combine parameters !
_SECTION_BEGIN("_MultiShow Indicator");
GraphXSpace = 25;
////////////////////////////////////////////////////////////////////////////////
function DetrendedPriceOsc( Periods )
{
return C- AMA(Ref( MA( C, Periods ), -( 1 + Periods/2 ) ),0.5);
}
////////////////////////////////////////////////////////////////////////////////
indyOpt = ParamList("Indicator", "EMA|MA|TEMA|DEMA|WMA|Wilders");
periods = Optimize("period ",Param("DPO periods ",7,1,50,1),1,50,2);
Fast = Optimize("Fast",Param("Fast-Line ( blue )",9,1,28,1),1,28,1);
Slow = Optimize("Slow",Param("Slow-Line ( red )",26,1,28,1),1,28,1);
Base = ParamList("Based On", "DPO|Open|High|Low|Close|OHLC|HLC|HL|RSIa");
switch (Base)
{
case "DPO":
ArrayBase = DetrendedPriceOsc( Periods );
break;
case "Open":
ArrayBase = Open;
break;
case "High":
ArrayBase = High;
break;
case "Low":
ArrayBase = Low;
break;
case "Close":
ArrayBase = Close;
break;
case "OHLC":
ArrayBase = (O+H+L+C)/4;
break;
case "HLC":
ArrayBase = (H+L+C)/3;
break;
case "HL":
ArrayBase = (H+L)/2;
break;
case "RSIa":
ArrayBase = RSIa(DetrendedPriceOsc( Periods ),Periods);
break;
}
switch (indyOpt)
{
case "EMA":
ArrayFast = EMA ( ArrayBase, Fast );
ArraySlow = EMA ( ArrayBase, Slow );
break;
case "MA":
ArrayFast = MA ( ArrayBase, Fast );
ArraySlow = MA ( ArrayBase, Slow );
break;
case "TEMA":
ArrayFast = TEMA ( ArrayBase, Fast );
ArraySlow = TEMA ( ArrayBase, Slow );
break;
case "DEMA":
ArrayFast = DEMA ( ArrayBase, Fast );
ArraySlow = DEMA ( ArrayBase, Slow );
break;
case "WMA":
ArrayFast = WMA( ArrayBase, Fast );
ArraySlow = WMA( ArrayBase, Slow );
break;
case "Wilders":
ArrayFast = Wilders ( ArrayBase, Fast );
ArraySlow = Wilders ( ArrayBase, Slow );
break;
}
Shortname = " USE_"+indyOpt+"";
Plot ( ArrayFast , Shortname , colorBlue);
Plot ( ArraySlow , Shortname , colorRed);
PlotOHLC (ArrayFast ,ArrayFast ,ArraySlow ,ArraySlow ,"Cloud",ColorBlend( colorWhite, colorBlue, 0.1 ), styleCloud | styleNoRescale, Null, Null, Null, -1 );;
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("Buy/Sell Criteria");
//Entry Criteria Long
Long1 = (ArraySlow -ArrayFast ) < Ref((ArraySlow -ArrayFast ),-1) ;
//Entry Criteria Short //
Short1 = (ArraySlow -ArrayFast ) > Ref((ArraySlow -ArrayFast ),-1) ;
Buy= Long1 ;
Sell=0;
Short= Short1 ;
Cover=0;
Buy=ExRem(Buy,Short);
Short=ExRem(Short,Buy);
PlotShapes( Buy * shapeUpArrow , colorDarkGreen, 0);
PlotShapes( Short * shapeDownArrow , colorDarkRed, 0);
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("Ribbon");
ShowRibbon = ParamToggle("Ribbon","No|Yes",0);
uptrend=Buy;
downtrend=Short;
if (ShowRibbon ) Plot( 2, "Ribbon",IIf( uptrend, colorGreen, IIf( downtrend, colorRed, colorLavender )), styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("Bollinger Bands (Area)");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorLightGrey );
Style = ParamStyle("Style") | styleNoRescale;;
Plot( bbt = BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style );
Plot( bbb = BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style );
PlotOHLC( bbt, bbt, bbb, bbb, "", ColorBlend( Color, colorWhite, 0.9 ), styleCloud | styleNoRescale, Null, Null, Null, -1 );
bbm = ((bbt +bbb )/2);
Plot( bbm , "BBMid" + _PARAM_VALUES(), Color, styleDashed );
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////