AFL required for MCX

johnnypareek

Well-Known Member
#11
Have checked it out, Its an excellent system with hardly any false signals. Following it with discipline you never make loss with good money management month on month. They have advanced trading techniques to pyramid your positions and protect your profits.
Yes there are lots of. And if discipline is needed then u can use anything with that for sucess. Your confidence is again raising doubt that u r linked to this .


One thing for sure this is most stupid charts.
johnny
 

johnnypareek

Well-Known Member
#12
hmm check this out

HTML:
_SECTION_BEGIN("Intraday");
showsl = ParamToggle("Stop Loss Line", "Show|Hide", 0);
no=10;
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
s5d=IIf(avn==1,sup,res);

if (showsl == 0)
{Plot(s5d,"Stop Loss",colorCustom14,styleDots);}
exitlong = Cross(s5d, C);
PlotShapes(exitlong * shapeDownArrow, colorRed,0,H,-12);
exitshort = Cross(C, s5d);
PlotShapes(exitshort * shapeUpArrow, colorGreen,0,L,-12);
Amnt = Param("Investment Rs.",200000,5000,1000000,1000);
share = Amnt/C ;
SetChartOptions(0,chartShowArrows|chartShowDates);
Title =  Name() + "\n" + Date() + ", Op=" + Open + ", Hi=" + High + ", Lo=" + Low + ", LTP=" + Close + "\nNo. of Shares=" + share +"\nVol=" + Volume + "\n Ajeet Singh" ;
Plot( C, "Close", colorBlack , styleNoTitle | styleCandle | GetPriceStyle() );


Buy = exitshort;
Sell = exitlong;
Short = Sell;
Cover = Buy;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = ExRem(Short, Cover);
Cover = ExRem(Cover, Short);
AlertIf( Buy, "", "BUY @ " + C, 1 );
AlertIf( Sell, "", "SELL @ " + C, 2 );

for(i=BarCount-1;i>1;i--)
{
if(Buy[i] == 1)
{
entry = C[i];
sig = "BUY";
sl = s5d[i];
tar1 = entry + (entry * .0078);
tar2 = entry + (entry * .0234);
tar3 = entry + (entry * .0356);
bars = i;
i = 0;
}
if(Sell[i] == 1)
{
sig = "SELL";
entry = C[i];
sl = s5d[i];
tar1 = entry - (entry * .0078);
tar2 = entry - (entry * .0234);
tar3 = entry - (entry * .0356);
bars = i;
i = 0;
}
}
Offset = 20;
Clr = IIf(sig == "BUY", colorLime, colorOrange);
ssl = IIf(bars == BarCount-1, s5d[BarCount-1], Ref(s5d, -1));
sl = ssl[BarCount-1];
printf("Last " + sig + " Signal came " + (BarCount-bars) + " bars ago");
printf("\n" + sig + " @ : " + entry + "\nStop Loss : " + sl + " (" + WriteVal(IIf(sig == "SELL",entry-sl,sl-entry), 2.2) + ")"+ "\nTarget_1 : " + tar1 + "\nTarget_2 : " + tar2 + "\nTarget_3 : " + tar3);
printf("\nCurrent P/L : " + WriteVal(IIf(sig == "BUY",(C-entry),(entry-C)),2.2));


