I am working on a little indicator which recognizes candlestick patterns and I have problems drawing the pattern name in a vertical text object. My problem is that all texts are "centered" from the object source position, and I can't align it properly on the chart. The end result is that for the most part, text labels are not readable. Is there a nice way to align the text to the left/right of the source position? If not, is there a way to move the text to the bottom or the top of the chart while keeping its angle? I believe that probably not, but it is worth asking ;)
This is the function that draws the text object and the line.
void DrawLabel(string text, datetime x1, double vPrice, color vcolor, string description)
string label = OLabel +" - "+DoubleToStr(x1, 0);
ObjectCreate(label, OBJ_TEXT, 0, x1, vPrice);
ObjectSetText(label, text, 8, "Tahoma", vcolor);
ObjectSet(label, OBJPROP_ANGLE, 90);
ObjectSet(label, OBJPROP_BACK, true);
string LineName = OLabel +"Line - "+DoubleToStr(x1, 0);
ObjectCreate(LineName, OBJ_VLINE, 0, x1, vPrice);
ObjectSet(LineName, OBJPROP_STYLE, STYLE_DOT);
ObjectSet(LineName, OBJPROP_COLOR, vcolor);
ObjectSet(LineName, OBJPROP_BACK, true);
Thanks in advance!
I am working on a little indicator which recognizes candlestick patterns
Thanks for your message. I would like to code up over 20 patters so colors would not be enough. And memorizing the legend would be hard. This is what I've got so far.
What I am doing is paiting the involved bars orange and all the other bars blue and red as normal, and adding a label.
BTW How would you code up the recognition between a hammer and a hanged man candle pattern?
I don't know the difference between a "hammer" and a "hanged man" so I wouldn't be able to code it . . . at least not without looking it up first
Once you have your Indicator how are you going to use it ? just for manual trading ?
While thinking about candle patterns you should also think about this . . .
It is for manual trading ;-) I've added Harami and Piercing so far, and the charts are already a complete mess. It is almost useless for < H1.
Speaking of chaos...