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() );
DayH = TimeFrameGetPrice("H", inDaily, -1); DayHI = LastValue (Dayh,1);// Daily high
DayL = TimeFrameGetPrice("L", inDaily, -1); DayLI = LastValue (Dayl,1); // Daily low
numbars = LastValue(Cum(Status("barvisible")));
hts = -33.5;
YHL = ParamToggle("Yesterday HI LO","Show|Hide",1);
if(YHL==1) {
Plot(DayL,"DL",colorDarkBlue,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(DayH,"DH",colorRed,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
PlotText(" DH " , LastValue(BarIndex())-(numbars/Hts), DayHI, colorBlue);
PlotText(" DL " , LastValue(BarIndex())-(numbars/Hts), DayLI, colorBlue);
}
Buy=C>DayH;
Sell=C<DayL;
S= (DayH-DayL)/2;
SL1=DayH-S;
SL2=DayL+S;
PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-20);
Plot (SL1, "SL1",colorRed,styleLine,styleThick|styleNoRescale|styleNoTitle);
Plot (SL2, "SL2",colorBlue,styleLine,styleThick|styleNoRescale|styleNoTitle);
SetChartBkColor(colorLightYellow);
_SECTION_BEGIN("ATP");
Atp=ParamToggle("ATP","Off|On",1);
if(Atp==1)
{
DayChange = Day() != Ref(Day(), -1);
AvgTradePrice = Null;
CurDayBars = 0;
CurDayCloseSum = 0;
for (i = 0; i < BarCount; i++)
{
if (DayChange
)
{
CurDayCloseSum = C;
CurDayBars = 1;
}
else
{
CurDayCloseSum = CurDayCloseSum + C;
CurDayBars++;
}
AvgTradePrice = CurDayCloseSum / CurDayBars;
}
Plot(AvgTradePrice, "AvgTradePrice",colorPlum,styleDots);
ATP=AvgTradePrice;
_SECTION_END();}
_SECTION_BEGIN("Magnified Market Price");
//by Vidyasagar, [email protected]//
FS=Param("Font Size",12,12,100,1);
GfxSelectFont("Arial", FS, 900, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorBlack) );
Hor=Param("Horizontal Position",1000,1000,1000,1000);
Ver=Param("Vertical Position",17,17,17,17);
GfxTextOut(""+C,Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Arial", 8, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorYellow) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor+5, Ver+45 );
_SECTION_END();
HERE IS THE LINK FOR THE FORMULA http://www.traderji.com/technical-analysis/35712-learn-100-sure-simple-tricks-trade-intraday-2.html