Day Trading Futures

Status
Not open for further replies.

XRAY27

Well-Known Member
@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();
 

Trader_PK

Well-Known Member
@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();
thanks XRAY but its not working .. for a rangebar how it will work?
 

XRAY27

Well-Known Member
thanks XRAY but its not working .. for a rangebar how it will work?
it is does work for 1 min for range bars i don't know .......pratap sir can only answer
 

manishchan

Well-Known Member
Not sure if this will work. Try out :)

_SECTION_BEGIN("Time Left");
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",300,0,1000,1);
y=Param("yposn",50,0,1000,1);

GfxSelectSolidBrush( ColorRGB( 230, 230, 230 ) );
GfxSelectPen( ColorRGB( 230, 230, 230 ), 2 );
if ( NewPeriod )
{
GfxSelectSolidBrush( colorYellow );
GfxSelectPen( colorYellow, 2 );
Say( "New period" );
}
GfxRoundRect( x+45, y+17, x-3, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 12, 700, False );
GfxSetTextColor( colorBlack );
GfxTextOut( ""+SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
_SECTION_END();

thanks XRAY but its not working .. for a rangebar how it will work?
 
Try this

Code:
_SECTION_BEGIN("Time Left");
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",300,0,1000,1);
y=Param("yposn",50,0,1000,1);

GfxSelectSolidBrush( ColorRGB( 230, 230, 230 ) );
GfxSelectPen( ColorRGB( 230, 230, 230 ), 2 );
if ( NewPeriod )
{
GfxSelectSolidBrush( colorYellow );
GfxSelectPen( colorYellow, 2 );
Say( "New period" );
}
GfxRoundRect( x+45, y+17, x-3, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 12, 700, False );
GfxSetTextColor( colorBlack );
GfxTextOut( ""+SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
_SECTION_END();
Credits - Traderji


I was in edit mode and didn't noticed that manishchan already posted it. Double post admin can delete it if they want.
 

boarders

Well-Known Member
for using range bars use following:

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;
}

function stGetSecondNum()
{
Time = LastValue(TimeNum());
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
return SecondNum;
}
SecsToGo = (GetSecondNum()-stGetSecondNum())/60;
Days = ( Now( 9 ) == 1 ) OR ( Now( 9 ) == 7 );

inday = LastValue( Now( 4 ) >= 090000 AND Now( 4 ) <= 153000 AND (Days==0) );


RequestTimedRefresh(1,False);
GfxSelectFont("Times New Roman", 20, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( colorLightBlue );

GfxTextOut(WriteIf(inday,"TIME BAR: "+WriteVal(secstogo,1.2)+" Mins"," Market Closed"),
(Status("pxchartleft")+Status("pxchartright"))/15.9,(Status("pxchartbottom")+Status("pxcharttop"))/21.05);
speech=lastvalue(secstogo)>=0 and lastvalue(secstogo)<=0.1;
if (lastvalue(speech) )
{

Say( "New candle",false );
}

the above will work for range bars only when "start of time interval" is selected in tools - preferences - intraday
 
Last edited:

niftyoption

Well-Known Member
BNF " Inverse Flag and there is a chance of Dead Cat Bounce Pattrens "

-----------------------------------------------------------------------

"Letting your emotions override your plan or system is the biggest cause of failure."
"If you can't deal with emotion, get out of trading."
" J. Welles Wilder "
 
Last edited:
Status
Not open for further replies.

Similar threads