// Downloaded From https://www.WiseStockTrader.com
// By Mr. Abhimanyu Y. Altekar  abhimanyu.altekar@gmail.com
// 19th September 2024 V1.0
Hor=Param("Horizontal Position",5,20,1200,1);
Ver=Param("Vertical Position",70,30,1000,1);
IsPlot = ParamToggle ("Plot all Averages", "No|Yes",1);
SetChartOptions(0,chartShowDates|chartShowArrows|chartWrapTitle);
SetChartBkGradientFill( ParamColor("BgTop", colorLightGrey),ParamColor("BgBottom", colorTan),ParamColor("titleblock",colorLightGrey)); 
gxs=Param("GRAPH spaceing",5,5,50,5); 
GraphXSpace = gxs;
_SECTION_BEGIN( "Price" );	
GraphLabelDecimals = 2;
_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(),0,0,0,1 ); ;
_SECTION_END();
//5m
function xSignal(Tf,Hor,Ver,sTf,isPlot)
{
TimeFrameSet(TF);
e10=EMA(C,10);
e20=EMA(C,20);
e30=EMA(C,30);
TimeFrameRestore();
ex10=TimeFrameExpand( e10, TF,expandLast );
ex20=TimeFrameExpand( e20, TF,expandLast );
ex30=TimeFrameExpand( e30, TF,expandLast );
if(isPlot)
{
Plot(ex10,"\n"+sTf,colorGreen,styleThick);
Plot(ex20,sTf,colorBlue,styleThick);
Plot(ex30,sTf,colorOrange,styleThick);
}
sOK=WriteIf(ex10>ex20 OR ex10<ex30,"Ok" ,"Flat" );
sGood=WriteIf(ex10>ex20 AND ex10>ex30,"Good " ,"Flat" );
sBad=WriteIf(ex10<ex20 AND ex10<ex30,"Bad " ,"Flat" );

if(sOK=="Ok" )
GfxSelectSolidBrush(colorGold);
PlotShapes(shapeCircle,colorGold,0,1,1,5);
if(sGood=="Good " )
GfxSelectSolidBrush(colorBrightGreen);
if(sBad=="Bad " )
GfxSelectSolidBrush(colorRed);
GfxTextOut(sTF,Hor+70, Ver-15);
GfxRectangle( Hor+70,Ver+5,Hor+100,Ver+15 );

}
//IsPlot = ParamToggle ("Plot all Averages", "No|Yes",0);
xSignal(in5Minute,Hor,Ver,"5M",True); // Buy Defailt Plotting On
xSignal(in15Minute,Hor+40,Ver,"15M",isPlot); // Selected As per isPlot
xSignal(in15Minute*2,Hor+85,Ver,"30M",isPlot); // Selected As per isPlot
xSignal(inHourly,Hor+125,Ver,"1 H",True); // Buy Defailt Plotting On
xSignal(inHourly*2,Hor+165,Ver,"2 H",isPlot);// Selected As per isPlot
xSignal(inHourly*4,Hor+205,Ver,"4 H",isPlot);// Selected As per isPlot
xSignal(inDaily,Hor+245,Ver,"Daily",isPlot);// Selected As per isPlot