MQL4 - Fibo Retracement with Ray Problem (MQL4 bug or Error ???)

 

Dear Coders

This is MQL4 questions and not MQL5 questions.

My observation is that this simple code line always enable Ray to the right property.


ObjectCreate    (0, name, OBJ_FIBO, 0, time1, price1, time2, price2);

ObjectSetInteger(0, name, OBJPROP_RAY, false);

ObjectSetInteger(0, name, OBJPROP_RAY_RIGHT, false);


Even if I set Object Ray Property = false, it always stretch the fibo retracement to right end of the chart. This is only applicable to programmatically drawn Fibonacci Retracement object using MQL4. In MQL5, this is fine and no bug at all.

Also when you manually drawn, this is not a problem too.


Should this be considered to be bug for MQL4 or is there any other ways to get around with this ?

Thanks in advance for your help on this. :)




 

If you move the entire fib to the left (or move the chart shift triangle further to the left) you will probably see that the fib does end i.e. it is not a ray.

The bigger the difference between the 2 times, the longer the line. You can't control how long the line is, only whether it is a ray.

 
honest_knave:

If you move the entire fib to the left (or move the chart shift triangle further to the left) you will probably see that the fib does end i.e. it is not a ray.

The bigger the difference between the 2 times, the longer the line. You can't control how long the line is, only whether it is a ray.

It is not entirely what I am looking for.

But still make some sense to some extent.

It look bug to me still since this does not happen to MQL5.

Thanks for sharing your idea. :)

 
Young Ho Seo:

It is not entirely what I am looking for.

But still make some sense to some extent.

It look bug to me still since this does not happen to MQL5.

Thanks for sharing your idea. :)

It's not a bug, the MT4 version just doesn't work like MT5 version.
 
Alain Verleyen:
It's not a bug, the MT4 version just doesn't work like MT5 version.


I have used exactly the same first and second point to insert Fibonacci retracement manually in the chart in the Meta Trader 4.

The right ray does not happen when the Fibonacci retracement was inserted manually.

It only happen when it is programmatically inserted using MQL4. Shouldn't they behave the same if the same first and second points are used in the chart ????

 
Young Ho Seo:


I have used exactly the same first and second point to insert Fibonacci retracement manually in the chart in the Meta Trader 4.

The right ray does not happen when the Fibonacci retracement was inserted manually.

It only happen when it is programmatically inserted using MQL4. Shouldn't they behave the same if the same first and second points are used in the chart ????

Odd. When I use your code in post #1, it draws the fib exactly the same as when I draw it manually. Build 1031

 
honest_knave:

Odd. When I use your code in post #1, it draws the fib exactly the same as when I draw it manually. Build 1031

Hi.

Is this happen in Meta Trader 4 ?

We already know that this is not a problem in Meta Trader 5.

Thanks for your clarification.

When you say exactly the same, do you mean that it does have right ray on for both manually and programmatically ?

Kind regard.

 

Running this script on MT4:

void OnStart()
  {
   string name = "test";
   ObjectCreate    (0, name, OBJ_FIBO, 0, Time[11], Low[11], Time[1], High[1]);
   ObjectSetInteger(0, name, OBJPROP_RAY, false);
   ObjectSetInteger(0, name, OBJPROP_RAY_RIGHT, false);
  }

Produces this result:


 

 Now manually dragging a fib over the same points:


Deliberating pulling the manual fib higher, so you can see:

 

 
honest_knave:

Running this script on MT4:

void OnStart()
  {
   string name = "test";
   ObjectCreate    (0, name, OBJ_FIBO, 0, Time[11], Low[11], Time[1], High[1]);
   ObjectSetInteger(0, name, OBJPROP_RAY, false);
   ObjectSetInteger(0, name, OBJPROP_RAY_RIGHT, false);
  }

Produces this result:


 

 Now manually dragging a fib over the same points:


Deliberating pulling the manual fib higher, so you can see:

 

I see.

Thanks for clarification.

The distance between two points are only 12 candles and it seems the ratio labels are located too far away to right side of chart even without ray right property on.

Hope there is some easy way to keep the reasonable distance between the ratio labels and the starting point of fibo object programmatically.

It is difficult to control in MT4. :)



 
Young Ho Seo:
I see.

Thanks for clarification.

The distance between two points are only 12 candles and it seems the ratio labels are located too far away to right side of chart even without ray right property on.

Hope there is some easy way to keep the reasonable distance between the ratio labels and the starting point of fibo object programmatically.

It is difficult to control in MT4. :)

honest_knave:

If you move the entire fib to the left (or move the chart shift triangle further to the left) you will probably see that the fib does end i.e. it is not a ray.

The bigger the difference between the 2 times, the longer the line. You can't control how long the line is, only whether it is a ray.