_SECTION_BEGIN("Background_Setting");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
ParamColor("BgBottom", colorDarkGrey),ParamColor("TitleBack",colorGrey40));
SetChartBkColor(ParamColor("Outer Panel",colorPaleBlue));
SetChartOptions(0,chartShowArrows|chartShowDates);
//grid_day = Day()!=Ref(Day(),-1);
//Plot(grid_day,"",31,styleHistogram|styleDots|styleNoLabel|styleOwnScale);
GraphXSpace=10;
_SECTION_END();
_SECTION_BEGIN("Price");
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
};
_SECTION_BEGIN("Candle color");
upbar= C > Ref(H,-1) ;
dnbar= C < Ref(L,-1);
SetBarFillColor(IIf(upbar,ParamColor("Candle UP Color", colorGreen),IIf(dnbar,ParamColor("Candle Down Color", colorRed),colorLightGrey)));
Plot(C,"Close",IIf(upbar,ParamColor("UP Color", colorDarkGreen),IIf(dnbar,ParamColor("Down Color", colorDarkRed),colorLightGrey)),64,0,0,0,0);
_SECTION_END();
_SECTION_END();
_SECTION_BEGIN("SAR");
acc = Param("Acceleration", 0.02, 0, 1, 0.001 );
accm = Param("Max. acceleration", 0.2, 0, 1, 0.001 );
Plot( SAR( acc, accm ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style", styleDots | styleNoLine, maskDefault | styleDots | styleNoLine ) );
_SECTION_END();
_SECTION_BEGIN("Trade SYstem");
tgt=Param("Target",50,10,100,1);
uptrend1= ((PDI()> MDI()));
dntrend1=((PDI()< MDI()));
Plot( 2, "tf1", IIf( uptrend1, 5, IIf( dntrend1, 4, colorLightYellow)), styleOwnScale|styleArea|styleNoLabel, -1, 100 );
Buy = Cross(Close, SAR(acc,accm)) AND uptrend1;
Sell = Cross(SAR(acc,accm), Close ) AND dntrend1;
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
BuyPrice=ValueWhen(Buy,C,1); // L in place of C
SellPrice=ValueWhen(Sell,C,1); // H in place of C
trailArray = SAR( acc, accm );
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone), colorBrightGreen, 0, Low, Offset=-15);
PlotShapes(IIf(Sell, shapeDownArrow,shapeNone), colorRed, 0, High, Offset=-15);
Title =EncodeColor(colorYellow)+"PSAR ~ [subroto] "+"\n"+
EncodeColor(colorWhite)+ Name () + "\n"
+EncodeColor(colorWhite) + Date() +"" + "\n"
+EncodeColor(colorWhite)+ "Op : "+ EncodeColor(colorWhite)+ O
+EncodeColor(colorWhite)+ "Hi : "+ EncodeColor(colorWhite)+ H
+EncodeColor(colorWhite)+ "Lo : "+ EncodeColor(colorWhite)+ L
+EncodeColor(colorWhite)+ "Cls : "+ WriteIf(C> Ref(C, -1),EncodeColor(colorBrightGreen),EncodeColor(colorGold))+ C
+EncodeColor(colorWhite)+ "\nVolume : " + EncodeColor(colorWhite)+ numtostr (V,1.0)+ "\n\n"
+EncodeColor(colorWhite)+ " Stop & Reverse @ : "+ EncodeColor(colorWhite)+ NumToStr(trailarray,1.2);
_SECTION_END();
_SECTION_BEGIN("Background_Setting");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
ParamColor("BgBottom", colorDarkGrey),ParamColor("TitleBack",colorGrey40));
SetChartBkColor(ParamColor("Outer Panel",colorPaleBlue));
SetChartOptions(0,chartShowArrows|chartShowDates);
//grid_day = Day()!=Ref(Day(),-1);
//Plot(grid_day,"",31,styleHistogram|styleDots|styleNoLabel|styleOwnScale);
GraphXSpace=10;
_SECTION_END();
_SECTION_BEGIN("Price");
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
};
_SECTION_BEGIN("Candle color");
upbar= C > Ref(H,-1) ;
dnbar= C < Ref(L,-1);
SetBarFillColor(IIf(upbar,ParamColor("Candle UP Color", colorGreen),IIf(dnbar,ParamColor("Candle Down Color", colorRed),colorLightGrey)));
Plot(C,"Close",IIf(upbar,ParamColor("UP Color", colorDarkGreen),IIf(dnbar,ParamColor("Down Color", colorDarkRed),colorLightGrey)),64,0,0,0,0);
_SECTION_END();
_SECTION_END();
_SECTION_BEGIN("SAR");
acc = Param("Acceleration", 0.02, 0, 1, 0.001 );
accm = Param("Max. acceleration", 0.2, 0, 1, 0.001 );
Plot( SAR( acc, accm ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style", styleDots | styleNoLine, maskDefault | styleDots | styleNoLine ) );
_SECTION_END();
_SECTION_BEGIN("Trade SYstem");
tgt=Param("Target",50,10,100,1);
uptrend1= ((PDI()> MDI()));
dntrend1=((PDI()< MDI()));
Plot( 2, "tf1", IIf( uptrend1, 5, IIf( dntrend1, 4, colorLightYellow)), styleOwnScale|styleArea|styleNoLabel, -1, 100 );
Buy = Cross(Close, SAR(acc,accm)) AND uptrend1;
Sell = Cross(SAR(acc,accm), Close ) AND dntrend1;
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
BuyPrice=ValueWhen(Buy,C,1); // L in place of C
SellPrice=ValueWhen(Sell,C,1); // H in place of C
trailArray = SAR( acc, accm );
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone), colorBrightGreen, 0, Low, Offset=-15);
PlotShapes(IIf(Sell, shapeDownArrow,shapeNone), colorRed, 0, High, Offset=-15);
Title =EncodeColor(colorYellow)+"PSAR ~ [subroto] "+"\n"+
EncodeColor(colorWhite)+ Name () + "\n"
+EncodeColor(colorWhite) + Date() +"" + "\n"
+EncodeColor(colorWhite)+ "Op : "+ EncodeColor(colorWhite)+ O
+EncodeColor(colorWhite)+ "Hi : "+ EncodeColor(colorWhite)+ H
+EncodeColor(colorWhite)+ "Lo : "+ EncodeColor(colorWhite)+ L
+EncodeColor(colorWhite)+ "Cls : "+ WriteIf(C> Ref(C, -1),EncodeColor(colorBrightGreen),EncodeColor(colorGold))+ C
+EncodeColor(colorWhite)+ "\nVolume : " + EncodeColor(colorWhite)+ numtostr (V,1.0)+ "\n\n"
+EncodeColor(colorWhite)+ " Stop & Reverse @ : "+ EncodeColor(colorWhite)+ NumToStr(trailarray,1.2);
_SECTION_END();