Create Object above Candle
4 replies
Conmariin
5 years ago #234421
Hi,
I’m using candlestick patterns in the ea and I want to create a Label on the chart above the candle where the pattern was detetcted. For example SHOOTING STAR in Gold. I found out you can do this with ObjectCreate and ObjectSet.
I’m trying it with Custom Action.
ObjectCreate(“signal1”,OBJ_LABEL,0,0,0,0,0);
ObjectSetText(“signal1″,”SHOOTING STAR”,8,”Tahoma”,Gold);
But this is placing it somwhere on the chart and not above the candle where the pattern is detected.
Can anyone help?
Thanks! 🙂
Automatisches Handeln mit Expert Advisor
https://www.rabenesche.de
tomas262
5 years ago #234422
Conmariin
5 years ago #234425
Hi Tomas! 🙂
when i Take your solution it drops out in meta-editor this error:
‘ObjectCreate’ – no one of the overloads can be applied to the function call CandlestickPattern.mq4
could be one of 2 function(s) LightsOnThree3.mq4
built-in ‘ObjectCreate’ CandlestickPattern.mq4
built-in ‘ObjectCreate’ CandlestickPattern.mq4
1 error(s), 0 warning(s) 2 1
When I take ObjectCreate(“signal1”,OBJ_LABEL,0,0.Time[1]);
instead of your solution
ObjectCreate(“signal1”,OBJ_LABEL,0,Time[1]);
then there wer no errors, but it paints the label sonewhere in the chart like in the screenshot.
Edit: Your solution throws no error with ObjectCreate(“signal1”,OBJ_LABEL,0,Time[1],0,0,0); but its still in the corner of the chart and not above the candle.
Automatisches Handeln mit Expert Advisor
https://www.rabenesche.de
Conmariin
5 years ago #234428
I found a solution that will do it for me:
// Action #2
// Custom action
ObjectCreate(“signal1”,OBJ_TEXT,0,Time[1],High[1]);
// Action #3
// Custom action
ObjectSetText(“signal1″,”HAMMER”,8,”Tahoma”,Gold);
// Action #4
// Custom action
ObjectSetDouble(ChartID(), “signal1”, OBJPROP_ANGLE, 0);
// Action #5
// Custom action
ObjectSetInteger(ChartID(), “signal1”, OBJPROP_ANCHOR, ANCHOR_TOP);
it looks then like in the screenshot. 🙂
Automatisches Handeln mit Expert Advisor
https://www.rabenesche.de
tomas262
5 years ago #234439
OK, glad you figured it out. Let me know when you need any help
Viewing 4 replies - 1 through 4 (of 4 total)