Hello,
I've written a very simple study to color the background of the chart when the volume of the bar exceeds a certain level which is working correctly. I have then added the "sym" function to highlight the current chart when the volume in a different market exceeds a certain level. This also works OK except it will only work for the two most recent days, and I need it to go back as far as possible. I dont think there is an error with the code, but maybe Im missing something to do with using the sym function and volume?? I have posted the code below, and the two examples I have used are the Bobl and Bund futures (on a 5 min chart) but I have also tried the study on various other markets and can still only As always, any help is greatly appreciated!
If you put the following code on the 5 min bobl chart (BL H4-DT) it works fine, but if you then put it on the 5 min bund chart (GB H4-DT) it will only work on the two most recent days.
I've written a very simple study to color the background of the chart when the volume of the bar exceeds a certain level which is working correctly. I have then added the "sym" function to highlight the current chart when the volume in a different market exceeds a certain level. This also works OK except it will only work for the two most recent days, and I need it to go back as far as possible. I dont think there is an error with the code, but maybe Im missing something to do with using the sym function and volume?? I have posted the code below, and the two examples I have used are the Bobl and Bund futures (on a 5 min chart) but I have also tried the study on various other markets and can still only As always, any help is greatly appreciated!
If you put the following code on the 5 min bobl chart (BL H4-DT) it works fine, but if you then put it on the 5 min bund chart (GB H4-DT) it will only work on the two most recent days.
PHP Code:
function preMain()
{
setPriceStudy(true);
setCursorLabelName("Vol Condition Test");
}
function main() {
var nVol = volume(0,sym("BL H4-DT"));
if (nVol >= 3500){
setBarBgColor(Color.red)
} else return;
}
Comment