Download MetaTrader 5
To add comments, please log in or register
Interested in social trading? Read the article!
Agent86
915
Agent86 2014.02.03 21:58 
Hi
What function is used to move the custom indicator further away from the candle on the charts.

For example:
SetIndexArrow(0, 241);
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Blue);
SetIndexBuffer(0, v1);
SetIndexLabel(0,"Resistance");


This produces and up arrow for a fractal, but the object is too close to the candles ?

Can we change the distance from the candle vertically Or the size of the object easily ?

Please advise
Thanks
Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.03 22:02  
Agent86:
Hi
What function is used to move the custom indicator further away from the candle on the charts.

For example:
SetIndexArrow(0, 241);
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Blue);
SetIndexBuffer(0, v1);
SetIndexLabel(0,"Resistance");


This produces and up arrow for a fractal, but the object is too close to the candles ?

Can we change the distance from the candle vertically Or the size of the object easily ?

Please advise
Thanks
It's not an Object . . . it an Indicator arrow. You can adjust the position by changing its price value a little . . . if the price isn't important, if the price is important then leave it be. You can adjust the size by setting the width in SetIndexStyle(), yes, even though it's not a line.
Agent86
915
Agent86 2014.02.04 16:10  
Thanks

I added this:
val1=iFractals(NULL, 0, MODE_UPPER,i);
if (val1 > 0)
{
v1[i]=High[i]+ 0.0020; //makes arrow above candle

I realize the actual indicator is not accurate to use for an EA I just have to remember to put that in the EA calcs as well.
Agent86
915
Agent86 2014.02.05 15:09  
Now that I moved the indicator and adjusted the size using SetStyleIndex()
I noticed when I ad the indicator the size is effected, but if press F5 or any edits to the indicator I have to remove it from the list and ad it again. Because if I hit F5 the indicator size resorts back to very small arrows again.


Additionally the indicator goes off the page when the chart prices are low in the window. So there is not enough space on the chart at the bottom or top of the chart to see the indicator. Is there a scaling method or something for this ?
Thanks.
Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.05 15:57  
Agent86:
Now that I moved the indicator and adjusted the size using SetStyleIndex()
I noticed when I ad the indicator the size is effected, but if press F5 or any edits to the indicator I have to remove it from the list and ad it again. Because if I hit F5 the indicator size resorts back to very small arrows again.


Additionally the indicator goes off the page when the chart prices are low in the window. So there is not enough space on the chart at the bottom or top of the chart to see the indicator. Is there a scaling method or something for this ?


You have to decide on what you want and from that work out your own rules and then you can code it . . .
/
To add comments, please log in or register