The attached indicator plots a history of daily vwaps and adds a text marker for the current day identifying which vwap it is and the level the vwap was at.
Questions:
* Can I set the right margin of a chart programically to ensure the text fits?
* The Draw.Text seems to be limited to a baroffset of 0. In this indicator I would ideally want to have the text plotted with a negative offset, so as not to block the current bar on the chart. Is there a means to do that? If not, it might make sense to add either a xPixelOffset like you have for the yPixelOffset, or allow for negative bar offsets.
Possible Bugs:
* When I load this indicator I sometimes get the following 2 errors when drawing text: Indicator VWAP Profile: Error on calling OnBarUpdate method on bar 1202: Object reference not set to an instance of an object. Failed to call OnRender() for chart object Text: The calling thread cannot access this object because a different thread owns it.
* For efficiency sake, I tried to encase the drawing of the text object to only the last bar on the chart. I thought the proper approach would be to check the State property is equal to Transition. That would then process the DrawText on the last historical bar available. Unfortunately that doesn't seem to work.
* Not sure if the border brush is working on the Draw.Text method. I set it to white but I don't see the border being drawn.
Suggestions:
* Instead of drawing the text markers, I tried to use the FormatPriceMarker override to return the string with the plot labels but that doesn't seem to work. Even though this method returns a string, is it restricted to only returning strings that convert to a numeric?
* You will notice that the plots PlotStyle are set as Dots. That is to eliminate the connecting lines between sessions when the PlotStyle is set to line. Cosmetically I would much rather be able to use lines. Is there a simple means to eliminate the connecting lines between sessions? This might be a nice option to add to plots. The other suggestions is allow for even smaller dots. The smallest dot setting is still quite large relative to a line width.
Comment