per esteso
Longcond= Cross(MACD(12,26),Signal()) AND ADX(30)>10;
Sellcond= Cross(Signal(),MACD(12,26)) AND ADX(30)>10;
Buy=Cover=Longcond;
Short=Sell=Sellcond;
//--------------------------------------------------------------Plotta Buy/Sell/Short/Cover ------------------------------
//-------------------------------------------------------------- " Setup ------------------------------
Frecce=Param("Frecce setup",1,0,1,1);
FrecceBS=Param("Frecce Buy/S/Short/C",1,0,1,1);
Buy1=ExRem(Buy,Sell);
Sell1=ExRem(Sell,Buy);
Short1=ExRem(Short,Cover);
Cover1=ExRem(Cover,Short);
//PlotShapes(IIf(shortsetupon AND frecce,shapeDownArrow,shapeNone),colorOrange,0, H ,-20);
//PlotShapes(IIf(buysetupon AND frecce,shapeUpArrow,shapeNone),colorGreen ,0,L,-20);
PlotShapes(IIf(Buy1 AND frecceBS,shapeUpArrow,shapeNone),colorBlue ,0,L,-40);
PlotShapes(IIf(Sell1 AND frecceBS,shapeDownArrow,shapeNone),colorBlack,0, H ,-40);
PlotShapes(IIf(Short1 AND frecceBS,shapeDownArrow,shapeNone),colorRed ,0,H, -40);
PlotShapes(IIf(Cover1 AND frecceBS,shapeUpArrow,shapeNone),colorBlack,0,L, -40);
//------------------------------------------------------------------------------------------------
//------------------------------ PLOTTA Close COLORATO a seconda della posizione ----------------
titolo=Param("Grafico Titolo ?",1,0,1,1);
tipografico=Param("Candele 64 o Barre 128 ?",64,64,128,64);
Buyc=Flip(Buy,Sell);
Sellc=Flip(Sell,Buy);
Coverc=Flip(Cover,Short);
Shortc=Flip(Short,Cover);
color=IIf(Buyc ,colorGreen,IIf(Shortc,colorRed,colorBlack));
Plot( IIf(titolo,C,Null) ,"c",Color,128);
Plot( IIf(titolo AND (Buyc OR Shortc),C,Null) ,"c",Color,64);
eq=Param("equity",1,0,1,1);
equi=IIf(eq==0,Null,Equity( ));
Buy1=Flip(Buy,Sell);
Sell1=Flip(Sell,Buy);
Short1=Flip(Short,Cover);
Cover1=Flip(Cover,Short);
Plot( Equi,"equity",IIf(Buy1 ,colorSkyblue ,IIf(short1,colorPink,Null) ), styleArea+styleLeftAxisScale);
dr = Equi- Highest(Equi);
Plot(dr, "Drawdown", colorDarkRed, styleArea+styleLeftAxisScale );
Maxdr=LLV(dr,500);
Plot( Maxdr , "Max Drawdown", colorDarkRed, styleLine+styleLeftAxisScale );
/*
eq=Param("equity",0,0,1,1);
equi=IIf(eq==0,Null,Equity( ));
Buy1=Flip(Buy,Sell);
Sell1=Flip(Sell,Buy);
Short1=Flip(Short,Cover);
Cover1=Flip(Cover,Short);
Plot( Equi,"equity",IIf(Buy1 ,colorSkyblue ,IIf(Short1,colorPink ,Null )), styleArea+styleLeftAxisScale);
dr = Equi- Highest(Equi);
Plot(dr, "Drawdown", colorDarkRed, styleArea+styleLeftAxisScale );
Maxdr=LLV(dr,500);
Plot( Maxdr , "Max Drawdown", colorDarkRed, styleLine+styleLeftAxisScale );*/