Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

YOGYA TRADING GUIDE for Amibroker (AFL)

Rating:
5 / 5 (Votes 7)
Tags:
amibroker

To use this system perfectly you have to add following ticker in your database or else change the ribbon code according to your nifty and sector ticker.

Cnx Nifty
Cnx Auto
Cnx Bank
Bse Capital Goods
Bse Consumer Durables
Cnx Energy
Cnx Finance
Cnx Fmcg
Cnx It
Cnx Media
Cnx Metal
Cnx Pharma
Cnx Realty

For any other query please contact akmeheta@gmail.com

Screenshots

Indicator / Formula

Copy & Paste Friendly
Title = "";
_SECTION_BEGIN("Text Toggle");
Alledit = ParamToggle("All Text", "Show|Hide",0);
Heading = ParamToggle("Heading", "Show|Hide",0);
Fullsymbol = ParamToggle("Name/Industry", "Show|Hide",0);
Datetime1 = ParamToggle("Date/Ltp", "Show|Hide",0);
Datetime2 = ParamToggle("Today Action", "Show|Hide",1);
Day1 = ParamToggle("Day Separator", "Show|Hide",1);

/*Candle Stick Chart For Stock*/
_SECTION_BEGIN("Basics");
/*One Candle Price Action And Body Color*/
Ygbody=C>=O; //First Candle Green
Yrbody=C<O; // First Candle Red
Ygbody1 = Ref(C,-1) >= Ref(O, -1); // Second Candle Green
Yrbody1 = Ref(C,-1) < Ref(O, -1); // Second Candle Red
Ygbody2 = Ref(C,-2) >= Ref(O, -2); // Third Candle Green
Yrbody2 = Ref(C,-2) < Ref(O, -2); // Third Candle Red

Yocspread = abs(O-C);// Body Of The First Candle
Yhlspread = (H-L); // Length Of The First Candle
Yocspread1 = abs(Ref(O,-1)- Ref(C, -1));// Body Of The Second Candle
Yhlspread1 = Ref(H, -1)- Ref(L,-1); // Length Of The First Candle
Yocspread2 =abs(C-(Ref(O,-1))); // Body Of First And Second Candle
Yhlspread2= Max(H, Ref(H,-1))-Min(L,Ref(L,-1)); //Length Of First And Second Candle

Ygapup = Open >Ref(Close,-1); // Gap Up In First Candle
Ygapdown= Open < Ref(Close, -1);// Gap Down In First Candle
Ygapup1 = Ref(Open,-1) >Ref(Close,-2); // Gap Up In First Candle
Ygapdown1= Ref(Open, -1) < Ref(Close, -2);// Gap Down In First Candle

Ybiggapup = Low > Ref(H, -1); // First Candle Low Is Greater Than Second Candle High
Ybiggapdown = High < Ref(L, -1); // First Candle High Is Less Than Second Candle Low
Ybiggapup1 = Ref(Low, -1) > Ref(H, -2); // Second Candle Low Is Greater Than Third Candle High
Ybiggapdown1 = Ref(High, -1) < Ref(L, -2); //Second Candle High Is Less Than Third Candle Low
Ybiggapup2 = Ref(Low, -2) > Ref(H, -3); // Third Candle Low Is Greater Than Fourth Candle High
Ybiggapdown2 = Ref(High, -2) < Ref(L, -3); //Third Candle High Is Less Than Fourth Candle Low


Ypclose = C>=Ref(C,-1); // Gain In First Candle
Ynclose = C < Ref(C,-1); //Loss In First Candle
Ypclose1 =Ref(C, -1) >=Ref(C,-2); // Gain In Second Candle
Ynclose1 = Ref(C, -1) < Ref(C,-1); //Loss In Second Candle

Ybopen = (O >= (Ref(High,-1)+Ref(Low,-1))/2) AND Yrbody1; // Bullish Open First Candle
Ybeopen = (O < (Ref(High,-1)+Ref(Low,-1))/2) AND Ygbody1; // Bearish Open First Candle
Yexbopen = O > Ref(H,-1); // Extreme Bullish Open First Candle
Yexbeopen = O < Ref(L,-1); // Extreme Bearish Open First Candle

Ybclose = C > Ref(H, -1); // Bullish Close First Candle
Ybeclose = C < Ref (L, -1); // Bearish Close First Candle
Ybclose1 = Ref(C, -1) > Ref(H, -2); // Bullish Close Second Candle
Ybeclose1 = Ref(C, -1) < Ref (L, -2); // Bearish Close Second Candle



Yaverage5 = Ref(MA(H, 5), -1) - Ref(MA(L, 5), -1); // Average Lenth Of Five Candle

_SECTION_END();


_SECTION_BEGIN("Parameters");
Ycandledays = Param( "Candle Days", 23, 5, 50000 ); // Candle Days To Determine High-Low
Ypricefield = ParamField("Price Field",0); // Price Field: 0 - Returns Open Array, 1 - Returns High Array, 2 - Returns Low Array, 3 - Returns Close Array (Default), 4 - Returns Average Array = (H+L+C)/3, 5 - Returns Volume Array, 6 - Returns Open Interest Array


/* Close Type */
Yexbclose = C>= (L+Yhlspread*0.8) ; // Bullish Close(Closed At Upper End Of The Candle)
Yexbeclose = C<=(L+Yhlspread*0.2) ; // Bearish Close(Closed At Lower End Of The Candle)

Yexbclose1 = C>= (L+Yhlspread*0.8) AND Ypclose ; // Bullish Close(Closed At Upper End Of The Candle)
Yexbeclose1 = C<=(L+Yhlspread*0.2) AND Ynclose ; // Bearish Close(Closed At Lower End Of The Candle)

Ynuclose =  (Yexbclose1==0 AND Yexbeclose1==0);// Neutral Close

_SECTION_END();




/*Candle At Top(Bearish Reversal) Or Candle At Resistance(Bearish Reversal)*/
Topresistance = HHV(Ypricefield, Ycandledays)== Max(Ypricefield, Ref(Ypricefield, -1));

Yabandonedbabybearish= (Ygbody2 AND Ybiggapup1 AND Ybiggapdown AND Topresistance);

Ybelowthestomach= (Ybeopen AND Ybclose1 AND Yrbody AND Topresistance);

Ybeltholdbearish = (Yexbopen AND Yrbody AND Topresistance);

Ybreakawaybearish = (Ybeopen AND Ybeclose AND Topresistance);

Ydarkcloudcover= (Ygapup AND Ygbody1 AND Ynclose AND Topresistance);

Yengulfingbearish= (Ygapup AND Ygbody1 AND Ybeclose AND Topresistance);

Yeveningstar= (Ygbody2 AND Ygapup1 AND Ygapdown AND Ybeclose AND Topresistance) ;

Yharamibearish = (Ygapdown AND Ygbody1 AND Yrbody AND Topresistance);

Ykickingbearish = (Ygbody1 AND Yexbeopen AND Yrbody AND Topresistance);

Yshootingstar= (Ygapup AND (Yocspread/Yhlspread) < 0.3  AND Yexbeclose AND Topresistance);

Ytristarbearish= (Ybiggapup2 AND Ybiggapup1 AND Ybiggapdown AND Topresistance);

Ydojibearish= ((Yocspread/Yhlspread) < 0.1 AND Topresistance); 

Ydojibearishyesterday= ((Yocspread1/Yhlspread1) < 0.1 AND Topresistance); 

Yonebarbearishwick= ((Yocspread/Yhlspread)< 0.25 AND Yexbeclose AND Topresistance);

Ytwobarbearishwick= ((Yocspread2/Yhlspread2)< 0.25 AND Yexbeclose AND Topresistance);

Ytheextremereversalbearish = ((Yhlspread/Yaverage5) > 3.5 AND C<= (L +Yhlspread*0.7) AND Topresistance);

Ytopcandlebearish = (Yrbody AND Topresistance); 


