//+------------------------------------------------------------------+//| 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"Получение цены точки привязки и значение уровней"inputstring name_fibo="Fibo"; // имя Фибо//+------------------------------------------------------------------+//| Script program start function |//+------------------------------------------------------------------+voidOnStart()
{
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());
elsePrint("Значение уровня ",i," равно ",DoubleToString(temp_price,Digits()));
}
}
//+------------------------------------------------------------------+
And this is roughly the result:
2016.01.2715:54:45.905 Test (EURUSD,M5) Цена точки привязки 0 равна 1.090462016.01.2715:54:45.905 Test (EURUSD,M5) Цена точки привязки 1 равна 1.085642016.01.2715:54:45.905 Test (EURUSD,M5) Значение уровня 0 равно 0.000002016.01.2715:54:45.905 Test (EURUSD,M5) Значение уровня 1 равно 0.236002016.01.2715:54:45.905 Test (EURUSD,M5) Значение уровня 2 равно 0.382002016.01.2715:54:45.905 Test (EURUSD,M5) Значение уровня 3 равно 0.500002016.01.2715:54:45.905 Test (EURUSD,M5) Значение уровня 4 равно 0.618002016.01.2715:54:45.905 Test (EURUSD,M5) Значение уровня 5 равно 1.000002016.01.2715:54:45.905 Test (EURUSD,M5) Значение уровня 6 равно 1.618002016.01.2715:54:45.905 Test (EURUSD,M5) Значение уровня 7 равно 2.618002016.01.2715:54:45.905 Test (EURUSD,M5) Значение уровня 8 равно 4.23600
'+' - cannot convert enum prob.mq4 14 51
Going to write a servisdesk.
'+' - cannot convert enum prob.mq4 14 51
Going to write a servisdesk.
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.
Hmm. It works for me.
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 !
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:
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.
И? 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 proportionally through the 0 and 100 levels. There are no special functions for this.
And this is roughly the result: