Errors, bugs, questions - page 1480

 
Vasyl Nosal:

'+' - cannot convert enum prob.mq4 14 51

Going to write a servisdesk.


Have you seen the example ofObjectSetDouble in Help? It contains creation of Fibo, addition of levels and getting the values of the levels.
 
Vasyl Nosal:

'+' - cannot convert enum prob.mq4 14 51

Going to write a servisdesk.


Hmm. it works for me.
 
Karputov Vladimir:
Have you seen the example ofObjectSetDouble in the reference? It creates Fibo, adds levels and gets values of levels.

ObjectSetDouble(chart_ID,name,OBJPROP_LEVELVALUE,i,values[i]);

Sets the price.

If GET, it returns the level value, not the price.

 
Vladislav Andruschenko:
Hmm. It works for me.
Give me the code.
 

Dummy's hiccup, but enlighten me as to why the F1 button in the editor of the new 950 build does not work ?

THANK YOU !

 
Vasyl Nosal:

ObjectSetDouble(chart_ID,name,OBJPROP_LEVELVALUE,i,values[i]);

Sets the price.

If GET, it returns the level value, not the price.

Gets the price of Fibo anchor points:

//+------------------------------------------------------------------+
//|                                              ObjectGetDouble.mq5 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property script_show_inputs
#property description "Получение цены точки привязки"
input string name_fibo="Fibo";   // имя Фибо
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   double temp=0.0;
   temp=ObjectGetDouble(0,name_fibo,OBJPROP_PRICE,0);
   Print("Цена точки привязки ",0," равна ",DoubleToString(temp,Digits()));
   temp=ObjectGetDouble(0,name_fibo,OBJPROP_PRICE,1);
   Print("Цена точки привязки ",1," равна ",DoubleToString(temp,Digits()));
  }
//+------------------------------------------------------------------+
Files:
Test.mq5  2 kb
 
Karputov Vladimir:

You get the price of the Fibo anchor points:

И? This is the price of 0% and 100%.

And you need to know the price of all levels.

 
Vasyl Nosal:

И? This is the price of 0% and 100%.

And you need to know the price of all levels.

As far as I know, it is calculated as a proportion through the 0 and 100 levels. There are no special functions for this.
 
Alexey Kozitsyn:
As far as I know, it is calculated proportionally through the 0 and 100 levels. There are no special functions for this.
Yes. You have to calculate it manually and get the value of the levels via
ObjectGetDouble(ChartID(),name_fibo,OBJPROP_LEVELVALUE,i,temp_price)

//+------------------------------------------------------------------+
//|                                              ObjectGetDouble.mq5 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.01"
#property strict
#property script_show_inputs
#property description "Получение цены точки привязки и значение уровней"
input string name_fibo="Fibo";   // имя Фибо
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   double temp=0.0;
//--- цена точки привязки
   temp=ObjectGetDouble(0,name_fibo,OBJPROP_PRICE,0);
   Print("Цена точки привязки ",0," равна ",DoubleToString(temp,Digits()));
   temp=ObjectGetDouble(0,name_fibo,OBJPROP_PRICE,1);
   Print("Цена точки привязки ",1," равна ",DoubleToString(temp,Digits()));

//--- значение уровней
//--- кстати, а сколько у нас Фибо-уровней ? 
   int levels=ObjectGetInteger(0,name_fibo,OBJPROP_LEVELS);
   double temp_price=0.0;
   for(int i=0;i<levels;i++)
     {
      ResetLastError();
      if(!ObjectGetDouble(ChartID(),name_fibo,OBJPROP_LEVELVALUE,i,temp_price))
         Print("Error ",GetLastError());
      else
         Print("Значение уровня ",i," равно ",DoubleToString(temp_price,Digits()));
     }
  }
//+------------------------------------------------------------------+

And this is roughly the result:

2016.01.27 15:54:45.905 Test (EURUSD,M5)        Цена точки привязки 0 равна 1.09046
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Цена точки привязки 1 равна 1.08564
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Значение уровня 0 равно 0.00000
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Значение уровня 1 равно 0.23600
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Значение уровня 2 равно 0.38200
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Значение уровня 3 равно 0.50000
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Значение уровня 4 равно 0.61800
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Значение уровня 5 равно 1.00000
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Значение уровня 6 равно 1.61800
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Значение уровня 7 равно 2.61800
2016.01.27 15:54:45.905 Test (EURUSD,M5)        Значение уровня 8 равно 4.23600
Files:
Test.mq5  2 kb
 
I want the price, not the value of the level.
Reason: