How to identify individual candle OHLC values?

Hello guys,

can anyone help in coding .afl in 5 minute intraday chart how to identify 4th or 5th candle values like OHLC ..

And that too in ongoing trading session.

Bit difficult, but still a hope....

How to identify individual candle OHLC values?

That is already identified and plotted on the chart. Isn't it?

@trading5848 take a look at the @portfoliobuilder answer in this recent thread.

You can apply the same logic to find any intraday bar and then retrieve the corresponding O, H, L and C individual values.

1 Like

Could not understand @trading5848's question in the first place. Thanks @beppe for clarifying.

Don't know whether this is what @trading5848 is looking for:

//Not applicable for timeframe >= inDaily. Only intraday but can be tweaked for other timeframe Weekly, Monthly, etc....

bi = BarIndex();
fvb = Status( "firstvisiblebar" );
lvb = Status( "lastvisiblebar" );

_SECTION_BEGIN( "Specific Bars OHLC after Day Open" ); //Irrespective of the intraday timeframes
	 nBars = Param( "No. of bars after Mrkt Open", 4, 1, 1439, 1 );
	 mrktOpenTime = Param( "Market Open Time", 93000, 0, 235958, 1 ); //CHANGE as per your market timings
	 
	 SetChartOptions( 2, chartShowDates );
	 Plot( C, "Close: ", colorDefault, styleCandle, Null, Null, 0, 0, 1 );
	 
	 TodaysDateNum = SelectedValue( DateNum() );
	 //Finding the BarIndex at Market Open
	 ConvertedStrtDateTime = DateTimeConvert( 2, TodaysDateNum, mrktOpenTime );
	 biMrktOpen = LastValue( ValueWhen( DateTimeConvert( 2, DateNum(), TimeNum() ) == ConvertedStrtDateTime, bi ) );
	 
	 //Adding number of Barindices as required and retrieval of OHLC values
	 biReq = biMrktOpen + nBars - 1;
	 nBarsO = Open[ biReq ];
	 nBarsH = High[ biReq ];
	 nBarsL = Low[ biReq ];
	 nBarsC = Close[ biReq ];
	 
	 LAnBarsO = LineArray( biReq, nBarsO, lvb, nBarsO, 0, False );
	 LAnBarsH = LineArray( biReq, nBarsH, lvb, nBarsH, 0, False );
	 LAnBarsL = LineArray( biReq, nBarsL, lvb, nBarsL, 0, False );
	 LAnBarsC = LineArray( biReq, nBarsC, lvb, nBarsC, 0, False );
	 
	 Plot( LAnBarsO, "", ParamColor( "nBar Open Color", colorGrey40 ), styleDashed | styleNoLabel | styleNoRescale, Null, Null, 0, 0, 1 );
	 Plot( LAnBarsH, "", ParamColor( "nBar High Color", colorGreen ), styleLine | styleNoLabel | styleNoRescale, Null, Null, 0, 0, 1 );
	 Plot( LAnBarsL, "", ParamColor( "nBar Low Color", colorRed ), styleLine | styleNoLabel | styleNoRescale, Null, Null, 0, 0, 1 );
	 Plot( LAnBarsC, "", ParamColor( "nBar Close Color", colorWhite ), styleDots | styleNoLine | styleNoLabel | styleNoRescale, Null, Null, 0, 0, 1 );
_SECTION_END();

The above code won't work if the preferred TimeStamp (Tools > Preferences > Intraday) is different than as recommended but again it can also be tweaked.
Untitled

Please read the following for better understanding:

  1. Quick AFL - there is an image at the bottom of the page;
  2. Date/Time Category;
  3. Multiple Time Frame support in AFL.