Time at the right side of the chart

I am new to amibroker. Just wanted to know, is there a way to display the time at the right of the chart.
i.e Assume that i have selected 5 minutes time frame, right side of the chart it should show me the time in decreasing manner , Open of the Candle 5:00, 4:59, 4:58 ...... 0.01 closing of the candle.

We can see the same in TradingView, attached screenshot for your referece.

Kindly help me in this regards.

many examples on the forum. I usually use this (below)

But also look at the status. AFL Function Reference - STATUS

lastbartimeleft etc

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

Plot( C, "C", colorWhite, styleCandle, Null, Null, 0, 0, 0 );

TimeFrame = Interval();
SecNumber = GetSecondNum();
Newperiod = SecNumber % ( TimeFrame + 1e-9 ) == 0;
SecsLeft     = SecNumber - int( SafeDivide( SecNumber, TimeFrame ) ) * TimeFrame;
SecsToGo     = TimeFrame - SecsLeft;
//SecsToGo = Status( "lastbartimeleftrt" );
//SecsToGo = Status( "lastrtupdate" );// + ( 60 * 60 * 60 );
//SecsToGo = Status( "lastbartimeleft" ) + ( 6 * 60 * 60 );
Title = Name() +
        " | " + Now( 1 ) + " | " + Now( 2 ) +
        " | " + EncodeColor( colorBrightGreen ) + SecsToGo + EncodeColor( colorWhite );
1 Like
bartime = Status( "lastbartimeleft" ); 
mts  = int(bartime / 60);
sds = int(frac(bartime / 60) * 60);
if ( bartime > 0 ) {
  txt = StrFormat( "%g:%02.0f", mts, sds);
  x = Status("pxchartright");
} else {
  txt = "Data is NOT up-to-date!";
  x = Status("pxchartright") - GfxGetTextWidth(txt);
}

Plot( C, "Price", colorDefault, styleBar );
GfxSetCoordsMode(2);
GfxTextOut(txt, x, LastValue(C));
2 Likes

Perfect. Thanks fxshrat.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.