I notice that if colors are parameters and "show parameters" is true, then they are displayed as the equivalent number set. That does not add anything for me. Perhaps a color name or a blotch of the color could be there.
Announcement
Collapse
No announcement yet.
Colors are numbers if showing parameters
Collapse
X
-
Do you mean in the cursor window??
You can control all of the values and cursor window items returned from your EFS. I have some code that returns multiple different combinations of items from code.
All you do is setup a text variable based on the conditions running in your code and return them as needed. Here is a simple example.
PHP Code:
var CWDefaultColor = Color.blue;
function preMain() {
setStudyTitle("Sample CW Control");
// setup 4 return items in the Cursor Window
setCursorLabelName("SCW1:", 0);
setCursorLabelName("SCW2:", 1);
setCursorLabelName("SCW3:", 2);
setCursorLabelName("SCW4:", 3);
setDefaultBarFgColor(CWDefaultColor, 0);
setDefaultBarFgColor(CWDefaultColor, 1);
setDefaultBarFgColor(CWDefaultColor, 2);
setDefaultBarFgColor(CWDefaultColor, 3);
}
function main() {
var V1 = "test", V2 = "test2", V3 = "test3", V4 = "test4";
var F1 = "false", F2 = "false2", F3 = "false3", F4 = "false4";
var A1 = "action", A2 = "action2", A3 = "action3", A4 = "action4";
var CW = "";
if (Strategy.isLong()) {
CW = ""+A2+" : "+V3+" : "+F4;
setDefaultBarFgColor(Color.green, 0);
} else {
setDefaultBarFgColor(CWDefaultColor, 0);
}
var CW2 = "";
if (Strategy.isLong()) {
CW2 = ""+F4+" : "+A1+" : "+V1;
setDefaultBarFgColor(Color.green, 1);
} else {
setDefaultBarFgColor(CWDefaultColor, 1);
}
var CW3 = "";
if (Strategy.isShort()) {
CW3 = ""+V2+" : "+A3+" : "+A4;
setDefaultBarFgColor(Color.red, 2);
} else {
setDefaultBarFgColor(CWDefaultColor, 2);
}
var CW4 = "";
if (Strategy.isShort()) {
CW4 = ""+F2+" : "+A3+" : "+V4;
setDefaultBarFgColor(Color.red, 3);
} else {
setDefaultBarFgColor(CWDefaultColor, 3);
}
return new Array(CW, CW1, CW2, CW3);
}
Last edited by Doji3333; 07-10-2009, 11:19 AM.Brad Matheny
eSignal Solution Provider since 2000
-
I don't mean in the cursor window. I am talking about the display of the study description that appears in the upper left fo the chart. If the option to "Show Parameters" is selected, then any user selectable colors are displayed by their color codes in the range 0-255 for each color.
If there are several colors in the user selectable criteria, then it puts up quite a few numbers on the chart. One can not select independently, the parameters to show. If Show Parameters is selected then all are displayed.
I would include an image if it were possible to do so. That would make it much more clear.
Comment
Comment