Hi,
How would I add or remove menu options in the "Edit Studies" window?
The intent is to only display "ColorBars,PriceUpColor, PriceDnColor" in the "Edit Menu" when "ColorBars" is true. So when "ColorBars" is false the Menu options in "Edit Menu" change to only "ColorBars"
I have tried several things without success. For example:
(just the code needed for this example)
function preMain() {
var x=0;
aFPArray[x] = new FunctionParameter("ColorBars", FunctionParameter.BOOLEAN);
with(aFPArray[x++]){
setName( "Color Bars?" );
setDefault(false);
}
aFPArray[x] = new FunctionParameter( "PriceUpColor", FunctionParameter.COLOR);
with( aFPArray[x++] ) {
setName( "Stoch1 Slow PriceBar Up" );
setDefault( Color.lime );
}
aFPArray[x] = new FunctionParameter( "PriceDnColor", FunctionParameter.COLOR);
with( aFPArray[x++] ) {
setName( "Stoch1 Slow PriceBar Dn" );
setDefault( Color.red );
}
}
if (ColorBars==true){
function main( ColorBars, PriceUpColor, PriceDnColor ) {
}else if(ColorBars==false){
function main( ColorBars) {
}
....rest of code
Thanks in advance for any help.
Wayne
How would I add or remove menu options in the "Edit Studies" window?
The intent is to only display "ColorBars,PriceUpColor, PriceDnColor" in the "Edit Menu" when "ColorBars" is true. So when "ColorBars" is false the Menu options in "Edit Menu" change to only "ColorBars"
I have tried several things without success. For example:
(just the code needed for this example)
function preMain() {
var x=0;
aFPArray[x] = new FunctionParameter("ColorBars", FunctionParameter.BOOLEAN);
with(aFPArray[x++]){
setName( "Color Bars?" );
setDefault(false);
}
aFPArray[x] = new FunctionParameter( "PriceUpColor", FunctionParameter.COLOR);
with( aFPArray[x++] ) {
setName( "Stoch1 Slow PriceBar Up" );
setDefault( Color.lime );
}
aFPArray[x] = new FunctionParameter( "PriceDnColor", FunctionParameter.COLOR);
with( aFPArray[x++] ) {
setName( "Stoch1 Slow PriceBar Dn" );
setDefault( Color.red );
}
}
if (ColorBars==true){
function main( ColorBars, PriceUpColor, PriceDnColor ) {
}else if(ColorBars==false){
function main( ColorBars) {
}
....rest of code
Thanks in advance for any help.
Wayne
Comment