I can get the Price_value from Fibonacci with 2 parameters, with the following code...
How can i get the Price_value for Fibonacci EXPANSION, that has 3 parameters , for the following code?
you are not being clear, none of your code is getting the price values from the object.
try looking at ObjectGetDouble.
if you mean how to set them then look at the documented example
https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_expansion
- www.mql5.com
you are not being clear, none of your code is getting the price values from the object.
try looking at ObjectGetDouble.
Hi.Thank you for your answer.
I tried the following code but i cannot get the property of the fibo levels..
The
OBJPROP_PRICE
returns the prices from Expansion lines. i also tried OBJPROP_LEVELVALUE but i get zero return.
Can you see what i am doing wrong?
void OnTick() { ObjectDelete(0,Symbol()); datetime time1,time2,time3; double price1,price2,price3; int chart_ID= 0; string name = Symbol(); double fib_values[13]={0.0,.236,.382,.500,.550,.618,.786,1.000,1.272,1.411,1.618,2.618,4.236}; time1 = iTime(NULL,0,3); time2 = iTime(NULL,0,2); time3 = iTime(NULL,0,1); price1 = iLow(Symbol(),NULL,3); price2 = iHigh(Symbol(),NULL,2); price3 = iLow(Symbol(),NULL,1); if(!ObjectCreate(chart_ID,name,OBJ_EXPANSION,0,time1,price1,time2,price2,time3,price3)) Print("error"); ObjectSetInteger(chart_ID,name,OBJPROP_LEVELS,13); for(int i=0;i<13;i++) { ObjectSetDouble(chart_ID,name,OBJPROP_LEVELVALUE,i,fib_values[i]); ObjectSetString(chart_ID,name,OBJPROP_LEVELTEXT,i,"FE "+DoubleToString(100*fib_values[i],1)); Print(fib_values[i]," ",ObjectGetDouble(chart_ID,name,OBJPROP_PRICE,fib_values[i])); } ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,Magenta); ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,STYLE_SOLID); ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,1); ObjectSetInteger(chart_ID,name,OBJPROP_RAY_RIGHT,False); }
Hi.Thank you for your answer.
I tried the following code but i cannot get the property of the fibo levels..
The
returns the prices from Expansion lines. i also tried OBJPROP_LEVELVALUE but i get zero return.
Can you see what i am doing wrong?
use an integer for the level you require not the value of the level.
ObjectGetDouble(chart_ID,name,OBJPROP_PRICE,fib_values[i]))
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I can get the Price_value from Fibonacci with 2 parameters, with the following code...
How can i get the Price_value for Fibonacci EXPANSION, that has 3 parameters , for the following code?