Download MetaTrader 5

Need help for drawing arrow

To add comments, please log in or register
Dinnebolt
28
Dinnebolt  

Hi guys, im coding an indicator but im having trouble to draw a floating arrow.

I want to get floating arrow like picture no.1 where the arrow is floating above/below the price.

Picture no.2 is the example of the difference, the arrow is right at the price, which make me harder to see the chart.

What should i use to get the floating arrow?

Thx in advance.

Files:
fractal1.png 41 kb
fractal2.png 29 kb
Taras Slobodyanik
18451
Taras Slobodyanik  

You need to use

//--- Set the vertical shift of arrows in pixels 
   PlotIndexSetInteger(0,PLOT_ARROW_SHIFT,shift);
Alain Verleyen
Moderator
29865
Alain Verleyen  
Taras Slobodyanik:

You need to use

This is not working with mql4. I think the question is about mql4 as the screenshots are from MT4.
Taras Slobodyanik
18451
Taras Slobodyanik  
Alain Verleyen:
This is not working with mql4. I think the question is about mql4 as the screenshots are from MT4.

Well, then need to make the parameter "Offset for arrows" and add/subtract offset from highs/lows.

Alain Verleyen
Moderator
29865
Alain Verleyen  
Taras Slobodyanik:

Well, then need to make the parameter "Offset for arrows" and add/subtract offset from highs/lows.

They will not. No new development for MT4.

You have to code it.

Dinnebolt
28
Dinnebolt  

Hi, thanks a lot for the replies.

Taras Slobodyanik:

You need to use

I try that, but not working.

Alain Verleyen:
This is not working with mql4. I think the question is about mql4 as the screenshots are from MT4.

Yes im using mql4.

Taras Slobodyanik:

Well, then need to make the parameter "Offset for arrows" and add/subtract offset from highs/lows.

I have tried to add/subtract from high and low. The problem is when i go to lower time frame or switch pair with different digits (ie. eurusd to usdjpy), the arrows goes wider.

But in picture 1, the fractals has constant range even for lower time frame. So i thought there maybe some function i can use instead of add/subtract from high/low.

Dinnebolt
28
Dinnebolt  
Alain Verleyen:

They will not. No new development for MT4.

You have to code it.

The fractal from picture 1 is the one from MT4. I cant find the source code for it. I have already search for the code, but i only found the one in picture 2.

Do you think in picture 1 fractal, they code it manually to have constant vertical range?

whroeder1
17114
whroeder1  
herjanto:

The fractal from picture 1 is the one from MT4. I cant find the source code for it. I have already search for the code, but i only found the one in picture 2.

Do you think in picture 1 fractal, they code it manually to have constant vertical range?

  1. Years ago I once saw the code for #1. It wasn't constant, but a function of timeframe. Something like 2 pips on M1 to 1000 on MN1.
  2. I personally just get the chart limits and add 1-2%
Dinnebolt
28
Dinnebolt  
whroeder1:
  1. Years ago I once saw the code for #1. It wasn't constant, but a function of timeframe. Something like 2 pips on M1 to 1000 on MN1.
  2. I personally just get the chart limits and add 1-2%

Hi thanks for your help. You gave me many new knowledge here!

1. I thought about that too, but i dont think that is really good to code something like that. But if no other way, i will use it.

2. Do you use 0.02(WindowPriceMax() - WindowPriceMin()) or 0.02(High[WindowFirstVisibleBar()] and Low[WindowFirstVisibleBar()]) for this? But i get the idea and i will try it.

Thanks a lot!

Dinnebolt
28
Dinnebolt  
whroeder1:
  1. Years ago I once saw the code for #1. It wasn't constant, but a function of timeframe. Something like 2 pips on M1 to 1000 on MN1.
  2. I personally just get the chart limits and add 1-2%

Hi i have tried your suggestions and it works great! I find what i want now.

i just add a variable and add/substract from the point i want.

double addValue = 0.015*(WindowPriceMax() - WindowPriceMin());

Thanks a lot!!

To add comments, please log in or register