Varun's plain trading System For OMKAAR ji

Please post all your studies here so other ppl can be benefited

Varun's plain trading System For OMKAAR ji

Unread postby varun » Tue May 08, 2018 7:01 pm

_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();
function mcg(P,pr)
{
MD[0] = p[0];
for( i = 1; i < BarCount; i++ )
{
MD[ i ] = MD[ i - 1 ] + (p[i]-MD[i-1])/( pr*(p[i] / MD[i-1])^4) ;
}
return md;
}
N1 = Param("McGinley N1 ",36,1,400,1);
N2 = Param("McGinley N2 ",200,1,4000,1);

x1= mcg(C,n1);
x2= mcg(C,n2);

mcolor = IIf((x1< C), IIf(ROC(C)>0,colorBrightGreen,19),IIf(ROC(C)<0,colorRed,13));
mcolor2 = IIf((x2< C), IIf(ROC(C)>0,colorBrightGreen,19),IIf(ROC(C)<0,colorRed,13));

Plot(x1,"\n McGinley I",mcolor,styleThick);
Plot(x2,"\n McGinley II",mcolor2,styleThick);




_SECTION_BEGIN( "KC Bands" );
SetChartOptions( 0, chartShowArrows | chartShowDates );
ShowCandles = ParamToggle( "Show Candles", "No|Yes", 0 );

if( ShowCandles )
{
Plot( C, "", ParamColor( "Color", colorDefault ), GetPriceStyle() );
}

//Peaking Volumes
showVC = ParamToggle( "Show Volume on Candle", "No|Yes", 0 ) ;
HiVolume = IIf( V > ( 1.2 * MA( V, 10 ) ), True, False );

if( showVC )
{
PlotShapes( shapeSmallCircle * HiVolume, IIf( C > O, colorBlack, colorWhite ), 0, ( O + C ) / 2, 0 );
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C ;
}

// KC Parameters
ShowKC1 = ParamToggle( "Show KC1", "No|Yes", 1 );
ShowKC1Mid = ParamToggle( "Show KC1Mid", "No|Yes", 0 );
ShowKC2 = ParamToggle( "Show KC2", "No|Yes", 0 );
ShowKC2Mid = ParamToggle( "Show KC2Mid", "No|Yes", 0 );
ShowKC3 = ParamToggle( "Show KC3", "No|Yes", 1 );
ShowKC3Mid = ParamToggle( "Show KC3Mid", "No|Yes", 0 );
ShowKC4 = ParamToggle( "Show KC4", "No|Yes", 1 );
ShowKC4Mid = ParamToggle( "Show KC4Mid", "No|Yes", 0 );
ShowKCARR = ParamToggle( "Show KC ARR", "No|Yes", 0 );
ShowKC5 = ParamToggle( "Show KC5", "No|Yes", 1 );
// KC1
P = ParamField( "Price field", -1 );
Period1 = Param( "Period1", 9, 2, 200, 1 );
Width1 = Param( "Width1", 1.4, 0, 10, 0.05 );
k1Color = ParamColor( "k1Color", colorBlack );
k1Style = ParamStyle( "k1Style", styleDashed | styleNoRescale | styleNoLabel );
MAType1 = Param( "MAType1", 2, 1, 2, 1 );

if( MAType1 == 1 )
{
CenterLine1 = MA( P, Period1 );
}

if( MAType1 == 2 )
{
CenterLine1 = EMA( P, Period1 );
}

if( ShowKC1Mid )
{
Plot( CenterLine1, "", ParamColor( "kc1Mid Color", colorRed ), ParamStyle( "kc1Mid Style", styleLine ) );
}

KTop1 = CenterLine1 + Width1 * ATR( Period1 );
KBot1 = CenterLine1 - Width1 * ATR( Period1 );

if( ShowKC1 )
{
Plot( KTop1, "", k1Color, k1Style );
Plot( KBot1, "", k1Color, k1Style );
}

// KC2
Period2 = Param( "Period2", 45, 2, 300, 1 );
Width2 = Param( "Width2", 3, 0, 10, 0.05 );
k2Color = ParamColor( "k2Color", colorCustom14 );
k2Style = ParamStyle( "k2Style", styleThick | styleNoRescale );
MAType2 = Param( "MAType2", 2, 1, 2, 1 );

if( MAType2 == 1 )
{
CenterLine2 = MA( P, Period2 );
}

if( MAType2 == 2 )
{
CenterLine2 = EMA( P, Period2 );
}

if( ShowKC2Mid )
{
Plot( CenterLine2, "", ParamColor( "kc2Mid Color", colorRed ), ParamStyle( "kc2Mid Style", styleLine ) );
}

KTop2 = CenterLine2 + Width2 * ATR( Period2 );
KBot2 = CenterLine2 - Width2 * ATR( Period2 );

if( ShowKC2 )
{
Plot( KTop2, "", k2Color, k2Style );
Plot( KBot2, "", k2Color, k2Style );
}

