I'm a complete coding idiot. Can someone tell me why the setbgcolor statement in the main function won't color my chart properly? Thanks in advance.
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description 7532
//{{EFSWizard_Declarations
var vCCI14_of_HLC3 = new CCIStudy(14, "HLC/3");
var vCCI6_of_HLC3 = new CCIStudy(6, "HLC/3");
var vLastAlert = -1;
//}}EFSWizard_Declarations 14566
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(false);
setStudyTitle("RHbobscci");
setCursorLabelName("CCI14", 0);
setCursorLabelName("CCI6", 1);
setCursorLabelName("histo",2);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarStyle(PS_SOLID, 2);
setDefaultBarFgColor(Color.black, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarFgColor(Color.black,2);
setDefaultBarThickness(2, 0);
setDefaultBarThickness(1, 1);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
setPlotType(PLOTTYPE_HISTOGRAM, 2);
//}}EFSWizard_PreMain 53579
}
function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/
//{{EFSWizard_Expressions
//{{EFSWizard_Expression_1
//}}EFSWizard_Expression_1 0
//}}EFSWizard_Expressions 9063
//my personal additions
addBand(200,PS_SOLID,1,Color.black,1);
addBand(-200,PS_SOLID,1,Color.black,2);
addBand(0,PS_SOLID,1,Color.black,3);
//This section is to add in bells and whistles
if (vCCI14_of_HLC3 >= 10 ) {
setBarBgColor(Color.lime, 0);
}
//{{EFSWizard_Return
return new Array(
vCCI14_of_HLC3.getValue(CCIStudy.CCI),
vCCI6_of_HLC3.getValue(CCIStudy.CCI),
vCCI14_of_HLC3.getValue(CCIStudy.CCI)
);
//}}EFSWizard_Return 15203
}
function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}
//{{EFSWizard_Actions
//{{EFSWizard_Action_1
function onAction1() {
vLastAlert = 1;
}
//}}EFSWizard_Action_1 5589
//}}EFSWizard_Actions 15622
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description 7532
//{{EFSWizard_Declarations
var vCCI14_of_HLC3 = new CCIStudy(14, "HLC/3");
var vCCI6_of_HLC3 = new CCIStudy(6, "HLC/3");
var vLastAlert = -1;
//}}EFSWizard_Declarations 14566
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(false);
setStudyTitle("RHbobscci");
setCursorLabelName("CCI14", 0);
setCursorLabelName("CCI6", 1);
setCursorLabelName("histo",2);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarStyle(PS_SOLID, 2);
setDefaultBarFgColor(Color.black, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarFgColor(Color.black,2);
setDefaultBarThickness(2, 0);
setDefaultBarThickness(1, 1);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
setPlotType(PLOTTYPE_HISTOGRAM, 2);
//}}EFSWizard_PreMain 53579
}
function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/
//{{EFSWizard_Expressions
//{{EFSWizard_Expression_1
//}}EFSWizard_Expression_1 0
//}}EFSWizard_Expressions 9063
//my personal additions
addBand(200,PS_SOLID,1,Color.black,1);
addBand(-200,PS_SOLID,1,Color.black,2);
addBand(0,PS_SOLID,1,Color.black,3);
//This section is to add in bells and whistles
if (vCCI14_of_HLC3 >= 10 ) {
setBarBgColor(Color.lime, 0);
}
//{{EFSWizard_Return
return new Array(
vCCI14_of_HLC3.getValue(CCIStudy.CCI),
vCCI6_of_HLC3.getValue(CCIStudy.CCI),
vCCI14_of_HLC3.getValue(CCIStudy.CCI)
);
//}}EFSWizard_Return 15203
}
function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}
//{{EFSWizard_Actions
//{{EFSWizard_Action_1
function onAction1() {
vLastAlert = 1;
}
//}}EFSWizard_Action_1 5589
//}}EFSWizard_Actions 15622
Comment