Buffers possible in an EA?

Back to topics list To post a new topic, please log in or register
avatar
372
mar 2015.08.18 13: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? 

avatar
Moderator
3423
GumRai 2015.08.18 14: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. 

avatar
372
mar 2015.08.18 14: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?
avatar
Moderator
3423
GumRai 2015.08.18 15:07 #
 

You are wrong

OBJ_TEXT and OBJ_ARROW can be placed by Time and Price

avatar
372
mar 2015.08.18 15:08 #
 

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

 Thank you! 

avatar
372
mar 2015.08.18 15: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.

avatar
13008
WHRoeder 2015.08.18 17:58 #
 
avatar
372
mar 2015.08.18 18:49 #
 
Awesome, works exactly like I want. Thank you!
Back to topics list  

To add comments, please log in or register