_SECTION_BEGIN("Magnified Market Price");
//by Vidyasagar, vkunisetty@yahoo.com//
SetChartOptions(0,chartShowArrows|chartShowDates);
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorWhite) );
Hor=Param("Horizontal Position",750,1,1200,1);
Ver=Param("Vertical Position",7,1,830,1);
GfxTextOut(""+C , Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Times New Roman", 11, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorWhite) );
//GfxTextOut("Open - "+O+" High - "+H+" Low - "+L+" Close - "+C, Horr , Verr-14 );
//GraphXSpace = Param("Graph Space",500,-10,500,1);
_SECTION_END();
_SECTION_BEGIN("Trend Blaster V1.2");
SetChartBkColor(ParamColor("Outer panel color ",colorLightYellow));
SetChartBkColor(ParamColor("BackGround Color", colorDarkGrey));
messageboard =ParamToggle("Message Board","Show|Hide",1);
no = Optimize("TSL",Param("A (Change To Optimise)",10, 1, 155 ,1),1,20 ,1);
multiplier1 = Optimize("Multiplier1",Param("B (Change To Optimise)",5, 1, 155 ,1),1, 25 ,1);
multiplier2 = Optimize("Multiplier2",Param("C (Change To Optimise)",22, 1, 155 ,1),1, 25 ,1);
showtsl =ParamToggle("Show SL Line","No|Yes");
aggressivemode =ParamToggle("Aggressive Mode","Yes|No",0);
stopreverse =ParamToggle("Switch To Stop And Reverse","No|Yes",0);
CloseAtEnd = ParamToggle("Close Positions EOD", "No|Yes");
ShowBands = ParamToggle("Show Trending Bands", "No|Yes");
supres=ParamToggle("Show Support / Resistance","No|Yes");
ShowCrossover = ParamToggle("Show Crossover", "No|Yes");
AudioAlert = ParamToggle("Human Voice Alert", "No|Yes");
EmailAlert = ParamToggle("E-mail Alert", "No|Yes");
AlertOutput = ParamToggle("Alert Output", "No|Yes");
showtrendline = ParamToggle("Show Trend Line", "No|Yes");
fibs = ParamToggle("Plot Fibonacci Retracement","No|Yes");
text = ParamToggle("Plot Fibonnaci As Text","No|Yes",0);
mktclose=Param("Market Close Time",152500,000000,235959,1 );
function TBR(no)
{
dres=HHV(H,no);
dsup=LLV(L,no);
davd=IIf(H>Ref(dres,-1),1,IIf(L<Ref(dsup,-1),-1,0));
davn=ValueWhen(davd!=0,davd,1);
dtsl1=IIf(davn==1,dsup,dres);
return dtsl1;
}
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot(Close,"Price",colorBlack, styleCandle);
dtsl=TBR(no);
Horr=360;
Horr1=25;
Verr=14;
GfxTextOut("POSITIONAL Return val "+TBR(no), Horr , Verr+54 );
dB=H>dtsl;
dS=L<dtsl;
TimeFrameSet(multiplier1*Interval());
wtsl=TBR(no);
WB=H>WTSL;
WS=L<WTSL;
TimeFrameRestore();
wtsl=TimeFrameExpand(wtsl,multiplier1*Interval(),expandFirst);
wb=TimeFrameExpand(WB,multiplier1*Interval(),expandFirst);
ws=TimeFrameExpand(WS,multiplier1*Interval(),expandFirst);
TimeFrameSet(multiplier2*Interval());
mtsl=TBR(no);
MB=H>MTSL;//Cross(H,mtsl);
MS=L<MTSL;//Cross(mtsl,L);
TimeFrameRestore();
mtsl=TimeFrameExpand(mtsl,multiplier2*Interval(),expandFirst);
mb=TimeFrameExpand(MB,multiplier2*Interval(),expandFirst);
ms=TimeFrameExpand(MS,multiplier2*Interval(),expandFirst);
Buy = IIf((Low > WTSL AND Low > MTSL), DB, ((WB AND Low > DTSL AND Low > MTSL) OR (MB AND Low > DTSL AND Low > WTSL)));
Sell=IIf(CloseAtEnd==False, (DS OR (DS AND WS) AND (Low > MTSL)), (DS OR (DS AND WS) AND (Low > MTSL)) OR TimeNum() > mktclose);
Short = IIf((High < WTSL AND High < MTSL), DS, (WS AND High < DTSL AND High < MTSL) OR (MS AND High < DTSL AND High < WTSL ));
Cover=IIf(CloseAtEnd==False, (DB OR (DB AND WB) AND (High < MTSL)), (DB OR (DB AND WB) AND (High < MTSL)) OR TimeNum() > mktclose);
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
Long=Flip(Buy,Sell);
Shrt=Flip(Short,Cover);
Relax = NOT Long AND NOT Buy AND NOT shrt AND NOT Sell AND NOT Sell AND NOT Cover;
SellSL=ValueWhen(Short,DTSL,1);
BuySL=ValueWhen(Buy,DTSL,1);
BuyDifference= BuyPrice - BuySL;
SellDifference = SellSL - SellPrice;
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-25);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-35);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-30);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=25);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=35);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-30);
PlotShapes(IIf(Sell, shapeStar, shapeNone),colorGold, 0, L, Offset=-15);
PlotShapes(IIf(Cover, shapeStar, shapeNone),colorGold, 0,L, Offset=-15);
PlotShapes(IIf(CloseAtEnd==True AND TimeNum() > mktclose AND NOT Relax, shapeStar, shapeNone),colorGold, 0,L, Offset=-15);
tsl = IIf(Buy OR Long OR Short OR Shrt AND NOT Relax, dtsl,Null);
tslcolor = IIf(Buy OR Long AND NOT Relax, colorGreen, colorRed);
Plot(tsl, "",tslcolor, styleLine|styleDots|styleThick);
_SECTION_BEGIN("TSF");
P = ParamField("Price field",-1);
Periods = Param("Periods", 174, 2, 300, 1, 10 );
Plot( TSF( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("Linear Regression");
P = ParamField("Price field",-1);
Periods = Param("Periods", 300, 2, 300, 1, 10 );
Plot( LinearReg( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("TEMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 273, 2, 300, 1, 10 );
Plot( TEMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
Comments
Post a Comment