function PlotDT()
{
displacement = Param("Displacement Value", 12, 1, 100, 1);
slmode = ParamToggle("Stop Loss", "Auto|Manual", 1);
width = ParamToggle("Width", "HL|OC", 1);
Count = Param("No. of DTL", 4, 4, 20, 1);
NewDay = Day()!= Ref(Day(), -1);

for (i=BarCount-1;i > 1; i--)
{
if(NewDay[i] == 1)
{
printf("High : " + i);
if(width == 1)
{
DL = IIf(O[i] < C[i], O[i], C[i]);
DH = IIf(O[i] > C[i], O[i], C[i]);
}
else
{
DL = L[i];
DH = H[i];
}
Bars = i;
i = -1;
}
}

if(slmode==1)
{
distance = displacement;
}
else
{
distance = ((DH+DL)/2) * .01;
}

}
function PlotIndicators()
{

SetChartOptions(0,chartShowArrows|chartShowDates);
/* Standard Error Bands */
Periods = Param("Standard Error", 80, 3, 200, 1);
Smooth = Param("Smooth",14,2,100,1);


LRCurve = LinearReg( C, periods );
MALRCurve = MA(LRCurve, Smooth);
SEValue = StdErr( C, periods );
SErrorAvg = MA(SEValue, Smooth);

LowerBand = MALRCurve - SErrorAvg ;
UpperBand = MALRCurve + SErrorAvg ;

Plot( MALRCurve , "MidBand", ParamColor("ColorMB",colorIndigo) , styleDashed|styleNoTitle);
Plot( LowerBand , "LowerBand", ParamColor("ColorLo",colorOrange) , styleLine|styleThick|styleNoTitle);
Plot( UpperBand , "UpperBand", ParamColor("ColorUp",colorGreen) , styleLine|styleThick|styleNoTitle);

Ch = TimeFrameGetPrice("C", in1Minute/60);
clr = IIf(Ch[BarCount-2] > Ch[BarCount-1],colorRed,colorLime);

Plot(LineArray(0,C[BarCount-1],BarCount-1,C[BarCount-1],15), "", Clr, styleLine|styleNoLabel, Null, Null, 30);
PlotText("CMP:" + C[BarCount-1], BarCount+5, C[BarCount-1],colorBlack,Clr);

LRPeriods = Param("Length", 40, 3, 200, 1);
LRCurve = LinearReg( C, LRPeriods );

PlotLR = IIf(LRCurve < LowerBand, (LRCurve + LowerBand)/2, IIf(LRCurve > UpperBand, (LRCurve + UpperBand)/2, LRCurve));
PlotLR = (PlotLR + SwingLine)/2;
//Plot( PlotLR , "Stop Loss |", ParamColor("SLColor",colorBlue), 4+8+32+2048);
//Plot( SwingLine, "SwingLine", ParamColor( "SWColor", colorBlue ), ParamStyle("StyleSW",style=styleThick|styleNoLabel , mask=maskDefault) );

bc1 = (Cross(C, MALRCurve) OR Cross(C, UpperBand) OR Cross(C, LowerBand)) AND (C > SwingLine);
bc2 = Cross(C, SwingLine) AND (C > MALRCurve OR C > UpperBand OR C > LowerBand);

sc1 = (Cross(MALRCurve, C) OR Cross(UpperBand, C) OR Cross(LowerBand, C)) AND (C < SwingLine);
sc2 = Cross(SwingLine, C) AND (C < MALRCurve OR C < UpperBand OR C < LowerBand);
Buy = bc1 OR bc2;
Sell = sc1 OR sc2;
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
//PlotShapes(shapeCircle*Buy + shapeCircle *Sell, IIf(Buy, colorBlue, colorRed), 0, IIf(Buy, L, H), IIf(Buy, -12, 12));

}
//PlotDT();
_SECTION_END();
 

johnnypareek

Well-Known Member
#13
or may be this

HTML:
_SECTION_BEGIN("Price");

GraphXSpace=5;
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
up=4969;
dn=4952;
//Plot(up,"UP Break",5,8);
//Plot(dn,"DN Break",4,8);


_SECTION_END();




_SECTION_BEGIN("Supp and Res");
/*================================================= =============================
Global Settings
================================================== ============================*/
SetFormulaName("TT Support Resistance 1.2");
SetOption("InitialEquity", 1000000);
SetOption("NoDefaultColumns", True );
SetOption("CommissionMode", 2); //$$ per trade
SetOption("CommissionAmount", 0);
SetOption("MarginRequirement", 10);
SetOption("UsePrevBarEquityForPosSizing", True);
SetOption("UseCustomBacktestProc", True );

SetTradeDelays( 0, 0, 0, 0 );

/*================================================= =============================
User-defined Functions
================================================== ============================*/
function Support(p)
{
sup = LLV(Low, p);
sup[0] = Low[0];
p = Min(p,BarCount);
for (i = 1; i < p; i++)
{
if(Low[i] < sup[i-1]) sup[i] = Low[i];
else sup[i] = sup[i-1];
}
return sup;
}

function Resistance(p)
{
res = HHV(High, p);
res[0] = High[0];
p = Min(p,BarCount);
for (i = 1; i < p; i++)
{
if(High[i] > res[i-1]) res[i] = High[i];
else res[i] = res[i-1];
}
return res;
}

