_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g, Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("EMA 5 MIN");
TimeFrameSet(in5Minute);
m5= EMA(Close,20) ;
Plot(TimeFrameExpand(m5, in5Minute), "", ParamColor( "5 Min Color", colorBlue ), ParamStyle("Style", styleDashed));
TimeFrameRestore();
_SECTION_END();
_SECTION_BEGIN("EMA 15 MIN");
TimeFrameSet(in15Minute);
m15= EMA(Close,20) ;
Plot(TimeFrameExpand(m15, in15Minute), "", ParamColor( "15 Min Color", colorLightGrey ), ParamStyle("Style", styleDashed,styleNoLabel));
TimeFrameRestore();
_SECTION_END();
_SECTION_BEGIN("EMA 60 MIN");
TimeFrameSet(60*in1Minute);
m60= EMA(Close,20) ;
Plot(TimeFrameExpand(m60, 60*in1Minute), "", ParamColor( "60 Min Color", colorGrey50 ), ParamStyle("Style", styleDashed,styleNoLabel));
TimeFrameRestore();
_SECTION_END();
_SECTION_BEGIN("Timer");
function GetSecondNum()
{
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
return SecondNum;
}
RequestTimedRefresh( 1 );
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
TimeFrame = Interval();
SecNumber = GetSecondNum();
Newperiod = SecNumber % TimeFrame == 0;
SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
SecsToGo = TimeFrame - SecsLeft;
x=Param(" X Position ",1,0,1000,1000);
y=Param(" Y Position ",20,0,1000,1000);
GfxSetBkMode(1);
GfxSetTextColor(colorWhite);
GfxTextOut( "" +SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
_SECTION_END();
Plot (SelectedValue(TimeFrameGetPrice("H", inDaily, 1, expandLast)), "", IIf(abs(BarIndex() - SelectedValue(BarIndex())) > 5, GetChartBkColor(), colorGreen));
Plot (SelectedValue(TimeFrameGetPrice("L", inDaily, 1, expandLast)), "", IIf(abs(BarIndex() - SelectedValue(BarIndex())) > 5, GetChartBkColor(), colorRed));