I like to use a very small chart to display a very small table of data. I use the time frame of 390 minutes since this works well for the Dow futures to get the Hi Low Range during regular market hours, 09:30 to 16:00. I simply display the change from the previous close and the range ... and I like the day of week to be shown too ( M T W Th F ).
I have worked with
barDate = getValue("time");
dayOfWeek = barDate.getDay();
that I had found in another post. No suprise here, I have not been able to get it to do what I want.
Instead of having to update this part of the code each day, manually incrementing the T to W , M to T, and so on
if(getBarState()==BARSTATE_NEWBAR) {
drawTextRelative( x1, y1, " T" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 112);
drawTextRelative( x1, y2, " M" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 113);
drawTextRelative( x1, y3, " F" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 114);
drawTextRelative( x1, y4, " Th" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 115);
drawTextRelative( x1, y5, " W" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 116);
drawTextRelative( x1, y6, " T" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 117);
drawTextRelative( x1, y7, " M" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 118);
drawTextRelative( x1, y8, " F" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 119);
drawTextRelative( x1, y9, " Th" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 120);
drawTextRelative( x1, y10," W" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 121);
drawTextRelative( x1, y11," T" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 122);
}
Is there a way that some one who is adept at coding ( not me : ) would have the program do this automatically ?
Thanks,
Glenn
I have worked with
barDate = getValue("time");
dayOfWeek = barDate.getDay();
that I had found in another post. No suprise here, I have not been able to get it to do what I want.
Instead of having to update this part of the code each day, manually incrementing the T to W , M to T, and so on
if(getBarState()==BARSTATE_NEWBAR) {
drawTextRelative( x1, y1, " T" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 112);
drawTextRelative( x1, y2, " M" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 113);
drawTextRelative( x1, y3, " F" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 114);
drawTextRelative( x1, y4, " Th" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 115);
drawTextRelative( x1, y5, " W" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 116);
drawTextRelative( x1, y6, " T" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 117);
drawTextRelative( x1, y7, " M" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 118);
drawTextRelative( x1, y8, " F" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 119);
drawTextRelative( x1, y9, " Th" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 120);
drawTextRelative( x1, y10," W" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 121);
drawTextRelative( x1, y11," T" , Color.yellow,null,Text.BOLD|Text.VCENTER|Text.RELA TIVETOTOP|Text.RELATIVETOLEFT, "Courier New", 12, 122);
}
Is there a way that some one who is adept at coding ( not me : ) would have the program do this automatically ?
Thanks,
Glenn
Comment