Download MetaTrader 5

FIBO's issue

To add comments, please log in or register
Do you know C++? MQL5 has much in common with it. Just try it yourself!
Max Enrik
814
Max Enrik 2016.11.01 22:58 

Hi,

When I want to see wide past time like below picture, my FIBO's disappear.

(I made this FIBO's with Indicator.)

(It looks like 'Chart Scale' issue when Scale 1,3,5... FIBO's disappear - it appear 2,4,6...) 

Fibo disappear  

What a problem please help me, I need good reply.

Thanks. 

Max Enrik
814
Max Enrik 2016.11.02 02:29  

I can't get right price result.

I try code like below.

string _obj_desc_Price_cdts = DoubleToStr( _obj_desc_Price, _Digits - 2 ); // yes I know price is not 'string' - it maybe 'double' but I know one way how to decrease decimals.
// ...
ObjectSetFiboDescription( _obj_Name + _I, 0 , _obj_desc_Price_cdts ); // Result EURUSD - 0.000

Please help me.

Thanks.

Max Enrik
814
Max Enrik 2016.11.02 05:59  
Max Enrik:

(It looks like 'Chart Scale' issue when Scale 1,3,5... FIBO's disappear - it appear 2,4,6...) 

      I fixed it.
Max Enrik
814
Max Enrik 2016.11.02 23:41  

I need your advice can I decrease last two decimal from 'ObjectSetFiboDescription'?

(i.g price 1.13500 - after removed  price 1.135) 

Thanks. 

honest_knave
Moderator
2220
honest_knave 2016.11.03 11:31  
Max Enrik:

I can't get right price result.

I try code like below.

string _obj_desc_Price_cdts = DoubleToStr( _obj_desc_Price, _Digits - 2 ); // yes I know price is not 'string' - it maybe 'double' but I know one way how to decrease decimals.
// ...
ObjectSetFiboDescription( _obj_Name + _I, 0 , _obj_desc_Price_cdts ); // Result EURUSD - 0.000

Please help me.

Thanks.

 

In theory, this should work fine. Please show where you set _obj_desc_Price, _obj_Name and _I

Max Enrik
814
Max Enrik 2016.11.03 11:44  
honest_knave: 

In theory, this should work fine. Please show where you set _obj_desc_Price, _obj_Name and _I

I set them in 'int start()' function. 

honest_knave
Moderator
2220
honest_knave 2016.11.03 13:12  

You aren't really showing enough code... I presume you are creating a fibo then running ObjectSetFiboDescription.

What I have found is that if you do that without explicitly setting the number of fibo levels, you will get a 4201 error when you run ObjectSetFiboDescription.

A basic example to illustrate the point. This works:

#property strict

void OnStart()
  {
   string name="MyFibo";
   int h=iHighest(NULL,0,MODE_HIGH,30),
       l=iLowest(NULL,0,MODE_LOW,30);
   ObjectCreate(0,name,OBJ_FIBO,0,Time[h],High[h],Time[l],Low[l]);
   ObjectSetInteger(0,name,OBJPROP_FIBOLEVELS,1);
   ObjectSetFiboDescription(name,0,DoubleToStr(Low[l],2));
  }  

This does not:

#property strict

void OnStart()
  {
   string name="MyFibo";
   int h=iHighest(NULL,0,MODE_HIGH,30),
       l=iLowest(NULL,0,MODE_LOW,30);
   ObjectCreate(0,name,OBJ_FIBO,0,Time[h],High[h],Time[l],Low[l]);
   ObjectSetFiboDescription(name,0,DoubleToStr(Low[l],2));
  }  


 

Max Enrik
814
Max Enrik 2016.11.03 14:11  
honest_knave:

You aren't really showing enough code... I presume you are creating a fibo then running ObjectSetFiboDescription.

What I have found is that if you do that without explicitly setting the number of fibo levels, you will get a 4201 error when you run ObjectSetFiboDescription.

A basic example to illustrate the point. This works:

Thanks so much for great example.

You will understand me if you visit below link.

Posted 

Thanks your comments. 

To add comments, please log in or register