hello guys,hws u all .my system is ready and has been coded by purusharth. for that i give personal thanks to them , iam posting it for the purpose of testing and further development of the system ,so senior guys plz take a luk at it test it tell me the drawbacks to improvise it. i learnt so much from this forum and now i feel like to give it back whatever new thing i learn for all the newbie traders ,i ll always try to post gud and valuable stuff frm myside advance thanxx to all the senior guyzz who generously reply and give valuable suggestions.
this is wat i made
/* Done by amitkawale23
_SECTION_BEGIN("SuperTrend");
SetBarsRequired(100000,0);
GraphXSpace = 15;
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( C, "Close", ParamColor("Color", colorWhite ), styleThick | ParamStyle("Style") | GetPriceStyle() );
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
PositionSize = 350000;
TrendMode = ParamToggle("TrendMode","Off|On",1);
Factor=Optimize("Factor",2,0.1,10,0.1);
Pd=Optimize("ATR Periods",5,1,20,1);
Up=(H+L)/2+(Factor*ATR(Pd));
Dn=(H+L)/2-(Factor*ATR(Pd));
iATR=ATR(Pd);
TrendUp=TrendDown=Null;
trend[0]=1;
changeOfTrend=0;
flag=flagh=0;
for (i = 1; i <BarCount; i++) {
TrendUp
= Null;
TrendDown = Null;
trend=1;
if (Close>Up[i-1]) {
trend=1;
if (trend[i-1] == -1) changeOfTrend = 1;
}
else if (Close<Dn[i-1]) {
trend=-1;
if (trend[i-1] == 1) changeOfTrend = 1;
}
else if (trend[i-1]==1) {
trend=1;
changeOfTrend = 0;
}
else if (trend[i-1]==-1) {
trend=-1;
changeOfTrend = 0;
}
if (trend<0 && trend[i-1]>0) {
flag=1;
}
else {
flag=0;
}
if (trend>0 && trend[i-1]<0) {
flagh=1;
}
else {
flagh=0;
}
if (trend>0 && Dn<Dn[i-1]){
Dn=Dn[i-1];
}
if (trend<0 && Up>Up[i-1])
{ Up=Up[i-1];
}
if (flag==1)
{ Up=(H+L)/2+(Factor*iATR);;
}
if (flagh==1)
{ Dn=(H+L)/2-(Factor*iATR);;
}
if (trend==1) {
TrendUp=Dn;
if (changeOfTrend == 1) {
TrendUp[i-1] = TrendDown[i-1];
changeOfTrend = 0;
}
}
else if (trend==-1) {
TrendDown=Up;
if (changeOfTrend == 1) {
TrendDown[i-1] = TrendUp[i-1];
changeOfTrend = 0;
}
}
}
Plot(TrendUp,"Trend",colorWhite);
Plot(TrendDown,"Down",colorWhite);
/*========================================================================================================================================================================*/
/*========================================================================================================================================================================*/
/*========================================================================================================================================================================*/
TrendMode = ParamToggle("TrendMode","Off|On",1);
Factor1=Optimize("Factor1",0.6,5,10,2);
Pd1=Optimize("ATR Periods1",5,1,10,1);
Up1=(H+L)/2+(Factor1*ATR(Pd1));
Dn1=(H+L)/2-(Factor1*ATR(Pd1));
iATR1=ATR(Pd1);
TrendUp1=TrendDown1=Null;
trend1[0]=1;
changeOfTrend1=0;
flag1=flagh1=0;
for (i = 1; i <BarCount; i++) {
TrendUp1 = Null;
TrendDown1 = Null;
trend1=1;
if (Close>Up1[i-1]) {
trend1=1;
if (trend1[i-1] == -1) changeOfTrend1 = 1;
}
else if (Close<Dn1[i-1]) {
trend1=-1;
if (trend1[i-1] == 1) changeOfTrend1 = 1;
}
else if (trend1[i-1]==1) {
trend1=1;
changeOfTrend1 = 0;
}
else if (trend1[i-1]==-1) {
trend1=-1;
changeOfTrend1 = 0;
}
if (trend1<0 && trend1[i-1]>0) {
flag1=1;
}
else {
flag1=0;
}
if (trend1>0 && trend1[i-1]<0) {
flagh1=1;
}
else {
flagh1=0;
}
if (trend1>0 && Dn1<Dn1[i-1]){
Dn1=Dn1[i-1];
}
if (trend1<0 && Up1>Up1[i-1])
{ Up1=Up1[i-1];
}
if (flag1==1)
{ Up1=(H+L)/2+(Factor1*iATR1);;
}
if (flagh1==1)
{ Dn1=(H+L)/2-(Factor1*iATR1);;
}
if (trend1==1) {
TrendUp1=Dn1;
if (changeOfTrend1 == 1) {
TrendUp1[i-1] = TrendDown1[i-1];
changeOfTrend1 = 0;
}
}
else if (trend1==-1) {
TrendDown1=Up1;
if (changeOfTrend1 == 1) {
TrendDown1[i-1] = TrendUp1[i-1];
changeOfTrend1 = 0;
}
}
}
Plot(TrendUp1,"Trend",colorBlue);
Plot(TrendDown1,"Down",colorRed);
/*========================================================================================================================================================================*/
/*========================================================================================================================================================================*/
/*========================================================================================================================================================================*/
Buy = trend==1 AND trend1==1 ;
Short=trend==-1 AND trend1==-1;
Sell=trend1==-1;
Cover=trend1==1;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
BuyPrice=ValueWhen(Buy,C);
SellPrice=ValueWhen(Sell,C);
ShortPrice=ValueWhen(Short,C);
CoverPrice=ValueWhen(Cover,C);
Title = EncodeColor(colorWhite)+ "Super Trend AFL code from www.marketcalls.in" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorRed) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+"\n"+
EncodeColor(colorLime)+
WriteIf (Buy , " GO LONG / Reverse Signal at "+C+" ","")+
WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")+"\n"+EncodeColor(colorYellow)+
WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
WriteIf(Buy , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","");
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-20);
PlotShapes(IIf(Sell==1, shapeStar, shapeNone), colorRed, 0,High, Offset=30);
PlotShapes(IIf(Short==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
PlotShapes(IIf(Cover==1, shapeStar, shapeNone), colorGreen, 0,Low, Offset=-30);
_SECTION_END();
/* Done by amitkawal23