/*Candle At Bottom(Bullish Reversal) Or Candle At Support(Bullish Reversal)*/

Bottomsupport = LLV(Ypricefield, Ycandledays)== Min(Ypricefield, Ref(Ypricefield, -1));

Yabandonedbabybullish= (Yrbody2 AND Ybiggapdown1 AND Ybiggapup AND Bottomsupport);

Yabovethestomach= (Ybopen AND Ybeclose1 AND Ygbody AND Bottomsupport);

Ybeltholdbullish = (Yexbeopen AND Ygbody AND Bottomsupport);

Ybreakawaybullish = (Ybopen AND Ybclose AND Bottomsupport);

Yengulfingbullish= (Ygapdown AND Yrbody AND Ybclose AND Bottomsupport);

Yhammer= (Ygapdown AND (Yocspread/Yhlspread) < 0.3 AND Yexbclose AND Bottomsupport);

Yharamibullish = (Ygapup AND Yrbody1 AND Ygbody AND Bottomsupport);

Ykickingbullish = (Yrbody1 AND Yexbopen AND Ygbody AND Bottomsupport);

Ymorningstar= (Yrbody2 AND Ygapdown1 AND Ygapup AND Ybclose AND Bottomsupport) ;

Ypiercingpattern= (Ygapdown AND Yrbody1 AND Ypclose AND Bottomsupport);

Ytristarbullish= (Ybiggapdown2 AND Ybiggapdown1 AND Ybiggapup AND Bottomsupport);

Ydojibullish= ((Yocspread/Yhlspread) < 0.1 AND Bottomsupport); 

Ydojibullishyesterday= ((Yocspread1/Yhlspread1) < 0.1 AND Bottomsupport); 

Yonebarbullishwick= ((Yocspread/Yhlspread)< 0.25 AND Yexbclose AND Bottomsupport);

Ytwobarbullishwick= ((Yocspread2/Yhlspread2)< 0.25 AND Yexbclose AND Bottomsupport);

Ytheextremereversalbullish = ((Yhlspread/Yaverage5) > 3.5 AND C>= (L +Yhlspread*0.4) AND Bottomsupport);

Ybottomcandlebullish = (Ygbody AND Bottomsupport);

/*Candle At Top Breakout*/
Ytopbreak = Ypricefield >= Ref(HHV(Ypricefield, Ycandledays), -1);
Yheavyvolume = Volume >= Ref(HHV(Volume, Ycandledays), -1);
Ytopbreakout1= Ygapup AND Ygbody AND Ytopbreak AND Yheavyvolume;
Ytopbreakout2= Ygapdown AND Ygbody AND Ytopbreak AND Ybclose;


/*Candle At Bottom Breakout*/
Ybottombreak = Ypricefield <= Ref(LLV(Ypricefield, Ycandledays), -1);
Ybottombreakout1 = Ygapdown AND Yrbody AND Ybottombreak;
Ybottombreakout2 = Ygapup AND Yrbody AND Ybottombreak AND Ybclose;


/* Candle At Top Fuctions*/
function Candlepattern(R)
   {
   global Candlereversalpattern;
   if(R == 0) { Candlereversalpattern =  "Abandoned Baby Bearish";Candleattopformula = (Yabandonedbabybearish);}
   else if(R == 1) { Candlereversalpattern =  "Belowthe Stomach";Candleattopformula = (Ybelowthestomach);}
   else if(R == 2) { Candlereversalpattern =  "Belthold Bearish";Candleattopformula = (Ybeltholdbearish);}
   else if(R == 3) { Candlereversalpattern =  "Breakaway Bearish";Candleattopformula =(Ybreakawaybearish);}
   else if(R == 4) { Candlereversalpattern =  "Engulfing Bearish";Candleattopformula = (Yengulfingbearish);}
   else if(R == 5) { Candlereversalpattern =  "Darkcloud Cover";Candleattopformula = (Ydarkcloudcover);}
   else if(R == 6) { Candlereversalpattern =  "Evening Star"; Candleattopformula =(Yeveningstar);}
   else if(R == 7) { Candlereversalpattern =  "Harami Bearish";Candleattopformula =(Yharamibearish);}
   else if(R == 8) { Candlereversalpattern =  "Kicking Bearish";Candleattopformula = (Ykickingbearish);}
   else if(R == 9) { Candlereversalpattern =  "Shooting Star";Candleattopformula = (Yshootingstar);}
   else if(R == 10) { Candlereversalpattern =  "Tristar Bearish";Candleattopformula =(Ytristarbearish);}
   else if(R == 11) { Candlereversalpattern =  "Onebar Bearish Wick";Candleattopformula =(Yonebarbearishwick);}
   else if(R == 12) { Candlereversalpattern =  "Doji Bearish First Candle";Candleattopformula =(Ydojibearish);}
   else if(R == 13) { Candlereversalpattern =  "Doji Bearish Second Candle";Candleattopformula =(Ydojibearishyesterday);}
   else if(R == 14) { Candlereversalpattern =  "Twobar Bearish Wick"; Candleattopformula = (Ytwobarbearishwick);}
   else if(R == 15) { Candlereversalpattern =  "Extreme Reversal Bearish"; Candleattopformula =(Ytheextremereversalbearish);}
   else if(R == 16) { Candlereversalpattern =  "Top Candle Bearish";Candleattopformula = (Ytopcandlebearish);}
   else if(R == 17) { Candlereversalpattern =  "Abandoned Baby Bullish";Candleattopformula = (Yabandonedbabybullish);}
   else if(R == 18) { Candlereversalpattern =  "Above The Stomach";Candleattopformula = (Yabovethestomach);}
   else if(R == 19) { Candlereversalpattern =  "Belthold Bullish";Candleattopformula = (Ybeltholdbullish);}
   else if(R == 20) { Candlereversalpattern =  "Breakaway Bullish";Candleattopformula =(Ybreakawaybullish);}
   else if(R == 21) { Candlereversalpattern =  "Engulfing Bullish";Candleattopformula = (Yengulfingbullish);}
   else if(R == 22) { Candlereversalpattern =  "Piercing Pattern";Candleattopformula = (Ypiercingpattern);}
   else if(R == 23) { Candlereversalpattern =  "Morning Star"; Candleattopformula =(Ymorningstar);}
   else if(R == 24) { Candlereversalpattern =  "Harami Bullish";Candleattopformula =(Yharamibullish);}
   else if(R == 25) { Candlereversalpattern =  "Kicking Bullish";Candleattopformula = (Ykickingbullish);}
   else if(R == 26) { Candlereversalpattern =  "Hammer";Candleattopformula = (Yhammer);}
   else if(R == 27) { Candlereversalpattern =  "Tristar Bullish";Candleattopformula =(Ytristarbullish);}
   else if(R == 28) { Candlereversalpattern =  "Onebar Bullish Wick";Candleattopformula =(Yonebarbullishwick);}
   else if(R == 29) { Candlereversalpattern =  "Doji Bullish First Candle";Candleattopformula =(Ydojibullish);}
   else if(R == 30) { Candlereversalpattern =  "Doji Bullish Second Candle";Candleattopformula =(Ydojibullishyesterday);}
   else if(R == 31) { Candlereversalpattern =  "Twobar Bullish Wick"; Candleattopformula = (Ytwobarbullishwick);}
   else if(R == 32) { Candlereversalpattern =  "Extreme Reversal Bullish"; Candleattopformula =(Ytheextremereversalbullish);}
   else if(R == 33) { Candlereversalpattern =  "Bottom Candle Bullish";Candleattopformula = (Ybottomcandlebullish);}

return Candleattopformula;
   }

Candlereversalpatternlist = "";		
for(Cr=0; Cr<=46; Cr++)		
	{	
	VarSet("Pattern"+NumToStr(Cr,1.0),Candlepattern(Cr));	
	Candlereversalpatternlist = Candlereversalpatternlist + Candlereversalpattern + ","; 	
	}	
		