// KC3
Period3 = Param( "Period3", 120, 2, 300, 1 );
Width3 = Param( "Width3", 7.2, 0, 10, 0.05 );
k3Color = ParamColor( "k3Color", colorCustom14 );
k3Style = ParamStyle( "k3Style", styleThick | styleNoRescale );
MAType3 = Param( "MAType3", 2, 1, 2, 1 );

if( MAType3 == 1 )
{
CenterLine3 = MA( P, Period3 );
}

if( MAType3 == 2 )
{
CenterLine3 = EMA( P, Period3 );
}

if( ShowKC3Mid )
{
Plot( CenterLine3, "", ParamColor( "kc3Mid Color", colorRed ), ParamStyle( "kc3Mid Style", styleLine ) );
}

KTop3 = CenterLine3 + Width3 * ATR( Period3 );
KBot3 = CenterLine3 - Width3 * ATR( Period3 );

if( ShowKC3 )
{
Plot( KTop3, "", k3Color, k3Style );
Plot( KBot3, "", k3Color, k3Style );
}

// KC4
Period4 = Param( "Period4", 20, 2, 300, 1 );
Width4 = Param( "Width4", 2.5, 0, 10, 0.05 );
k4Color = ParamColor( "k4Color", colorDarkTeal );
k4Style = ParamStyle( "k4Style", styleLine | styleNoRescale | styleNoLabel );
MAType4 = Param( "MAType4", 2, 1, 2, 1 );

if( MAType4 == 1 )
{
CenterLine4 = MA( P, Period4 );
}

if( MAType4 == 2 )
{
CenterLine4 = EMA( P, Period4 );
}

if( ShowKC4Mid )
{
Plot( CenterLine4, "", ParamColor( "kc4Mid Color", colorRed ), ParamStyle( "kc4Mid Style", styleLine ) );
}

KTop4 = CenterLine4 + Width4 * ATR( Period4 );
KBot4 = CenterLine4 - Width4 * ATR( Period4 );

if( ShowKC4 )
{
Plot( KTop4, "", k4Color, k4Style );
Plot( KBot4, "", k4Color, k4Style );
}

// KC5
Period5 = Param( "Period5", 45, 2, 300, 1 );
Width5 = Param( "Width5", 3, 0, 10, 0.05 );
k5Color = ParamColor( "k5Color", colorCustom10 );
k5Style = ParamStyle( "k5Style", styleThick | styleNoRescale | styleNoLabel );
MAType5 = Param( "MAType5", 2, 1, 2, 1 );

if( MAType5 == 1 )
{
CenterLine5 = MA( P, Period5 );
}

if( MAType5 == 2 )
{
CenterLine5 = EMA( P, Period5 );
}

KTop5 = CenterLine5 + Width5 * ATR( Period5 );
KBot5 = CenterLine5 - Width5 * ATR( Period5 );

if( ShowKC5 )
{
Plot( KTop5, "", k5Color, k5Style );
Plot( KBot5, "", k5Color, k5Style );
}

// KC Trend Bands
showkcbband = ParamToggle( "Show KCB Trend Bands", "No|Yes", 0 ) ;
RefKTop4 = KTop4;
RefKBot4 = KBot4 ;
RefKTop5 = KTop5;
RefKBot5 = KBot5;
kcblayer = Param( "KCB Layer", -3, -5, 5, 1 ) ;

if( showkcbband )
{
PlotOHLC( RefKBot5, RefKBot5, RefKBot4, RefKBot4, "", ParamColor( "Down Trend", colorRose ), styleCloud | styleNoLabel | styleNoRescale, 0, 0, 0, kcblayer ) ;
PlotOHLC( RefKTop5, RefKTop5, RefKTop4, RefKTop4, "", ParamColor( "Up Trend", colorSkyblue ), styleCloud | styleNoLabel | styleNoRescale, 0, 0, 0, kcblayer ) ;
}

// KCB Rider
ShowKbcR = ParamToggle( "Show KbcR", "No|Yes", 1 ) ;
ShowKbcS = ParamToggle( "Show KbcS", "No|Yes", 1 ) ;
Color1 = ParamColor( "Color1", colorSkyblue );
Color2 = ParamColor( "Color2", colorRose );
ColR = IIf( RefKTop4 > RefKTop5, color1, color2 );
ColS = IIf( RefKBot4 > RefKBot5, color1, color2 );

if( ShowKbcR )
{
PlotOHLC( RefKTop4, RefKTop4, RefKTop5, RefKTop5, "", ColR, styleCloud | styleNoLabel | styleNoRescale, 0, 0, 0, kcblayer );
}

if( ShowKbcS )
{
PlotOHLC( RefKBot4, RefKBot4, RefKBot5, RefKBot5, "", ColS, styleCloud | styleNoLabel | styleNoRescale, 0, 0, 0, kcblayer );
}

