Hello World! ;)
I wish to let my Pivot Point (PP) indicator display a preview of tomorrows' PPs.
Neatest label is in my view provided by OBJ_ARROW_LEFT_PRICE. The Problem is, that object type is anchored by time (and price). I wonder whether there is a way to align the display to the right corner?
Or do I have to use another object type? Or even create one, derived from OBJ_ARROW_LEFT_PRICE (for which my programming skills are far too small (yet)).
Please don't kill me for bad programming or stupid questions, I'm a beginner! Thank you. :)
Here is the relevant part of the code, which I actually use, but it paints the labels too close to the current bar:
void DrawPreview(string arrowlabel, int shift, double PriceToDraw, color ColorToDraw)
datetime TimeToDraw = Time[shift];
string label = arrowlabel;
if(ObjectFind(label) != -1) ObjectDelete(label);
ObjectSetInteger(0,label, OBJPROP_ANCHOR, ANCHOR_RIGHT); //doesn't work, guess it's due to object type?!?
ObjectSetInteger(0, label, OBJPROP_COLOR, ColorToDraw);
DrawPreview("PRICE LABEL", 0, someprice, someclr);
Thanks for your comment.
I had the same idea, but how do I code the price at Point in the future? Don't know whether it is useful to spend resources following this idea, as it seems to me that in MT4 the future is unchartered territory?!
The latter idea I had also considered, but the hline would span across the whole chart, which is unfavourable. OBJ_HLINE can't be 'cut off' as far as I know, can it?
Meanwhile I'm asking myself, whether I should switch to OBJ_LABEL type, but there arises the next problem: this type is anchored by x,y-coordinates. But how would I determine the y-coordinate of the price I want to stick it to?
I really need a break now, will clean up kitchen, then resume solving this problem. Elaboration/new ideas are welcome! :)
datetime time0 = Time,
future= time0 + PeriodSeconds();
Cool, thank you very much - it works!
In the meantime I added weekly Pivot Points to the indicator, as an option... and promptly face a new (old) problem! Who really needs sunday bars? ;)
But that doesn't fit in this thread anymore, I'll perhaps open another one for general discussion of this indicators' programming.
This issue is solved, thanks again.
To add comments, please log in or register