Bi = BarIndex();		
Selectedbar = SelectedValue(Bi) -Bi[0];		
//Selecredbar = Status("Lastvisiblebar")-1;		
Candlereversal="";		
for(Cr=0; Cr<=46; Cr++)		
	{	
	Temp = VarGet("Pattern"+NumToStr(Cr,1.0));	
	if(Temp[Selectedbar]) Candlereversal = Candlereversal+" " + NumToStr(Cr,1.0) + "-" + StrExtract(Candlereversalpatternlist,Cr)+",";	
	} //Output = Candlereversal


/* Candle At Break Fuctions*/
function Candlebreakout(Bo)
   {
   global Candlebreakoutpattern;
   if(Bo == 0) { Candlebreakoutpattern =  "Top Breakout";Candleatbreakformula = (Ytopbreakout1);}
   else if(Bo == 1) { Candlebreakoutpattern =  "Top Breakout";Candleatbreakformula = (Ytopbreakout2);}
   else if(Bo == 2) { Candlebreakoutpattern =  "Bottom Breakout";Candleatbreakformula = (Ybottombreakout1);}
   else if(Bo == 3) { Candlebreakoutpattern =  "Bottom Breakout";Candleatbreakformula =(Ybottombreakout2);}


return Candleatbreakformula;
   }

Candlebreakoutpatternlist = "";		
for(Bc=0; Bc<=4; Bc++)		
	{	
	VarSet("Pattern"+NumToStr(Bc,1.0),Candlebreakout(Bc));	
	Candlebreakoutpatternlist = Candlebreakoutpatternlist + Candlebreakoutpattern + ","; 	
	}	
		
Bi = BarIndex();		
Selebcedbar = SelectedValue(Bi) -Bi[0];		
//Selebcedbar = Status("Lastvisiblebar")-1;		
Candleatbreak="";		
for(Bc=0; Bc<=4; Bc++)		
	{	
	Temp = VarGet("Pattern"+NumToStr(Bc,1.0));	
	if(Temp[Selectedbar]) Candleatbreak = Candleatbreak+" " + NumToStr(Bc,1.0) + "-" + StrExtract(Candlebreakoutpatternlist,Bc)+",";	
	}//Output = Candleatbreak
/* Close Type */
Ctype =
WriteIf(Yexbclose1, "Bullish Close",
WriteIf(Yexbeclose1, "Bearish Close",
WriteIf(Ynuclose, "Neutral Close","")));


/*Candle At Top(Bearish Reversal) Or Candle At Resistance(Bearish Reversal)*/
Tcandle =
WriteIf(Yabandonedbabybearish, "Abandoned Baby Bearish",
WriteIf(Ybelowthestomach, "Belowthe Stomach",
WriteIf(Ybeltholdbearish, "Belthold Bearish",
WriteIf(Ybreakawaybearish, "Breakaway Bearish",
WriteIf(Ydarkcloudcover, "Darkcloud Cover",
WriteIf(Yengulfingbearish, "Engulfing Bearish",
WriteIf(Yeveningstar, "Evening Star", 
WriteIf(Yharamibearish, "Harami Bearish",
WriteIf(Ykickingbearish, "Kicking Bearish",
WriteIf(Yshootingstar, "Shooting Star",
WriteIf(Ytristarbearish, "Tristar Bearish",
WriteIf(Ydojibearish, "Doji Bearish First Candle",
WriteIf(Ydojibearishyesterday, "Doji Bearish Second Candle",
WriteIf(Yonebarbearishwick, "Onebar Bearish Wick",
WriteIf(Ytwobarbearishwick, "Twobar Bearish Wick", 
WriteIf(Ytheextremereversalbearish, "Extreme Reversal Bearish", 
WriteIf(Ytopcandlebearish, "Top Candle Bearish",


/*Candle At Bottom(Bullish Reversal) Or Candle At Support(Bullish Reversal)*/

WriteIf(Yabandonedbabybullish, "Abandoned Baby Bullish",
WriteIf(Yabovethestomach, "Above The Stomach",
WriteIf(Ybeltholdbullish, "Belthold Bullish",
WriteIf(Ybreakawaybullish, "Breakaway Bullish",
WriteIf(Ypiercingpattern, "Piercing Pattern",
WriteIf(Yengulfingbullish, "Engulfing Bullish",
WriteIf(Ymorningstar, "Morning Star", 
WriteIf(Yharamibullish, "Harami Bullish",
WriteIf(Ykickingbullish, "Kicking Bullish",
WriteIf(Yhammer, "Hammer",
WriteIf(Ytristarbullish, "Tristar Bullish",
WriteIf(Ydojibullish, "Doji Bullish First Candle",
WriteIf(Ydojibullishyesterday, "Doji Bullish Second Candle",
WriteIf(Yonebarbullishwick, "Onebar Bullish Wick",
WriteIf(Ytwobarbullishwick, "Twobar Bullish Wick", 
WriteIf(Ytheextremereversalbullish, "Extreme Reversal Bullish", 
WriteIf(Ybottomcandlebullish, "Bottom Candle Bullish",""))))))))))))))))))))))))))))))))));

/*Candle At Top Breakout*/
Breakoutcandle =
WriteIf(Ytopbreakout1, "Top Breakout Gapup",
WriteIf(Ytopbreakout2, "Top Breakout Gapdown",

/*Candle At Bottom Breakout*/
WriteIf(Ybottombreakout1, "Bottom Breakout Gapdown",
WriteIf(Ybottombreakout2, "Bottom Breakout Gapup",""))));



Filter = 1;

Tcandlec =	IIf( Yabandonedbabybearish OR Ybelowthestomach OR Ybeltholdbearish OR Ybreakawaybearish OR Ydarkcloudcover OR Yengulfingbearish OR Yeveningstar OR Yharamibearish OR Ykickingbearish OR Yshootingstar OR Ytristarbearish OR Ydojibearish OR Ydojibearishyesterday OR Yonebarbearishwick OR Ytwobarbearishwick OR Ytheextremereversalbearish OR Ytopcandlebearish, colorRed,
			IIf( Yabandonedbabybullish OR Yabovethestomach OR Ybeltholdbullish OR Ybreakawaybullish OR Ypiercingpattern OR Yengulfingbullish OR Ymorningstar OR Yharamibullish OR Ykickingbullish OR Yhammer OR Ytristarbullish OR Ydojibullish OR Ydojibullishyesterday OR Yonebarbullishwick OR Ytwobarbullishwick OR Ytheextremereversalbullish OR Ybottomcandlebullish, colorGreen, 0));
Breakoutcandlec =IIf(Ytopbreakout1 OR Ytopbreakout2, colorGreen, 
	       IIf(Ybottombreakout1 OR Ybottombreakout2, colorRed, 0));



Ctypec =	IIf(Yexbclose1, colorGreen, 
	       IIf(Yexbeclose1, colorRed, 0));

AddColumn(Close, "Close", 1.2);
AddTextColumn(Ctype, "Close Type   ", 1.0, Ctypec, colorDefault,150);
AddTextColumn(Tcandle, "Candle At Resistance   ", 1.0, Tcandlec, colorDefault,150);
AddTextColumn(Breakoutcandle, "Candle At Breakout   ", 1.0, Breakoutcandlec, colorDefault,150);


_SECTION_BEGIN("Yactions Points");
/* Actions Points */

/* For Intraday Only */
TimeFrameSet(inDaily);
Ypricefield= ParamField("Price Field", 0);


Yath = Ref(HHV(Ypricefield, 2500), -1); // All Time High
Yatl = Ref(LLV(Ypricefield, 2500), -1); // All Time Low

Y2yh = Ref(HHV(Ypricefield, 500), -1); // 2 Year High
Y2yl = Ref(LLV(Ypricefield, 500), -1); // 2 Year Low

