My System - My trades.

euginsa

Well-Known Member
@euginsa Is that MPH/ MPL marking code is in AFL.
Could you please share it.
I had copy paste from Vijkris bro .. Need to learn more to turn it to my requirement..Its not taking all MPH MPL not sure why. If able to modify it kindly share. I am also using ERL MPH MPL with this. But no proper AFL...

SetChartBkGradientFill( ParamColor("Inner panel upper",colorDarkGrey),ParamColor("Inner panel lower",colorGrey40 ));
SetChartBkColor(colorBlack);

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", colorBlack,styleCandle);

Plot(EMA(Close,200),"",ColorRGB(0,255,255),styleLine|styleNoTitle|styleNoLabel|styleNoRescale,styleNoRescale);
Plot(EMA(Close,36),"",ColorRGB(255,255,128),styleLine|styleNoTitle|styleNoLabel|styleNoRescale,styleNoRescale);

_SECTION_BEGIN("EMA 5 MIN");
TimeFrameSet(in5Minute);
m5= EMA(Close,36) ;
Plot(TimeFrameExpand(m5, in5Minute), "", colorAqua , styleDashed);
TimeFrameRestore();
_SECTION_END();

_SECTION_BEGIN("EMA 15 MIN");
TimeFrameSet(in15Minute);
m15= EMA(Close,36) ;
Plot(TimeFrameExpand(m15, in15Minute), "", colorYellow , styleDashed);
TimeFrameRestore();
_SECTION_END();


_SECTION_BEGIN("HiLoVol");
HiLoVol=ParamToggle("HiLoVol","Off|On",1);
if(HiLoVol)
{
n=Day() != Ref(Day(), -1);

a=LowestSince(n,V);
hh=ValueWhen(V==a,H);
ll=ValueWhen(V==a,L);

//Plot(hh,"\nLVhb",colorGreen,styleDots);
//Plot(ll,"\nLVlb",colorred,styleDots);
PlotOHLC( hh, hh, ll, ll, "",colorAqua,styleCloud|styleNoRescale,Null,Null,0,-2,0);
}
_SECTION_END();

_SECTION_BEGIN("VKSLline");

VKSLline=ParamToggle("VKSLline","Off|On",1);

if(VKSLline)
{
n=Day() != Ref(Day(), -1);

a=LowestSince(n,V);
hh=ValueWhen(V==a,H);
ll=ValueWhen(V==a,L);

e36 = EMA(c,36);

res=max(e36,hh);
sup=min(e36,ll);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,sup,res);
col = IIf(avn==1,colorBrightGreen,colorRed);
col1 = IIf(avn==1,ColorRGB(64,64,64),colorRed);
plot(tsl,"\nVKSL ",col,stylethick);



y=5;
PlotOHLC(y,Y+10,y,y,"",col1,styleOwnScale|styleNoLabel|styleCloud,0,500,0,-5);
}
_SECTION_END();

_SECTION_BEGIN("EM");

EM=ParamToggle("EM","Off|On",1);

if(EM)
{

Plot( EMA( C, 36 ), "EMA36OBV", ColorRGB(255,0,255), styleLine ,styleNoLabel|styleNoRescale );
Plot( EMA( C, 200 ), "EMA200OBV", ColorRGB(102,255,204), styleLine ,styleNoLabel|styleNoRescale );
m3=EMA(C,36);
m4=EMA(C,200);
PlotOHLC(m3,m3,m4,m4,"Cloud",IIf(m3>m4,colorGreen,colorPlum),styleCloud|styleNoRescale,Null,Null,0,-2,0);
}
_SECTION_END();

_SECTION_BEGIN("PDR CRB");