// KCARR
x1 = x2 = y1 = y2 = 0 ;
// Buycol = ParamColor("BuyColor", colorBlue);
// Sellcol = ParamColor("SellColor", colorRed);
x1 = KTop1 ;
x2 = KTop4 ;
y1 = KBot1 ;
y2 = KBot4 ;
a = Cross( y2, y1 );
b = Cross( x1, x2 );
Buy = a;
Sell = b;

if( ShowKCARR )
{
// PlotShapes( shape, IIf( Buy, Buycol, Sellcol ), 0, IIf( Buy, Low, High ), -30 );
PlotShapes( IIf( Buy, shapeUpTriangle, shapeNone ), colorBlue, 0, L, Offset = -35 );
PlotShapes( IIf( Sell, shapeDownTriangle, shapeNone ), colorRed, 0, H, Offset = -35 );
}

_SECTION_END();
if(ParamToggle("piLine","Off|On",1))

{
PDH= TimeFrameGetPrice("H", inDaily,- 1); PDH = LastValue (PDH,-1); // Previous Day High
PDL= TimeFrameGetPrice("L", inDaily, -1); PDL = LastValue (PDL,-1); // Previous Day Close
PDC= TimeFrameGetPrice("C", inDaily, -1); PDC = LastValue (PDC,-1); // Previous Day Close
PDH1= TimeFrameGetPrice("H", inDaily,- 2); PDH = LastValue (PDH,-2); // Previous 2Day High
PDL1= TimeFrameGetPrice("L", inDaily, -2); PDL = LastValue (PDL,-2); // Previous 2Day Close
PDC1= TimeFrameGetPrice("C", inDaily, -2); PDC = LastValue (PDC,-2); // Previous 2Day Close
PDH2= TimeFrameGetPrice("H", inDaily,- 3); PDH = LastValue (PDH,-3); // Previous 3Day High
PDL2= TimeFrameGetPrice("L", inDaily, -3); PDL = LastValue (PDL,-3); // Previous 3Day Close
PDC2= TimeFrameGetPrice("C", inDaily, -3); PDC = LastValue (PDC,-3); // Previous 3Day Close
O= SelectedValue( TimeFrameGetPrice( "open", inDaily, 1 ) );
Today = LastValue(Day());
numbars = LastValue(Cum(Status("barvisible")));
hts = -100;
//buying pressure is C-L, Selling pressure is H-C

Today = LastValue(Day());
numbars = LastValue(Cum(Status("barvisible")));
hts = -160;

R=((PDH-PDC)+(PDH1-PDC1)+(PDH2-PDC2))/3;
S=((PDC-PDL)+(PDC1-PDL1)+(PDC2-PDL2))/3;



R2= O+R;
S2= O-S;

R1= O+ R/2;
S1=O-s/2;
R3=R2+R/2;
R4=R2+R;
S3=S2-s/2;
S4=S2-S;

Plot(IIf(Today == Day(),O,Null),"O",colorWhite, styleLine|styleNoTitle|styleNoLabel|styleNoRescale,Null,Null,0,4,2);
Plot(IIf(Today == Day(),R2,Null),"R2",ColorRGB(180,180,180), styleLine|styleNoTitle|styleNoLabel|styleNoRescale,Null,Null,0,4,2);
Plot(IIf(Today == Day(),R1,Null),"R1",ColorRGB(224,224,224), styleLine|styleNoTitle|styleNoLabel|styleNoRescale,Null,Null,0,4,2);
Plot(IIf(Today == Day(),S1,Null),"S1",ColorRGB(224,224,224), styleLine|styleNoTitle|styleNoLabel|styleNoRescale,Null,Null,0,4,2);
Plot(IIf(Today == Day(),S2,Null),"S2",ColorRGB(180,180,180), styleLine|styleNoTitle|styleNoLabel|styleNoRescale,Null,Null,0,4,2);
Plot(IIf(Today == Day(),R3,Null),"R3",ColorRGB(255,128,0), styleLine|styleNoTitle|styleNoLabel|styleNoRescale,Null,Null,0,4,2);
Plot(IIf(Today == Day(),S3,Null),"S3",ColorRGB(255,128,0), styleLine|styleNoTitle|styleNoLabel|styleNoRescale,Null,Null,0,4,2);
Plot(IIf(Today == Day(),R4,Null),"R4",ColorRGB(51,51,255), styleLine|styleNoTitle|styleNoLabel|styleNoRescale,Null,Null,0,4,2);
Plot(IIf(Today == Day(),S4,Null),"S4",ColorRGB(51,51,255), styleLine|styleNoTitle|styleNoLabel|styleNoRescale,Null,Null,0,4,2);

}

_SECTION_END();

If you like this post please click on LIKE button and share it to world.
Like Us :

varun
 
Posts: 20
Joined: Sun Apr 29, 2018 7:47 pm

Return to Study Charts



Who is online

Users browsing this forum: No registered users and 26 guests

Shop at amazon and get latest offers
cron
============================================= =============================================