Y52wh = Ref(HHV(Ypricefield, 250), -1); // 52 Week High 
Y52wl = Ref(LLV(Ypricefield, 250), -1); // 52 Week Low

Yqh = Ref(HHV(Ypricefield, 55), -1); // Quarterly High
Yql = Ref(LLV(Ypricefield, 55), -1); // Quarterly Low

Ymh = Ref(HHV(Ypricefield, 21), -1); // Monthly High
Yml = Ref(LLV(Ypricefield, 21), -1); // Monthly Low

Yfh = Ref(HHV(Ypricefield, 10), -1); //Fortnight High
Yfl = Ref(LLV(Ypricefield, 10), -1); //Fortnight Low

Ywh = Ref(HHV(Ypricefield, 5), -1); // Weekly High
Ywl = Ref(LLV(Ypricefield, 5), -1); // Weekly Low




Yath1 = (C > (Yath -Yath*0.02));
Yatl1 = (C < (Yatl + Yatl*0.02));

Y2yh1 = (C > (Y2yh - Y2yh*0.02));
Y2yl1 = (C < (Y2yl+ Y2yl*0.02));

Y52wh1 = (C < (Y52wh+ Y52wh*0.015) AND C > (Y52wh - Y52wh*0.015));
Y52wl1 = (C < (Y52wl+ Y52wl*0.015) AND C > (Y52wl - Y52wl*0.015));

Yqh1 = (C < (Yqh+ Yqh*0.01) AND C > (Yqh - Yqh*0.01));
Yql1 = (C < (Yql+ Yql*0.01) AND C > (Yql - Yql*0.01));

Ymh1 = (C < (Ymh+ Ymh*0.01) AND C > (Ymh - Ymh*0.01));
Yml1 = (C < (Yml+ Yml*0.01) AND C > (Yml - Yml*0.01));

Yfh1 = (C < (Yfh+ Yfh*0.01) AND C > (Yfh - Yfh*0.01));
Yfl1 = (C < (Yfl+ Yfl*0.01) AND C > (Yfl - Yfl*0.01));

Ywh1 = (C < (Ywh+ Ywh*0.005) AND C > (Ywh - Ywh*0.005));
Ywl1 = (C < (Ywl+ Ywl*0.005) AND C > (Ywl - Ywl*0.005));

/* Candle At Break Fuctions*/
function Ypriceation(Pa)
   {
   global Pricetpattern;
   if(Pa ==0){Pricetpattern = "All Time High";Priceactionformula =(Yath1);}
   else if(Pa ==1){Pricetpattern = "All Time Low";Priceactionformula =(Yatl1);}
   else if(Pa ==2){Pricetpattern = "2year High" ;Priceactionformula =(Y2yh1);}
   else if(Pa ==3){Pricetpattern = "2year Low";Priceactionformula =(Y2yl1);}
   else if(Pa ==4){Pricetpattern = "52 Week High" ;Priceactionformula =(Y52wh1);}
   else if(Pa ==5){Pricetpattern = "52 Week Low" ;Priceactionformula =(Y52wl1);}
   else if(Pa ==6){Pricetpattern = "Quarterly High";Priceactionformula =(Yqh1);}
   else if(Pa ==7){Pricetpattern = "Quarterly Low";Priceactionformula =(Yql1);}
   else if(Pa ==8){Pricetpattern = "Monthly High";Priceactionformula =(Ymh1);}
   else if(Pa ==9){Pricetpattern = "Monthly Low";Priceactionformula =(Yml1);}
   else if(Pa ==10){Pricetpattern = "Fortnight High";Priceactionformula =(Yfh1);}
   else if(Pa ==11){Pricetpattern = "Fortnight Low";Priceactionformula =(Yfl1);}
   else if(Pa ==12){Pricetpattern = "Weekly High";Priceactionformula =(Ywh1);}
   else if(Pa ==13){Pricetpattern = "Weekly Low";Priceactionformula =(Ywl1);}

return Priceactionformula;
   }

Pricetpatternlist = "";
for(Pc=0; Pc<=14; Pc++)
{
VarSet("Pattern"+NumToStr(Pc,1.0),Ypriceation(Pc));
Pricetpatternlist = Pricetpatternlist + Pricetpattern + ","; 
}

Bi = BarIndex();
Selectedbar = SelectedValue(Bi) -Bi[0];
//Selebcedbar = Status("Lastvisiblebar")-1;
Priceaction="";
for(Pc=0; Pc<=14; Pc++)
{
Temp = VarGet("Pattern"+NumToStr(Pc,1.0));
if(Temp[Selectedbar]) Priceaction = Priceaction+" " + NumToStr(Pc,1.0) + "-" + StrExtract(Pricetpatternlist,Pc)+",";
}//Output = Priceaction




Yaction =
WriteIf(Yath1, "All Time High",
WriteIf(Yatl1, "All Time Low",

WriteIf(Y2yh1, "2year High", 
WriteIf(Y2yl1, "2year Low",

WriteIf(Y52wh1, "52 Week High", 
WriteIf(Y52wl1, "52 Week Low", 

WriteIf(Yqh1, "Quarterly High",
WriteIf(Yql1, "Quarterly Low",

WriteIf(Ymh1, "Monthly High",
WriteIf(Yml1, "Monthly Low",

WriteIf(Yfh1, "Fortnight High",
WriteIf(Yfl1, "Fortnight Low",

WriteIf(Ywh1, "Weekly High",
WriteIf(Ywl1, "Weekly Low", ""))))))))))))));

TimeFrameRestore();
Filter = 1;

Yactionc = IIf(Yath1 OR Y2yh1 OR Y52wh1 OR Yqh1 OR Ymh1 OR Yfh1 OR Ywh1 , colorGreen, 
      IIf(Yatl1 OR Y2yl1 OR Y52wl1 OR Yql1 OR Yml1 OR Yfl1 OR Ywl1, colorRed, 0));

AddTextColumn(Yaction, "Price Actions", 1.0, Yactionc, colorDefault,150);
_SECTION_END();

/* Volume Filter */
TimeFrameSet(inDaily);
Yathv = Ref(HHV(Volume,2500),-1);
Y52whv = Ref(HHV(Volume,250),-1);
Yqhv = Ref(HHV(Volume,65),-1);
Ymhv = Ref(HHV(Volume,23),-1);


Yathv1= Volume > Yathv;
Y52whv1= Volume > Y52whv;
Yqhv1= Volume > Yqhv;
Ymhv1= Volume > Ymhv;

Yvolume =
WriteIf(Yathv1,"All Time High Volume",
WriteIf(Y52whv1,"52 Week High Volume",
WriteIf(Yqhv1,"Quarterly High Volume",
WriteIf(Ymhv1,"Monthly High Volume",""))));

Yvolumec = IIf( Yathv1 OR Y52whv1 OR Yqhv1 OR Ymhv1, colorGreen,0);

/* Candle At Break Fuctions*/
function Dvolumefilter(Vo)
   {
   global Dvolumefilterpattern;
   if(Vo == 0) { Dvolumefilterpattern =  "All Time High Volume";Dvolumeformula = (Yathv1);}
   else if(Vo == 1) { Dvolumefilterpattern =  "52 Week High Volume";Dvolumeformula = (Y52whv1);}
   else if(Vo == 2) { Dvolumefilterpattern =  "Quarterly High Volume";Dvolumeformula = (Yqhv1);}
   else if(Vo == 3) { Dvolumefilterpattern =  "Monthly High Volume";Dvolumeformula =(Ymhv1);}


return Dvolumeformula;
   }

Dvolumefilterpatternlist = "";		
for(Vc=0; Vc<=4; Vc++)		
	{	
	VarSet("Pattern"+NumToStr(Vc,1.0),Dvolumefilter(Vc));	
	Dvolumefilterpatternlist = Dvolumefilterpatternlist + Dvolumefilterpattern + ","; 	
	}	
		