TF = ParamList("TF", "15,Hr,D",2);
if( TF == "15" )
{
nd=(Minute()%15==0);
prh = ValueWhen(nd,TimeFrameGetPrice("H", in15Minute, -1));
prl = ValueWhen(nd,TimeFrameGetPrice("L", in15Minute, -1));
x = 2;
}
if( TF == "Hr" )
{
nd=Hour() != Ref(Hour(), -1);
prh = ValueWhen(nd,TimeFrameGetPrice("H", inHourly, -1));
prl = ValueWhen(nd,TimeFrameGetPrice("L", inHourly, -1));
x = 5;
}
if( TF == "D" )
{
nd=Day() != Ref(Day(), -1);
prh = ValueWhen(nd,TimeFrameGetPrice("H", inDaily, -1));
prl = ValueWhen(nd,TimeFrameGetPrice("L", inDaily, -1));
x = 30;
}


crbh = ValueWhen(nd,Ref(HHV(H,x),-1));
crbl = ValueWhen(nd,Ref(LLV(L,x),-1));

if( ParamToggle("CRB cloud", "No|Yes", 1))
{Plot(crbh,"\nCRB H",colorBlack,stylenoreScale|styleNoLabel);
Plot(crbL,"\nCRB L",colorBlack,stylenoreScale|styleNoLabel);
PlotOHLC(crbl,crbh,crbl,crbl,"",ParamColor("CRB col",colorPaleBlue),stylenoreScale|styleNoLabel|styleCloud,0,0,0,-6);
}
if( ParamToggle("PD Range ", "No|Yes", 1))
PlotOHLC(prl,prh,prl,prl,"",ParamColor("PDR col",colordarkgrey),stylenoreScale|styleNoLabel|styleCloud,0,0,0,-7);


_SECTION_END();

_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("Price Hi Lo");
y = Param("Ribbon Y",15,0,500,5);

HiP= HHV(H,5); LoP= LLV(L,5);

B2 = Cross(C,Ref(HiP,-1)); S2 = Cross(Ref(LoP,-1),C);

B2 = ExRem(B2,S2); S2 = ExRem(S2,B2);

UP2 = Flip(B2,S2); DN2 = Flip(S2,B2);

//Plot(12,"p",IIf(UP2,colorGreen,colorOrange),styleOwnScale|styleNoLabel|styleThick,0,200,0,-5,8);
PlotOHLC(y,Y+10,y,y,"",IIf(UP2,colorGreen,colorOrange),styleOwnScale|styleNoLabel|styleCloud,0,500);
//Plot(IIf(b2,1,0),"",colorBlue,styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);
//Plot(IIf(s2,1,0),"",colorRed, styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);

_SECTION_END();
_SECTION_BEGIN("OBV Hi Lo");
y = Param("Ribbon Y",5,0,500,5);

Ob = OBV(); Hi = HHV(Ob,5); Lo = LLV(Ob,5);

B1 = Cross(Ob,Ref(Hi,-1)); S1 = Cross(Ref(Lo,-1),Ob);

B1 = ExRem(B1,S1); S1 = ExRem(S1,B1);

UP1 = Flip(B1,S1); DN1 = Flip(S1,B1);

//Plot(10,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleThick,0,500,0,-5,8);
PlotOHLC(y,Y+10,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);

showVerticalObvlines = ParamToggle("Show vertical line for ribbon change", "No|Yes", 0) ;
if (showVerticalObvlines)
{
Plot(IIf(B1,1,0),"",colorBlue,styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);
Plot(IIf(S1,1,0),"",colorRed, styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1); //vertical lines
}
_SECTION_END();

_SECTION_BEGIN("OBV Hi/lo and Supp/Res");


ro = ParamField("Open", 0) ;
rh = ParamField("High", 1) ;
rl = ParamField("Low", 2) ;
rc = ParamField("Close", 3) ;


P = (rH+rL+rC)/3 ;
// = Param("Fast", 1, 1, 100, 1) ;
// = Param("Slow", 3, 1, 100, 1) ;

isemapvts = ParamToggle("Pvt Type", "H-L|obv", 1) ;

ismph = H-H ;
ismpl = L-L ;



