How to get volume of the first bar?

I want to get current day's volume of the first bar. I tried searching forum and the closest I got was previous day's first bar high/low:


I am using this in one of my other codes:

totalBars = 1 + BarsSince( Day() != Ref(Day(), -1));

How can I modify this to get only first bar's volume of current day?

Have you tried like this ?

FirstBarVolume=  ValueWhen (totalBars ==1 , V, 1);

The volume of first bar in a day is:

NewDay = Day() != Ref( Day(), -1 );
FirstBarVolume = ValueWhen( NewDay, V );

Or you can use timeframe functions


my simple code is i want volume greater than previous day volume for intraday that simple plz help

@vimal you are new so it is probably worth telling you that on this forum you will usually get more help if you at least try to find a solution and then post your attempt asking for help.

Also the wording of your question is not clear to me, as this thread is discussing the Volume of the First bar of intra-day data. So are you asking about wanting the Volume of today's first bar to be greater than that of yesterday's first bar?

dn = Day();
newDay = dn != Ref( dn, -1 );

FirstBarVolume = ValueWhen( newday, Volume);
YesterdayFBV = ValueWhen( newday, Volume, 2);

Condition = FirstBarVolume > YesterdayFBV;

Sorry for the trouble
my question was I want a volume breakout AFL
Condition is volume breakout should be greater than previous whole day volume in 5 min ( only previous day or yesterday )

here are few examples

1 Like

@vimal You will need to learn about using Multiple Time Frame functions
Specifically I would suggest,

When you've come up with a solution post it here to share with the forum. You've already been given half of the solution (today's first bar volume). If you get stuck post your attempt and tell us where you are having a problem.

1 Like