Bi = BarIndex();		
Selectedbar = SelectedValue(Bi) -Bi[0];		
//Selebcedbar = Status("Lastvisiblebar")-1;		
Dvolume="";		
for(Vc=0; Vc<=4; Vc++)		
	{	
	Temp = VarGet("Pattern"+NumToStr(Vc,1.0));	
	if(Temp[Selectedbar]) Dvolume = Dvolume+" " + NumToStr(Vc,1.0) + "-" + StrExtract(Dvolumefilterpatternlist,Vc)+",";	
	}//Output = Dvolume



TimeFrameRestore();


Filter = 1;
SetOption("Nodefaultcolumns", False );
AddTextColumn(Yvolume, "Volume Filter", 1.0, Yvolumec, colorDefault,170);

if(Alledit==0)
{
_SECTION_BEGIN("STOCK Ribbon");
RIBBON5 = ParamToggle("RIBBON", "Show|Hide",0);
if(RIBBON5==0)
{
Yrgbody=C>=O; //First Candle Green
Yrrbody=C<O; // First Candle Red
Yrhlspread1 = Ref(H, -1)- Ref(L,-1); // Length Of The First Candle
Yrbclose = C > (Ref(C, -1)+ Yrhlspread1*0.38); // Bullish Close 
Yrbeclose = C < (Ref (C, -1) - Yrhlspread1*0.38); // Bearish Close 
Yrrbclose = C > Ref(H, -1); // Bullish Close First Candle
Yrrbeclose = C < Ref (L, -1); // Bearish Close First Candle

Uptrend=Yrbclose AND Yrgbody AND Yrrbclose ;
Downtrend=Yrbeclose AND Yrrbody AND Yrrbeclose;

Plot( 1.5, /* Defines The Height Of The Ribbon In Percent Of Pane Width*/"Ribbon",IIf( Uptrend, colorGreen, IIf( Downtrend, colorRed, 0 )), /* Choose Color */styleOwnScale|styleArea|styleNoLabel, -7.5, 100 );

Text = "Stock Ribbon";

GfxSelectFont("Tahoma", Status("Pxheight")/75 );
GfxSetTextAlign(0);// Center Alignment
GfxSetTextColor( colorBlue );
GfxSetBkMode(2); 
GfxTextOut( "Ribbon: "+Name(), Status("Pxwidth")/1.15, Status("Pxheight")/1.12 );


Yrs =SectorID();

if (Yrs==1)
{
Yfsopen = Foreign("Cnx Auto", "O");
Yfshigh = Foreign("Cnx Auto", "H");
Yfslow = Foreign("Cnx Auto", "L");
Yfsclose = Foreign("Cnx Auto", "C");
Text2 = "Ribbon: Auto";
}
else if (Yrs==4)
{
Yfsopen = Foreign("Cnx Bank", "O");
Yfshigh = Foreign("Cnx Bank", "H");
Yfslow = Foreign("Cnx Bank", "L");
Yfsclose = Foreign("Cnx Bank", "C");
Text2 = "Ribbon: Bank";
}
else if (Yrs==6)
{
Yfsopen = Foreign("Bse Capital Goods", "O");
Yfshigh = Foreign("Bse Capital Goods", "H");
Yfslow = Foreign("Bse Capital Goods", "L");
Yfsclose = Foreign("Bse Capital Goods", "C");
Text2 = "Ribbon: Capital Goods";
}
else if (Yrs==27)
{
Yfsopen = Foreign("Bse Capital Goods", "O");
Yfshigh = Foreign("Bse Capital Goods", "H");
Yfslow = Foreign("Bse Capital Goods", "L");
Yfsclose = Foreign("Bse Capital Goods", "C");
Text2 = "Ribbon: Capital Goods";
}
else if (Yrs==7)
{
Yfsopen = Foreign("Bse Consumer Durables", "O");
Yfshigh = Foreign("Bse Consumer Durables", "H");
Yfslow = Foreign("Bse Consumer Durables", "L");
Yfsclose = Foreign("Bse Consumer Durables", "C");
Text2 = "Ribbon: Consumer Durables";
}
else if (Yrs==8)
{
Yfsopen = Foreign("Bse Consumer Durables", "O");
Yfshigh = Foreign("Bse Consumer Durables", "H");
Yfslow = Foreign("Bse Consumer Durables", "L");
Yfsclose = Foreign("Bse Consumer Durables", "C");
Text2 = "Ribbon: Consumer Durables";
}
else if (Yrs==10)
{
Yfsopen = Foreign("Cnx Energy", "O");
Yfshigh = Foreign("Cnx Energy", "H");
Yfslow = Foreign("Cnx Energy", "L");
Yfsclose = Foreign("Cnx Energy", "C");
Text2 = "Ribbon: Energy";
}
else if (Yrs==11)
{
Yfsopen = Foreign("Cnx Finance", "O");
Yfshigh = Foreign("Cnx Finance", "H");
Yfslow = Foreign("Cnx Finance", "L");
Yfsclose = Foreign("Cnx Finance", "C");
Text2 = "Ribbon: Finance";
}
else if (Yrs==12)
{
Yfsopen = Foreign("Cnx Fmcg", "O");
Yfshigh = Foreign("Cnx Fmcg", "H");
Yfslow = Foreign("Cnx Fmcg", "L");
Yfsclose = Foreign("Cnx Fmcg", "C");
Text2 = "Ribbon: Fmcg";
}
else if (Yrs==15)
{
Yfsopen = Foreign("Cnx It", "O");
Yfshigh = Foreign("Cnx It", "H");
Yfslow = Foreign("Cnx It", "L");
Yfsclose = Foreign("Cnx It", "C");
Text2 = "Ribbon: It";
}
else if (Yrs==16)
{
Yfsopen = Foreign("Cnx Media", "O");
Yfshigh = Foreign("Cnx Media", "H");
Yfslow = Foreign("Cnx Media", "L");
Yfsclose = Foreign("Cnx Media", "C");
Text2 = "Ribbon: Media";
}
else if (Yrs==17)
{
Yfsopen = Foreign("Cnx Metal", "O");
Yfshigh = Foreign("Cnx Metal", "H");
Yfslow = Foreign("Cnx Metal", "L");
Yfsclose = Foreign("Cnx Metal", "C");
Text2 = "Ribbon: Metal";
}

else if (Yrs==13)
{
Yfsopen = Foreign("Cnx Pharma", "O");
Yfshigh = Foreign("Cnx Pharma", "H");
Yfslow = Foreign("Cnx Pharma", "L");
Yfsclose = Foreign("Cnx Pharma", "C");
Text2 = "Ribbon: Pharma";
}

else if (Yrs==22)
{
Yfsopen = Foreign("Cnx Realty", "O");
Yfshigh = Foreign("Cnx Realty", "H");
Yfslow = Foreign("Cnx Realty", "L");
Yfsclose = Foreign("Cnx Realty", "C");
Text2 = "Ribbon: Realty";
}
else
{
Yfsopen = O;
Yfshigh = H;
Yfslow = L;
Yfsclose = C;
Text2 = "Ribbon: STOCK";
}


SECTORRIBBON5 = ParamToggle("SECTOR RIBBON", "Show|Hide",1);

if(SECTORRIBBON5==0)
{

Yrgbody1=Yfsclose>=Yfsopen; //First Candle Green
Yrrbody1=Yfsclose<Yfsopen; // First Candle Red
Yrhlspread2 = Ref(Yfshigh, -1)- Ref(Yfslow, -1); // Length Of The First Candle
Yrbclose1 = Yfsclose > (Ref(Yfsclose, -1)+ Yrhlspread2*0.38); // Bullish Close 
Yrbeclose2 = Yfsclose < (Ref (Yfsclose, -1) - Yrhlspread2*0.38); // Bearish Close 
Yrrbclose1 = Yfsclose > Ref(Yfshigh,  -1); // Bullish Close First Candle
Yrrbeclose1 = Yfsclose < Ref (Yfslow,  -1); // Bearish Close First Candle


Uptrend1=Yrbclose1 AND Yrgbody1 AND Yrrbclose1 ;
Downtrend1=Yrbeclose2 AND Yrrbody1 AND Yrrbeclose1;

Plot( 1.5, /* Defines The Height Of The Ribbon In Percent Of Pane Width*/"Ribbon",IIf( Uptrend1, colorGreen, IIf( Downtrend1, colorRed, 0 )), /* Choose Color */styleOwnScale|styleArea|styleNoLabel, -4.5, 100 );



GfxSelectFont("Tahoma", Status("Pxheight")/75 );
GfxSetTextAlign(0);// Center Alignment
GfxSetTextColor( colorBlue );
GfxSetBkMode(2); 
GfxTextOut( Text2, Status("Pxwidth")/1.15, Status("Pxheight")/1.08 );
}

Ynfsopen = Foreign("Cnx Nifty", "O");
Ynfshigh = Foreign("Cnx Nifty", "H");
Ynfslow = Foreign("Cnx Nifty", "L");
Ynfsclose = Foreign("Cnx Nifty", "C");

Ynrgbody1=Ynfsclose>=Ynfsopen; //First Candle Green
Ynrrbody1=Ynfsclose<Ynfsopen; // First Candle Red
Ynrhlspread2 = Ref(Ynfshigh, -1)- Ref(Ynfslow, -1); // Length Of The First Candle
Ynrbclose1 = Ynfsclose > (Ref(Ynfsclose, -1)+ Ynrhlspread2*0.38); // Bullish Close 
Ynrbeclose2 = Ynfsclose < (Ref (Ynfsclose, -1) - Ynrhlspread2*0.38); // Bearish Close 
Ynrrbclose1 = Ynfsclose > Ref(Ynfshigh,  -1); // Bullish Close First Candle
Ynrrbeclose1 = Ynfsclose < Ref (Ynfslow,  -1); // Bearish Close First Candle


Ynuptrend1=Ynrbclose1 AND Ynrgbody1 AND Ynrrbclose1 ;
Yndowntrend1=Ynrbeclose2 AND Ynrrbody1 AND Ynrrbeclose1;

Plot( 1.5, /* Defines The Height Of The Ribbon In Percent Of Pane Width*/"Ribbon",IIf( Ynuptrend1, colorGreen, IIf( Yndowntrend1, colorRed, 0 )), /* Choose Color */styleOwnScale|styleArea|styleNoLabel, -1.5, 100 );

Text1 = "Ribbon: Nifty";


GfxSelectFont("Tahoma", Status("Pxheight")/75);
GfxSetTextAlign(0);// Center Alignment
GfxSetTextColor( colorBlue );
GfxSetBkMode(2); 
GfxTextOut( Text1, Status("Pxwidth")/1.15, Status("Pxheight")/1.05 );
}
_SECTION_END();


_SECTION_BEGIN("Full Name");

if(Fullsymbol==0)
{
GfxSelectFont("Tahoma", Status("Pxheight")/12 );
GfxSetTextAlign( 6 |0);// X-Direction Alignment: (Ta_Center = 6, Ta_Left = 0,Ta_Right = 2) Y-Direction Alignment(Ta_Baseline = 24, Ta_Bottom = 8, Ta_Top = 0)
GfxSetTextColor( colorDarkGrey);;
GfxSetBkMode(0); // Transparent
GfxTextOut( FullName(), Status("Pxwidth")/2, Status("Pxheight")/3 );
GfxSelectFont("Tahoma", Status("Pxheight")/24 );
GfxSetBkMode(0);
GfxTextOut( IndustryID(Mode=1), Status("Pxwidth")/2.5, Status("Pxheight")/2 );
GfxTextOut( SectorID(Mode=1), Status("Pxwidth")/1.5, Status("Pxheight")/2 );
_SECTION_END();
}
_SECTION_BEGIN("Price Message Board");
Overlaymode = ParamToggle("Overlay Mode", "Show|Hide",0);
Messageboard = ParamToggle("Message Board", "Show|Hide",0);
Messageboardtext = ParamToggle("All Price", "Show|Hide",0);

if(Messageboard==0)
{


if (Overlaymode==1)
{
GfxSetOverlayMode(1);
}
else if(Overlaymode==0)

GfxSetOverlayMode(0);

Yrgbody=C>=O; //First Candle Green
Yrrbody=C<O; // First Candle Red
Yrhlspread1 = Ref(H, -1)- Ref(L,-1); // Length Of The First Candle
Yrbclose = C > (Ref(C, -1)+ Yrhlspread1*0.38); // Bullish Close 
Yrbeclose = C < (Ref (C, -1) - Yrhlspread1*0.38); // Bearish Close 
Yrrbclose = C > Ref(H, -1); // Bullish Close First Candle
Yrrbeclose = C < Ref (L, -1); // Bearish Close First Candle


Uptrend=Yrbclose AND Yrgbody AND Yrrbclose ;
Downtrend=Yrbeclose AND Yrrbody AND Yrrbeclose;


Barssincebuy = BarsSince( Uptrend ); 
Barssinceshort = BarsSince( Downtrend ); 
Lastsignal = IIf( Barssincebuy < Barssinceshort, 1, -1 ); 

if ( SelectedValue( Lastsignal ) == 1 ) 
    { 
        GfxSelectSolidBrush( colorDarkGreen ); 
    } 
 else
    { 
        GfxSelectSolidBrush( colorIndigo); 
        } 

Xp=Param("Horizontal Position",0,1,2400,1);
Yp=Param("Vertical Position",-15,-100,1200,1);



X =(Status("Pxwidth")/256)+Xp; 

Y = (Status("Pxheight")/16)+Yp; 


GfxSelectPen( colorLightBlue, 1); // Border Color 
GfxSetTextAlign(0);
GfxRoundRect( X-5, Y-40,X+290, Y+40, 7, 7 ) ; 
GfxRoundRect( X-5, Y+270,X+135, Y+40, 7, 7 ) ;
GfxRoundRect( X+140, Y+270,X+290, Y+40, 7, 7 ) ;
GfxSetBkMode(1);




GfxSelectFont( "Tahoma",15, 800 );
GfxSetTextColor ( colorWhite ); 
GfxTextOut( ( "Target Or Action Prices"),X,Y-40);
GfxTextOut( ( "Yesterday Close:"),X,Y-10);


GfxTextOut( ( "   High                 Low"),X,Y+15);

GfxSetTextColor ( colorYellow );
GfxSelectFont( "Tahoma", 13, 100 );

/* Ytarget Price*/

/* For Intraday Only */
Yh = TimeFrameGetPrice( "H", inDaily, -1 );
Yc = TimeFrameGetPrice( "C", inDaily, -1 );
Yl =  TimeFrameGetPrice( "L", inDaily, -1 );

Cqh = TimeFrameGetPrice( "H", inQuarterly, 0 );
Cql = TimeFrameGetPrice( "L", inQuarterly, 0 );


Lqh = TimeFrameGetPrice( "H", inQuarterly, -1 );
Lql = TimeFrameGetPrice( "L", inQuarterly, -1 );


Cyh = TimeFrameGetPrice( "H", inYearly, 0 );
Cyl = TimeFrameGetPrice( "L", inYearly, 0 );


Lyh = TimeFrameGetPrice( "H", inYearly, -1 );
Lyl = TimeFrameGetPrice( "L", inYearly, -1 );

TimeFrameSet(inDaily);

Lmh = Ref(HHV(H, 21), -1); // Monthly High
Lml = Ref(LLV(L, 21), -1); // Monthly Low

Cmh = Ref(HHV(H, 10), -1); //Fortnight High
Cml = Ref(LLV(L, 10), -1); //Fortnight Low

Lwh = Ref(HHV(H, 5), -1); // Weekly High
Lwl = Ref(LLV(L, 5), -1); // Weekly Low


Ath= Highest(H);
Atl= Lowest(L);

Ath1 =C < (Ath+ Ath*0.1) AND C > (Ath - Ath*0.1);
Lyh1 =C < (Lyh+ Lyh*0.1) AND C > (Lyh - Lyh*0.1);
Cyh1 =C < (Cyh+ Cyh*0.1) AND C > (Cyh - Cyh*0.1);
Lqh1 =C < (Lqh+ Lqh*0.1) AND C > (Lqh - Lqh*0.1);
Cqh1 = C < (Cqh+ Cqh*0.1) AND C > (Cqh - Cqh*0.1);
Lmh1 = C < (Lmh+ Lmh*0.1) AND C > (Lmh - Lmh*0.1);
Cmh1 = C < (Cmh+ Cmh*0.1) AND C > (Cmh - Cmh*0.1);
Lwh1 = C < (Lwh+ Lwh*0.1) AND C > (Lwh - Lwh*0.1);
Yh1 = C < (Yh+ Yh*0.1) AND C > (Yh - Yh*0.1);

Yc1 = C < (Yc+ Yc*0.1) AND C > (Yc - Yc*0.1);

Atl1 =C < (Atl+ Atl*0.1) AND C > (Atl - Atl*0.1);
Lyl1 =C < (Lyl+ Lyl*0.1) AND C > (Lyl - Lyl*0.1);
Cyl1 =C < (Cyl+ Cyl*0.1) AND C > (Cyl - Cyl*0.1);
Lql1 =C < (Lql+ Lql*0.1) AND C > (Lql - Lql*0.1);
Cql1 =  C < (Cql+ Cql*0.1) AND C > (Cql - Cql*0.1);
Lml1 = C < (Lml+ Lml*0.1) AND C > (Lml - Lml*0.1);
Cml1 = C < (Cml+ Cml*0.1) AND C > (Cml - Cml*0.1);
Lwl1 = C < (Lwl+ Lwl*0.1) AND C > (Lwl - Lwl*0.1);
Yl1 = C < (Yl+ Yl*0.1) AND C > (Yl - Yl*0.1);


TimeFrameRestore();

// Highs
GfxTextOut( ( "___________________________"),X,Y-5);
GfxTextOut( ( "___________________________"),X,Y-35);
GfxTextOut( ( "1. YH:"),X,Y+40);
GfxTextOut( ( "______________"),X,Y+45);
GfxTextOut( ( "2. 5DH:"),X,Y+65);
GfxTextOut( ( "______________"),X,Y+70);
GfxTextOut( ( "3. 10DH: "),X,Y+90);
GfxTextOut( ( "______________"),X,Y+95);
GfxTextOut( ( "4. 20DH:"),X,Y+115);
GfxTextOut( ( "______________"),X,Y+120);
GfxTextOut( ( "5. CQH:"),X,Y+140);
GfxTextOut( ( "______________"),X,Y+145);
GfxTextOut( ( "6. LQH: "),X,Y+165);
GfxTextOut( ( "______________"),X,Y+170);
GfxTextOut( ( "7. CYH: "),X,Y+190);
GfxTextOut( ( "______________"),X,Y+195);
GfxTextOut( ( "8. LYH: "),X,Y+215);
GfxTextOut( ( "______________"),X,Y+220);
GfxTextOut( ( "9. ATH: "),X,Y+240);
GfxTextOut( ( "______________"),X,Y+245);
//LOWS
GfxTextOut( ( "1. YL:"),X+145,Y+40);
GfxTextOut( ( "______________"),X+145,Y+45);
GfxTextOut( ( "2. 5DL:"),X+145,Y+65);
GfxTextOut( ( "______________"),X+145,Y+70);
GfxTextOut( ( "3. 10DL: "),X+145,Y+90);
GfxTextOut( ( "______________"),X+145,Y+95);
GfxTextOut( ( "4. 20DL:"),X+145,Y+115);
GfxTextOut( ( "______________"),X+145,Y+120);
GfxTextOut( ( "5. CQL:"),X+145,Y+140);
GfxTextOut( ( "______________"),X+145,Y+145);
GfxTextOut( ( "6. LQL: "),X+145,Y+165);
GfxTextOut( ( "______________"),X+145,Y+170);
GfxTextOut( ( "7. CYL: "),X+145,Y+190);
GfxTextOut( ( "______________"),X+145,Y+195);
GfxTextOut( ( "8. LYL: "),X+145,Y+215);
GfxTextOut( ( "______________"),X+145,Y+220);
GfxTextOut( ( "9. ATL: "),X+145,Y+240);
GfxTextOut( ( "______________"),X+145,Y+245);


if(Messageboardtext==1)
{
GfxTextOut ( ("" + WriteIf (Yh1, ""+Yh,"")), X+70,Y+40);
GfxTextOut ( ("" + WriteIf (Lwh1, ""+Lwh,"")), X+70,Y+65);
GfxTextOut ( ("" + WriteIf (Cmh1, ""+Cmh,"")), X+70,Y+90);
GfxTextOut ( ("" + WriteIf (Lmh1, ""+Lmh,"")), X+70,Y+115);
GfxTextOut ( ("" + WriteIf (Cqh1, ""+Cqh,"")), X+70,Y+140);
GfxTextOut ( ("" + WriteIf (Lqh1, ""+Lqh,"")), X+70,Y+165);
GfxTextOut ( ("" + WriteIf (Cyh1, ""+Cyh,"")), X+70,Y+190);
GfxTextOut ( ("" + WriteIf (Lyh1, ""+Lyh,"")), X+70,Y+215);
GfxTextOut ( ("" + WriteIf (Ath1, ""+Ath,"")), X+70,Y+240);

GfxSelectFont( "Tahoma", 15, 800 );
GfxSetTextColor ( colorWhite );
GfxTextOut ( (""+Yc), X+175,Y-10);
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetTextColor ( colorYellow );
GfxTextOut ( ("" + WriteIf (Yl1, ""+Yl,"")), X+220,Y+40);
GfxTextOut ( ("" + WriteIf (Lwl1, ""+Lwl,"")), X+220,Y+65);
GfxTextOut ( ("" + WriteIf (Cml1, ""+Cml,"")), X+220,Y+90);
GfxTextOut ( ("" + WriteIf (Lml1, ""+Lml,"")), X+220,Y+115);
GfxTextOut ( ("" + WriteIf (Cql1, ""+Cql,"")), X+220,Y+140);
GfxTextOut ( ("" + WriteIf (Lql1, ""+Lql,"")), X+220,Y+165);
GfxTextOut ( ("" + WriteIf (Cyl1, ""+Cyl,"")), X+220,Y+190);
GfxTextOut ( ("" + WriteIf (Lyl1, ""+Lyl,"")), X+220,Y+215);
GfxTextOut ( ("" + WriteIf (Atl1, ""+Atl,"")), X+220,Y+240);
}
else
{
GfxTextOut ( (""+Yh), X+70,Y+40);
GfxTextOut ( (""+Lwh), X+70,Y+65);
GfxTextOut ( (""+Cmh), X+70,Y+90);
GfxTextOut ( (""+Lmh), X+70,Y+115);
GfxTextOut ( (""+Cqh), X+70,Y+140);
GfxTextOut ( (""+Lqh), X+70,Y+165);
GfxTextOut ( (""+Cyh), X+70,Y+190);
GfxTextOut ( (""+Lyh), X+70,Y+215);
GfxTextOut ( (""+Ath), X+70,Y+240);  
GfxSelectFont( "Tahoma", 15, 800 );
GfxSetTextColor ( colorWhite );
GfxTextOut ( (""+Yc), X+175,Y-10);
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetTextColor ( colorYellow );
GfxTextOut ( (""+Yl), X+220,Y+40);
GfxTextOut ( (""+Lwl), X+220,Y+65);
GfxTextOut ( (""+Cml), X+220,Y+90);
GfxTextOut ( (""+Lml), X+220,Y+115);
GfxTextOut ( (""+Cql), X+220,Y+140);
GfxTextOut ( (""+Lql), X+220,Y+165);
GfxTextOut ( (""+Cyl), X+220,Y+190);
GfxTextOut ( (""+Lyl), X+220,Y+215);
GfxTextOut ( (""+Atl), X+220,Y+240);
}}
_SECTION_END();


_SECTION_BEGIN("Ltp");
if(Datetime1==0)
{
Yhor=Param("Horizontal Position",1.18,0.1,120,1);
Yver=Param("Vertical Position",15,0.1,120,1);
Yyc=TimeFrameGetPrice("C",inDaily,-1);
Ydd=Prec(C-Yyc,2);
Yxx=Prec((Ydd/Yyc)*100,2);

Yto=TimeFrameGetPrice("O",inDaily,0);
Ydd1=Prec(C-Yto,2);
Yxx1=Prec((Ydd1/Yto)*100,2);

GfxSelectFont("Tahoma", Status("Pxheight")/32 );
GfxSetTextAlign( 6 | 24 ); // Center And Baseline Alignment
GfxSetBkMode(1); 
//--  ----
Bi = BarIndex();
Ii = SelectedValue( Bi ) - Bi[ 0 ]; 
if (C[Ii]>Yyc[Ii]) 
GfxSetTextColor(colorGreen);
else
GfxSetTextColor(colorRed); 
//-- ---------------
GfxTextOut( "LTP: "+Close, Status("Pxwidth")/Yhor, Status("Pxheight")/Yver );
GfxSelectFont("Tahoma", Status("Pxheight")/50 );
GfxTextOut(""+Ydd+"  ("+Yxx+"%)", Status("Pxwidth")/Yhor, (Status("Pxheight")/Yver)+25 );
}
if(Datetime2==0)
{

if (C[Ii]>Yto[Ii]) 
GfxSetTextColor(colorGreen);
else
GfxSetTextColor(colorRed); 
//-- ---------------

GfxTextOut(""+Ydd1+"  ("+Yxx1+"%)", Status("Pxwidth")/Yhor, (Status("Pxheight")/Yver)+50 );

}


_SECTION_END();


_SECTION_BEGIN("Day Separator");
if(Day1==0)
{
Grid_Day = Day()!=Ref(Day(),-1); 
Plot(Grid_Day,"",ParamColor("Day Color",colorDarkGrey) ,styleHistogram|styleDots|styleNoLabel|styleOwnScale);
}
_SECTION_END();





_SECTION_BEGIN("Analysis Message Board");
if (Overlaymode==1)
{
GfxSetOverlayMode(1);
}
else if(Overlaymode==0)

GfxSetOverlayMode(0);


if(Messageboard==0)
{

Barssincebuy = BarsSince( Uptrend ); 
Barssinceshort = BarsSince( Downtrend ); 
Lastsignal = IIf( Barssincebuy < Barssinceshort, 1, -1 ); 

if ( SelectedValue( Lastsignal ) == 1 ) 
    { 
        GfxSelectSolidBrush( colorDarkGreen ); 
    } 
 else
    { 
        GfxSelectSolidBrush( colorIndigo); 
        } 

X1p=Param("Horizontal Position",0,1,2400,1);
Y1p=Param("Vertical Position",0,-740,1200,1);


X1 =(Status("Pxwidth")/256)+X1p; 

Y1 = (Status("Pxheight")/16)+Y1p; 


GfxRoundRect( X1-5, Y1+540,X1+350, Y1+830, 7, 7 ) ;




GfxSetTextAlign(0);
GfxSelectFont( "Tahoma", 20, 800 );
GfxSetTextColor ( colorWhite );
GfxTextOut( ( "Candle And Price Action"),X1,Y1+540);
GfxTextOut( ( "___________________"),X1,Y1+545);
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetTextColor ( colorYellow );
GfxTextOut( "1. Price Actions:"+Priceaction, X1, Y1+575);
GfxTextOut( ( "________________________"),X1,Y1+580);
GfxTextOut( "2. Reversal Candle:"+Candlereversal, X1, Y1+600);
GfxTextOut( ( "________________________"),X1,Y1+605);
GfxTextOut( "3. Breakout Candle:"+Candleatbreak, X1, Y1+625);
GfxTextOut( ( "________________________"),X1,Y1+630);
GfxTextOut( "4. Volume Singal:"+Dvolume, X1, Y1+650);
GfxTextOut( ( "________________________"),X1,Y1+655);



_SECTION_END();
}

if(Heading==0)
{

_SECTION_BEGIN("Heading");

X2p=Param("Horizontal Position",0,-740,2400,1);
Y2p=Param("Vertical Position",0,-740,1200,1);

X2 =(Status("Pxwidth")/256)+X2p; 
Y2 = (Status("Pxheight")/16)+Y2p; 

GfxSetTextAlign(6|0);
GfxSelectFont( "Tahoma", 20, 800 );
GfxSetTextColor ( colorWhite );
GfxRoundRect( X2+400, Y2-52,X2+1400, Y2+15, 7, 7 ); 

GfxTextOut( "YOGYA TRADING SYSTEM", x2+900, y2-50);
GfxSetTextColor ( colorOrange);
GfxTextOut( Name(), x2+475, y2-50 );
GfxSetTextColor ( colorLime );
GfxTextOut( Interval(2), x2+630, y2-50 );
GfxSetTextColor ( colorLightOrange );
GfxSetTextAlign(0);
GfxTextOut( IndustryID(Mode=1), x2+1100, y2-50);
GfxSetTextAlign(6|0);
GfxSetTextColor ( colorYellow );
GfxTextOut( ( "__________________________________________________________"),x2+900,y2-45);

GfxSelectFont( "Tahoma", 13, 800 );
GfxSetTextColor ( colorLime );
GfxTextOut( Date(), x2+510, y2-10 );
GfxSetTextColor ( colorYellow );
YDO=TimeFrameGetPrice("O",inDaily,0);
YDH=TimeFrameGetPrice("H",inDaily,0);
YDL=TimeFrameGetPrice("L",inDaily,0);
YDC=TimeFrameGetPrice("C",inDaily,0);
YDV=TimeFrameGetPrice("V",inDaily,0);

GfxTextOut( "Open:"+WriteVal(YDO,1.2), x2+700, Y2-10 );
GfxTextOut( "High:"+WriteVal(YDH,1.2), x2+850, Y2-10 );
GfxTextOut( "Low:"+WriteVal(YDL,1.2), x2+1000, Y2-10 );
GfxTextOut( "Close:"+WriteVal(YDC,1.2), x2+1150, Y2-10 );
GfxTextOut( "Volume="+WriteVal(YDV,1.0), x2+1300, Y2-10 );

_SECTION_END();
}
}
GfxSetBkMode(2);
GfxSetTextColor ( colorBlack);
GfxTextOut( "akmeheta@gmail.com", x2+900, y2+700);
_SECTION_BEGIN("Background Color");
SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkColor(ParamColor("Background Color",colorDarkOliveGreen)); // Color Of Outer Border
Plot( C, "Price", IIf( C > O, ParamColor("Up Candle", colorBrightGreen), ParamColor("Down Candle",colorRed )), styleCandle );

_SECTION_END();



GraphXSpace = Status("Pxheight")/75;

6 comments

1. maonondoi

Thank you so much. The Best.

2. mehra3580

thanks for contribution but don’t know how it works

3. viraldalal

Yes sir can you please add buy / sell indicator ?

How to use pls assist

4. manish

Thank you

5. fahad

very good
I would be nice if buy and sell added.

6. nitinnp1

SIR I REQUEST YOU TO PLEASE BUY & SELL ARROW, as it will make us more confident while taking positon. thanks sir.

Leave Comment

Please login here to leave a comment.

Back