@TraderPK ji
following is the Afl for candle timer.......it will say "new candle" when next candle starts
_SECTION_BEGIN("CANDLE 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(" xposn",100,100,1000,1000);
y=Param(" yposn",0,40,1000,1);
GfxSelectSolidBrush( colorWhite );
GfxSelectPen( colorBlack, 2 );
if ( NewPeriod )
{
GfxSelectSolidBrush( colorBlack );
GfxSelectPen( colorBlack, 2 );
Say( "New candle" );
}
GfxRoundRect( x+55, y+17, x-4, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 9, 700, False );
GfxSetTextColor( colorBlack );
GfxTextOut( "" +SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
_SECTION_END();
following is the Afl for candle timer.......it will say "new candle" when next candle starts
_SECTION_BEGIN("CANDLE 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(" xposn",100,100,1000,1000);
y=Param(" yposn",0,40,1000,1);
GfxSelectSolidBrush( colorWhite );
GfxSelectPen( colorBlack, 2 );
if ( NewPeriod )
{
GfxSelectSolidBrush( colorBlack );
GfxSelectPen( colorBlack, 2 );
Say( "New candle" );
}
GfxRoundRect( x+55, y+17, x-4, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 9, 700, False );
GfxSetTextColor( colorBlack );
GfxTextOut( "" +SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
_SECTION_END();