_SECTION_BEGIN("megatrader");
SetChartOptions(0,chartShowArrows|chartShowDates);
GraphXSpace=Param("GraphXSpace",-10,0,100,1);
dec = (Param("Decimals",2,0,7,1)/10)+1;
SetChartBkColor(ParamColor("Outer Panel", colorBlack));
SetChartBkGradientFill(ParamColor("Upper Chart", colorDarkGrey), ParamColor("Lower Chart", colorDarkGrey));
Title = EncodeColor(55)+ Title = Name() + " " + EncodeColor(32) + Date() +
" " + EncodeColor(5) + " " +
EncodeColor(55)+ " Open = "+ EncodeColor(52)+ WriteVal(O,dec) +
EncodeColor(55)+ " High = "+ EncodeColor(5) + WriteVal(H,dec) +
EncodeColor(55)+ " Low = "+ EncodeColor(32)+ WriteVal(L,dec) +
EncodeColor(55)+ " Close = "+ EncodeColor(7)+ WriteVal(C,dec)+
EncodeColor(55)+ " Volume = "+ EncodeColor(11)+ WriteVal(V,1);
///////////////////////
colorHighliter = IIf(C >= O, ColorRGB(0, 128, 0), ColorRGB(128, 0, 0));
DemandPoint = (Ref(L, -1) < Ref(L, -2)) & (L < Ref(L, -1)) & (L < Ref(L, 1)) & (Ref(L, 1) < Ref(L, 2));
//Supply Point
//colorSupplyPoint = ParamColor("Supply Line", ColorRGB(255, 128, 0));
SupplyPoint = (Ref(H, -1) > Ref(H, -2)) & (H > Ref(H, -1)) & (H > Ref(H, 1)) & (Ref(H, 1) > Ref(H, 2));
CountTrendBars = 0;
CurrentBar = BarCount - 1;
dx0 = dx1 = dy0 = dy1 = 0;
sx0 = sx1 = sy0 = sy1 = 0;
//Price
SetBarFillColor(colorHighliter);
Plot(C, "Close", IIf(colorHighliter == ColorRGB(128, 0, 128), ColorRGB(255, 0, 255), IIf(colorHighliter == ColorRGB(128, 128, 0), ColorRGB(255, 255, 0), IIf(C > O, ColorRGB(0, 255, 0), IIf(C < O, ColorRGB(255, 0, 0), ColorRGB(255, 255, 255))))), styleCandle, Null, Null, 0, 0, 1);
Plot(EMA(Close,200),"",colorWhite );
//////////////////////////////////////////////////////////
_SECTION_END();_SECTION_BEGIN("FIBONACCI HIGH PROBABILITY ZONES");
ShowFibHiProbZone=ParamToggle("Show FIb High-Probability Zone","No|Yes",1);
HpzColor = ParamColor("Line Color",colorWhite);
Periodicity = inDaily;
if(ShowFibHiProbZone AND Interval()<inHourly)
{
Periodicity = inDaily;
}
else if(ShowFibHiProbZone AND Interval()==inHourly)
{
Periodicity = inWeekly;
}
else if (ShowFibHiProbZone AND Interval()>=inDaily AND Interval()<inMonthly)
{
Periodicity = inMonthly;
}
else if(ShowFibHiProbZone AND Interval()>inWeekly AND Interval()<inYearly)
{
Periodicity = inYearly;
}
else // Default just to silence the compiler. This will never occur.
{
Hi=Ref(H,-1);
Lo=Ref(L,-1);
Cl=Ref(C,-1);
}
Hi=TimeFrameGetPrice("H",Periodicity,-1);
Lo=TimeFrameGetPrice("L",Periodicity ,-1);
Cl=TimeFrameGetPrice("C",Periodicity ,-1);
p=(Hi+Lo+Cl)/3;
//Bands
as1b=p-((Hi-Lo)*0.382);
as2b=p-((Hi-Lo)*0.618);
as3b=p-((Hi-Lo)*1.000);
as4b=p-((Hi-Lo)*1.382);
ar1b=((Hi-Lo)*0.382)+p;
ar2b=((Hi-Lo)*0.618)+p;
ar3b=((Hi-Lo)*1.000)+p;
ar4b=((Hi-Lo)*1.382)+p;
extnd=0;
sty=styleNoLabel|styleStaircase|styleDashed|styleNoRescale;
Plot(ar1b,"",colorRed,styleDashed,styleNoRescale);
Plot(ar2b,"",colorRed,styleDashed,styleNoRescale);
Plot(ar3b,"",colorRed,styleDashed,styleNoRescale);
Plot(ar4b,"",colorRed,styleDashed,styleNoRescale);
Plot(p,"",colorOrange,styleLine,styleNoRescale);
Plot(as1b,"",colorGreen,styleDashed,styleNoRescale);
Plot(as2b,"",colorGreen,styleDashed,styleNoRescale);
Plot(as3b,"",colorGreen,styleDashed,styleNoRescale);
Plot(as4b,"",colorGreen,styleDashed,styleNoRescale);
///////////////////////
FS=Param("MM Price Font Size",20,11,100,1);
Hor=Param("MM Price Horizontal Position",840,1,1200,1);
Ver=Param("MM price Vertical Position",10,1,830,1);
GfxSelectFont("tahoma", FS, 700, True );
GfxSetBkMode( 1 );
GfxSetTextColor( colorLime);
GfxTextOut(""+C, Hor+29 , Ver);
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("tahoma", 11, 700, True );
GfxSetBkMode( 1 );
GfxSetTextColor(7);
GfxTextOut(""+DD+" ("+xx+"%)", Hor+29 , Ver+29 );
//////////////////////////////////////////////////////////
/////////////////////////////////////////////