nma swing trading by karthik

#31
_SECTION_BEGIN("NICK MA Swing");
SetBarsRequired(200,0);

GraphXSpace = 5;
SetChartOptions(0,chartShowArrows|chartShowDates);
k = Optimize("K",Param("K",1,0.25,5,0.25),0.25,5,0.25) ;
Per= Optimize("atr",Param("atr",4,3,20,1),3,20,1);
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 ) );
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" + Name(), colorWhite, styleCandle | styleNoLabel );
j=Haclose;

//================================================== ================================================== ===================
//=========================Indicator================ ================================================== ============================
f=ATR(14);

rfsctor = WMA(H-L, Per);

revers = k * rfsctor;

Trend = 1;
NW[0] = 0;


for(i = 1; i < BarCount; i++)
{
if(Trend[i-1] == 1)
{
if(j < NW[i-1])
{
Trend = -1;
NW = j + Revers;
}
else
{
Trend = 1;
if((j - Revers) > NW[i-1])
{
NW = j - Revers;
}
else
{
NW = NW[i-1];
}
}
}
if(Trend[i-1] == -1)
{
if(j > NW[i-1])
{
Trend = 1;
NW = j - Revers;
}
else
{
Trend = -1;
if((j + Revers) < NW[i-1])
{
NW = j + Revers;
}
else
{
NW = NW[i-1];
}
}
}
}

//===============system================

Plot(NW, "", IIf(Trend == 1, 27, 4), 4);
Buy=Cover=Cross(j,nw);
Sell=Short=Cross(nw,j);
SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,C,1);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
_SECTION_END();

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 ) );


//=================TITLE============================ ================================================== ==================
_SECTION_BEGIN("Title");
if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorWhite)+ "NICK MA Swing System" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorYellow) +"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(colorWhite)+
WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
WriteIf(Buy , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","")+
WriteIf(Long AND NOT Buy, "Trade : Long - Entry price Rs."+(BuyPrice),"")+
WriteIf(shrt AND NOT Sell, "Trade : Short - Entry price Rs."+(SellPrice),"")+"\n"+
WriteIf(Long AND NOT Buy, "Current Profit/Loss Rs."+(C-BuyPrice)+"","")+
WriteIf(shrt AND NOT Sell, "Current Profit/Loss Rs."+(SellPrice-C)+"",""));
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
_SECTION_END();



thank you thank you very much sir..
sir how to trade this 5 min tf r 15 tf
 
#34
_section_begin("nick ma swing");
setbarsrequired(200,0);

graphxspace = 5;
setchartoptions(0,chartshowarrows|chartshowdates);
k = optimize("k",param("k",1,0.25,5,0.25),0.25,5,0.25) ;
per= optimize("atr",param("atr",4,3,20,1),3,20,1);
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 ) );
plotohlc( haopen, hahigh, halow, haclose, "" + name(), colorwhite, stylecandle | stylenolabel );
j=haclose;

//================================================== ================================================== ===================
//=========================indicator================ ================================================== ============================
f=atr(14);

rfsctor = wma(h-l, per);

revers = k * rfsctor;

trend = 1;
nw[0] = 0;


for(i = 1; i < barcount; i++)
{
if(trend[i-1] == 1)
{
if(j < nw[i-1])
{
trend = -1;
nw = j + revers;
}
else
{
trend = 1;
if((j - revers) > nw[i-1])
{
nw = j - revers;
}
else
{
nw = nw[i-1];
}
}
}
if(trend[i-1] == -1)
{
if(j > nw[i-1])
{
trend = 1;
nw = j - revers;
}
else
{
trend = -1;
if((j + revers) < nw[i-1])
{
nw = j + revers;
}
else
{
nw = nw[i-1];
}
}
}
}

//===============system================

plot(nw, "", iif(trend == 1, 27, 4), 4);
buy=cover=cross(j,nw);
sell=short=cross(nw,j);
sellprice=valuewhen(sell,c,1);
buyprice=valuewhen(buy,c,1);
long=flip(buy,sell);
shrt=flip(sell,buy );
_section_end();

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 ) );


//=================title============================ ================================================== ==================
_section_begin("title");
if( status("action") == actionindicator )
(
title = encodecolor(colorwhite)+ "nick ma swing system" + " - " + name() + " - " + encodecolor(colorred)+ interval(2) + encodecolor(colorwhite) +
" - " + date() +" - "+"\n" +encodecolor(coloryellow) +"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(colorwhite)+
writeif(sell , "total profit/loss for the last trade rs."+(c-buyprice)+"","")+
writeif(buy , "total profit/loss for the last trade rs."+(sellprice-c)+"","")+
writeif(long and not buy, "trade : Long - entry price rs."+(buyprice),"")+
writeif(shrt and not sell, "trade : Short - entry price rs."+(sellprice),"")+"\n"+
writeif(long and not buy, "current profit/loss rs."+(c-buyprice)+"","")+
writeif(shrt and not sell, "current profit/loss rs."+(sellprice-c)+"",""));
plotshapes(iif(buy, shapesquare, shapenone),colorgreen, 0, l, offset=-40);
plotshapes(iif(buy, shapesquare, shapenone),colorlime, 0,l, offset=-50);
plotshapes(iif(buy, shapeuparrow, shapenone),colorwhite, 0,l, offset=-45);
plotshapes(iif(sell, shapesquare, shapenone),colorred, 0, h, offset=40);
plotshapes(iif(sell, shapesquare, shapenone),colororange, 0,h, offset=50);
plotshapes(iif(sell, shapedownarrow, shapenone),colorwhite, 0,h, offset=-45);
_section_end();



thank you very much sir
this afl use intraday in mcx?/?????
Watch time fram?
 

Similar threads