function OptimizeNot(a1, a2, a3, a4, a5)
{
return a2;
}

/*================================================= =============================
Entry and Exit Rules
================================================== ============================*/
fast = Optimize("Fast", 20, 5, 105, 5);
slow = Optimize("Slow", 140, 20, 420, 20);
FastRes = Resistance(fast);
FastSup = Support(fast);
SlowRes = Resistance(slow);
SlowSup = Support(slow);
heat = 0.05;

// determine longer term trend
// Note: could have problem if current bar is outside of all previous bars
// the trend can also be calculated within main loop, but put here for clarity
trend[0] = 0;
for(bar= 1; bar < BarCount; bar++) // bar must start from 1, otherwise trend calculation is wrong
{
if(High[bar] > SlowRes[bar-1]) trend[bar] = 1;
else if(Low[bar] < SlowSup[bar-1]) trend[bar] = -1;
else trend[bar] = trend[bar-1];
}

LastPosition = 0; // 1 - long; -1 - short
PositionRiskStop = 0;

Buy = Sell = Short = Cover = 0; // this has to be set otherwise they are undefined!!! weird
// main loop
for(bar = 5; bar < BarCount-1; bar++) // give some bars for the system to stablize
{
// Exit position by protection stop
if(LastPosition == 1)
{
// Sell at stop
if(PositionRiskStop > Low[bar] ) // skip if the signal price only touch (=) the low
{
// We just calculate the exact price to simulate Ed's skid
stopPrice = PositionRiskStop;
ff = Min(Open[bar], stopPrice) - Low[bar];
stopPrice = Min(Open[bar], stopPrice) - 0.5*ff;
Sell[bar] = 1;
SellPrice[bar] = stopPrice;
TradePrice[bar] = stopPrice;
LastPosition = 0;
}
else // move the protection stop
{
PositionRiskStop = FastSup[bar];
}
}
else if(LastPosition == -1)
{
// Cover at stop
if(PositionRiskStop < High[bar]) // skip if the signal price only touch (=) the high
{
stopPrice = PositionRiskStop;
ff = High[bar] - Max(Open[bar], stopPrice);
stopPrice = Max(Open[bar], stopPrice) + 0.5*ff;
Cover[bar] = 1;
CoverPrice[bar] = stopPrice;
TradePrice[bar] = stopPrice;
LastPosition = 0;
}
else // move the protection stop
{
PositionRiskStop = FastRes[bar];
}
}
// Enter position only when last position has been closed
else {
if(trend[bar-1] == 1)
{
// buy at stop
if( fastRes[bar-1] < High[bar])
{
ff = High[bar] - Max(Open[bar], FastRes[bar-1]);
stopPrice = Max(Open[bar], FastRes[bar-1]) + 0.5*ff;
f = heat/(FastRes[bar-1] - FastSup[bar-1]);
Buy[bar] = 1;
BuyPrice[bar] = stopPrice;
PositionSize[bar] = f; //this value is passed to CBT for position sizing
LastPosition = 1;
PositionRiskStop = FastSup[bar];
TradePrice[bar] = stopPrice;
}
}
else if(trend[bar-1] == -1)
{
// short at stop
if( FastSup[bar-1] > Low[bar])
{
ff = Min(Open[bar], FastSup[bar-1]) - Low[bar];
stopPrice = Min(Open[bar], FastSup[bar-1]) - 0.5*ff;
f = heat/(FastRes[bar-1] - FastSup[bar-1]);
Short[bar] = 1;
ShortPrice[bar] = stopPrice;
PositionSize[bar] = f; //this value is passed to CBT for position sizing
LastPosition = -1;
PositionRiskStop = FastRes[bar];
TradePrice[bar] = stopPrice;
}
}
}
}

// close final day for accounting purpose
bar = BarCount-1;
if(LastPosition == 1) { Sell[bar] = 1; SellPrice[bar] = (Low[bar]+Close[bar])/2; }
else if(LastPosition == -1) { Cover[bar] = 1; CoverPrice[bar] = (High[bar]+Close[bar])/2; }

