I know we can generate custom bars with the bar function. I tried creating volume bars using variants of the code below, but it doesnīt look like expected. Atleast the plot does not reflect bars that contain atleast a volume of 500. Can we create volume/dollar bars?
Code:
static int vol = 0;
int bar(vars Open, vars High, vars Low, vars Close)
{
vol += marketVol();
if (vol >= 500) {
vol = 0;
return 1;
}
return 4;
}
Last edited by Dalla; 01/06/1920:29.
Re: How to generate volume/dollar bars?
[Re: Dalla]
#475825 01/09/1908:1301/09/1908:13
Depends on the volume, Your code would work if marketVol is the volume of the last quote. If it is something different or no volume at all, modify the code or generate other types of bars.
Re: How to generate volume/dollar bars?
[Re: jcl]
#475827 01/09/1908:4601/09/1908:46
This is FXCM data, so as per the manual, itīs "Tick frequency in live data and in historical data." I still donīt understand what is the difference between this and the volume of the bar?
Re: How to generate volume/dollar bars?
[Re: Dalla]
#475853 01/10/1908:5001/10/1908:50