if (isemapvts)
{

upcross = b1 ;
downcross = s1 ;


bi = BarIndex() ;

mphbar = HighestSinceBars(upcross, rH) ;
mplbar = LowestSinceBars(downcross, rL) ;

mphbi = ValueWhen(downcross, bi, 0) - ValueWhen(downcross, mphbar, 0) ;
ismph = mphbi == bi ;

mplbi = ValueWhen(upCross, bi, 0) - ValueWhen(upCross, mplbar, 0) ;
ismpl = mplbi == bi ;

ismph = IIf(downCross AND mphbar == 0, True, ismph) ;
ismpl = IIf(upcross AND mplbar == 0, True, ismpl) ;

}



_SECTION_BEGIN("OBV Sup/res lines Plot");
showobvSupResline = ParamToggle("Show Obv Sup/Res line", "No|Yes", 1) ;
if (showobvSupResline)
{
//Ch = Param("ch", 5,1,15,1);
bi = Cum(1)-1;
cbar = Param("cbar",2,2,50,1);

P1 = ismph;//GetTop(Ch);
V1 = ismpl;//GetValley(Ch);
P1 = IIf(P1,IIf(ValueWhen(P1,bi,2) < ValueWhen(V1,bi),P1,IIf(ValueWhen(P1,H,2) > H,False,P1)),P1);
P1 = IIf(P1 AND ValueWhen(P1,bi,0) > bi,IIf(ValueWhen(P1,bi,0) < ValueWhen(V1,bi,0),IIf(ValueWhen(P1,H,0) >= H,False,P1),P1),P1);
V1 = IIf(V1,IIf(ValueWhen(V1,bi,2) < ValueWhen(P1,bi),V1,IIf(ValueWhen(V1,L,2)<L,False, V1)),V1);
V1 = IIf(V1 AND ValueWhen(V1,bi,0) > bi ,IIf(ValueWhen(V1,bi,0) < ValueWhen(P1,bi,0),IIf(ValueWhen(V1,L,0) <= L, False,V1),V1),V1);
RF=ValueWhen(P1,H);
SF=ValueWhen(V1,L);
RF1 = IIf(RF AND BarsSince(P1) <=cbar,RF,Null);
SF1 = IIf(SF AND BarsSince(V1) <=cbar,SF,Null);
Plot(RF1,"",colorBlue,styleDots | styleNoLine|styleNoRescale);
Plot(SF1,"",colorBlue,styleDots | styleNoLine|styleNoRescale);
Plot(RF,"",ParamColor("Resistance",colorRed),40+16+2048);//2048 is stylenorescale
Plot(SF,"",ParamColor("Support",colorGreen),40+16+2048);
PlotShapes(IIf(P1, shapeSmallSquare,shapeNone),colorGreen,0,H,10);
PlotShapes(shapeSmallCircle*P1,colorBlack,0,H,10);
PlotShapes(IIf(V1, shapeSmallSquare,shapeNone),colorGreen,0,L,-10);
PlotShapes(shapeSmallCircle*V1,colorCustom12,0,L,-10);
}
_SECTION_END();
 

stock_mani

Well-Known Member
Very well kumudhan ji and very happy Diwali to u & tuna ji, st ji ,vk ji, time pass ji, Apache ji, subhadip ji, MB ji & all traders.
I have very much respect for market and this forum & I am glad to be a part of them.
May Diwali brings you new good things in row & u all get something new & good from this forum.
 

niftyoption

Well-Known Member

vijkris

Learner and Follower
Thanks Mr. Kumudhan, really appreciate your effort.
just want to check from senior members does this system works with MT4 or Zerodha Pi as well or need Amibroker only.
I am using MT4 and Pi

Thanks
Sunil
The afls used works in amibroker only.
The concept is universal, If u understood it, then even in kite/pi it can be used.
 

SevenD

Well-Known Member
Thanks Kumudhanji massive effort and excellent dedication from you. You packaged this well for posterity. My thanks to all who contributed in this thread and special thanks to Varunji for showing the path to sensible trading. Happy Diwali to all of you and your loved ones too.
 

XRAY27

Well-Known Member
Last edited:

Similar threads