Download MetaTrader 5
To add comments, please log in or register
What is the best place to find a programmer? Freelance service!
mar
1143
mar 2015.08.18 11:15 

Hi forum,

I have an indicator which basically marks a high when the high to the left and the high to the right are lower. Similar to the fractal indicator. I use a buffer to place a dot on the bar with the highest high.

Now I would like to implement this feature into an EA. But I can't use normal buffers in an EA. So I think I need to use an object. But using a text or label object is not possible because I can't place it directly above a candle and it is way too uncomfortable to place it with the correct x/y-values. 

Does anybody have an idea how to solve this problem? 

Keith Watford
Moderator
7947
Keith Watford 2015.08.18 12:23  

If you need a visual aid, just use an arrow.

An EA does not need to have anything placed on the chart to make its calculations. 

mar
1143
mar 2015.08.18 12:57  
Yes, it's only a visual aid for me. But how can I place an arrow above or below a bar like I do with buffers? An arrow can only be a text or label object and this can only placed by using x- and y-pixel values. Or am I wrong?
Keith Watford
Moderator
7947
Keith Watford 2015.08.18 13:07  

You are wrong

OBJ_TEXT and OBJ_ARROW can be placed by Time and Price

mar
1143
mar 2015.08.18 13:08  

GumRai, every time I think I know everything, you show me something new... :D

 Thank you! 

mar
1143
mar 2015.08.18 13:28  

It's not 100% working like it should do but maybe you have an idea how to correct this? I made a small script:

void OnStart()
  {
//---
   ObjectCreate(0, "OBJ", OBJ_TEXT, 0, Time[1], High[1]);
   ObjectSetText("OBJ", CharToStr(159), 8, "Wingdings", clrWhite);
  }

 

But the dot is not placed right above the bar, it is a bit lower within the bar. I also tried High[1]+10*Point but if I change timeframes or chart scale, the dot is located at a different place.

whroeder1
13627
whroeder1 2015.08.18 15:58  
mar
1143
mar 2015.08.18 16:49  
Awesome, works exactly like I want. Thank you!
/
To add comments, please log in or register