I discovered that if text is drawn only once, then it is lost if the chart is refreshed. Is there a way to know inside an efs when a chart is "refreshed" This to avoid having to redraw the text continuiously
The KB says that premain is executed on refresh but I tested for that and it is not.
This is the code I use to draw the text and lines. The lines stay on refrest but the text does not.
THIS IS INSIDE bInit block.
if (Symbol1 == "$TICK") {
addBand(HighBand,PS_SOLID,2,Color.red,"High Band");
drawTextAbsolute(-10,(HighBand)," "+HighBand+" ",null,null,Text.VCENTER,null,12,"hightext"+counte r++);
addBand(LowBand,PS_SOLID,2,Color.green,"Low Band");
drawTextAbsolute(-12,(LowBand)," "+LowBand+" ",null,null,Text.VCENTER,null,12,"lowtext"+counter );
addBand(0,PS_SOLID,1,Color.black,"Zero Band");
}
The KB says that premain is executed on refresh but I tested for that and it is not.
This is the code I use to draw the text and lines. The lines stay on refrest but the text does not.
THIS IS INSIDE bInit block.
if (Symbol1 == "$TICK") {
addBand(HighBand,PS_SOLID,2,Color.red,"High Band");
drawTextAbsolute(-10,(HighBand)," "+HighBand+" ",null,null,Text.VCENTER,null,12,"hightext"+counte r++);
addBand(LowBand,PS_SOLID,2,Color.green,"Low Band");
drawTextAbsolute(-12,(LowBand)," "+LowBand+" ",null,null,Text.VCENTER,null,12,"lowtext"+counter );
addBand(0,PS_SOLID,1,Color.black,"Zero Band");
}
Comment