Posted By: Dalla
How to generate volume/dollar bars? - 01/06/19 20:28
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?
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; }