Greetings:
I'm trying to use a 'String' FunctionParameter to set different colors in drawTextAbsolute without success in v7.9.
Here's what I'm trying:
var aFPArray = new Array();
function preMain()
{
setPriceStudy(true);
setStudyTitle("TradersReports");
setShowCursorLabel(false);
askForInput();
//initialize formula parameters
var x=0;
//define a color menu option
aFPArray[x] = new FunctionParameter( "Param1", FunctionParameter.STRING);
with( aFPArray[x] ) {
setName( "String Menu Option" );
addOption( "Color.red" );
addOption( "Color.blue" );
setDefault( "Color.red" );
}
}
function main(Param1)
{
if (getBarState() == BARSTATE_NEWBAR)
{
// Display report results
drawTextAbsolute(1, 14, " Report Alert ", Param1, Color.black, Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.LEFT | Text.FRAME | Text.ONTOP | Text.BOLD, null, 10, "Proof1");
}
debugClear();
debugPrintln(" Param1 : " + Param1);
}
Is there a solution?
Warren
I'm trying to use a 'String' FunctionParameter to set different colors in drawTextAbsolute without success in v7.9.
Here's what I'm trying:
var aFPArray = new Array();
function preMain()
{
setPriceStudy(true);
setStudyTitle("TradersReports");
setShowCursorLabel(false);
askForInput();
//initialize formula parameters
var x=0;
//define a color menu option
aFPArray[x] = new FunctionParameter( "Param1", FunctionParameter.STRING);
with( aFPArray[x] ) {
setName( "String Menu Option" );
addOption( "Color.red" );
addOption( "Color.blue" );
setDefault( "Color.red" );
}
}
function main(Param1)
{
if (getBarState() == BARSTATE_NEWBAR)
{
// Display report results
drawTextAbsolute(1, 14, " Report Alert ", Param1, Color.black, Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.LEFT | Text.FRAME | Text.ONTOP | Text.BOLD, null, 10, "Proof1");
}
debugClear();
debugPrintln(" Param1 : " + Param1);
}
Is there a solution?
Warren
Comment