/*================================================= =============================
Automatic Analysis Action Options
================================================== ============================*/
AAAction = Status("action");
if(AAAction == actionIndicator)
{
Plot(FastRes, "FastRes", colorRed);
Plot(SlowRes, "SlowRes", colorPink);
Plot(FastSup, "FastSup", colorGreen);
Plot(SlowSup, "SlowSup", colorBlue);
}
else if(AAAction == actionExplore)
{
Filter = 1;
AddColumn( DateTime(), "Date", formatDateTime );
AddColumn(O, "Open");
AddColumn(H, "High");
AddColumn(L, "Low");
AddColumn(C, "Close");
AddColumn(FastRes, "FastRes");
AddColumn(SlowRes, "SlowRes");
AddColumn(FastSup, "FastSup");
AddColumn(SlowSup, "SlowSup");
AddColumn(Trend, "Trend");
AddColumn(IIf(Buy, Asc("B"), IIf(Sell, Asc("S"), IIf(Short, Asc("SS"), IIf(Cover, Asc("C"), 0)))) , "Signal", formatChar);
AddColumn(TradePrice, "TradePrice");
}
else if(AAAction == actionPortfolio)
{
bo = GetBacktesterObject();
bo.PreProcess(); // Initialize backtester
for( bar=0; bar < BarCount; bar++)
{
eq = bo.Equity;
for ( sig=bo.GetFirstSignal(bar); sig; sig=bo.GetNextSignal(bar) )
{
if (sig.isExit())
{
if(bo.ExitTrade(bar,sig.symbol,sig.Price))
{
_TRACE("EXIT: " + sig.symbol + "@" + sig.Price);
}
}
}

// update stats after closing trades
bo.UpdateStats(bar, 1 );

for ( sig=bo.GetFirstSignal(bar); sig; sig=bo.GetNextSignal(bar))
{
if (sig.isEntry())
{
// sig.PosSize is passed from Phase I.
shares = round((eq*sig.PosSize)/100)*100;
ps = shares * sig.Price;

if(bo.EnterTrade(bar, sig.symbol, sig.IsLong, sig.Price, ps, sig.PosScore,sig.RoundLotSize))
{
_TRACE("ENTRY: " + sig.symbol + " @" + sig.Price + " PosScore=" + sig.PosScore + " PosSize=" + ps);
}
}
}

bo.UpdateStats(bar,1); // MAE/MFE is updated when timeinbar is set to 1.
bo.UpdateStats(bar,2);
}
bo.PostProcess(); // Finalize backtester
}
/*================================================= =============================
End of Formula
================================================== ============================*/
_SECTION_END();
 

johnnypareek

Well-Known Member
#14
or may be this

HTML:
_SECTION_BEGIN("ERO ATR BUY SELL");

ero = Param("ATR multiple", 2.8, 0.5, 10, 0.1 )*Param("ATR period", 10, 3, 50 );
ero_col=ParamColor( "Color", colorCycle );

r=HHV(H,ero);
s=LLV(L,ero);
ab=IIf(H>Ref(r,-1),1,IIf(L<Ref(s,-1),-1,0));
ac=ValueWhen(ab!=0,ab,1);
sl=IIf(ac==1,s,r);

Plot(sl, _DEFAULT_NAME(), ero_col, styleStaircase); // or styleaArea

Buy=Cross(H,sl);
Sell=Cross(sl,L);
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();

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
 

yasu222

Active Member
#17
Can anybody give this afl plz
In Metastock Code like this -

In mno:=Input("Swing/ Bars", 1, 20, 2);
res:=HHV(H,no);
sup:=LLV(L,no);
HLd:=If(High>Ref(res,-1),
{then}1,
{else}If(Low<Ref(sup,-1),
{then}-1,
{else}0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,
{then}res,
{else}sup);
HiLo;
 

Bewinner

Well-Known Member
#18
Have checked it out, Its an excellent system with hardly any false signals. Following it with discipline you never make loss with good money management month on month. They have advanced trading techniques to pyramid your positions and protect your profits.

How did u checked it Comex? Means If I want to check how do I get Livestreaming?
 

comex

Active Member
#20
How did u checked it Comex? Means If I want to check how do I get Livestreaming?
Had been to their office in bangalore. Thats the reason i was interested in this, just check it out. Jhonny bhai i am very much here, surely will be gone till monday on official work.
 

Similar threads