How to get close[1] volume data

Questions about MultiCharts and user contributed studies.
ctu1121
Posts: 135
Joined: 05 Jul 2012
Has thanked: 10 times
Been thanked: 4 times

How to get close[1] volume data

Postby ctu1121 » 19 Aug 2013

Hi,
I could use the following study to get close[0] k bar volume data.

Code: Select all

value1=volume(close[0],1);
May I know how could I get close[1] k bar volume data? Thanks!

Charles

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: How to get close[1] volume data

Postby ABC » 19 Aug 2013

From your code it appears that volume is a function. Which would be weird, as the editor shouldn't let you use a reserved word for a variable name. If it's a function it is not a build in one and it would be hard to tell what you need to change exactly (using Close[1] would be a guess).

Normally you can simply use volume[1] to receive the volume from the previous bar with the reserved word volume.
For tick and volume-based charts, and time-based charts with resolutions of 24 hours or less you need to use the reserved word "tick" to receive the volume information from those chart resolutions.

Regards,
ABC


Return to “MultiCharts”