Alankras: Every time it returns 2147483647.
-
Play videoPlease edit your post.
For large amounts of code, attach it.
-
ChartTimePriceToXY - MQL4 Documentation returns a bool. it can't return EMPTY_VALUE
WHRoeder:
-
Play videoPlease edit your post.
For large amounts of code, attach it.
- ChartTimePriceToXY - MQL4 Documentation returns a bool. it can't return EMPTY_VALUE
You are right, but I meant that the value of alligatorX, alligatorY are not valid after.
Check your return code (ChartTimePriceToXY) and find out why.
What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
WHRoeder:
Check your return code (ChartTimePriceToXY) and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Check your return code (ChartTimePriceToXY) and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
I already did that. For example, GetLastError() return 0 everytime, ChartTimePriceToXY return true.
Anyway, thank you for your help.
I am facing the same issue but on an offline-chart :(
I put an object on that chart and moved it around and run each time a script with this part:
double DOT_P = ObjectGetDouble( 0,"DOT",OBJPROP_PRICE ); datetime DOT_B = (datetime)ObjectGetInteger(0,"DOT",OBJPROP_TIME ); int DOT_x,DOT_y; bool ok = ChartTimePriceToXY(0,0,DOT_B,DOT_B,DOT_x,DOT_y); Print("OffLineChart: BarTime: ",DOT_B," BarPrice: ",DoubleToString(DOT_P,Digits), " x,y: ",DOT_x,", ",DOT_y," Error: ",_LastError," ok: ",ok);
This is the result:
2018.05.11 10:02:16.108 KopI EURUSD,Weekly: OffLineChart: BarTime: 2007.07.08 00:00:00 BarPrice: 1.22715 x,y: 188, -2147483129 Error: 0 ok: true 2018.05.11 10:01:59.933 KopI EURUSD,Weekly: OffLineChart: BarTime: 2012.02.05 00:00:00 BarPrice: 1.80440 x,y: 666, -2147483129 Error: 0 ok: true 2018.05.11 10:01:47.631 KopI EURUSD,Weekly: OffLineChart: BarTime: 2016.02.07 00:00:00 BarPrice: 0.99372 x,y: 1084, -2147483129 Error: 0 ok: true
Could be a typo in
bool ok = ChartTimePriceToXY(0,0,DOT_B,DOT_B,DOT_x,DOT_y)
Two dot_b and no dot_p.
kypa:
Could be a typo in
Could be a typo in
Two dot_b and no dot_p.
YES - thanks that was it!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello everyone,
I am writing the expert, which is used ChartTimePriceToXY. When I tested it, this function work incorrect. Every time it returns 2147483647. I realise that it is 2^31 - 1, which is mean EMPTY_VALUE in this system, but I absolutely dont know why it happens.
Part of my code:
And the most weard thing is, that if I try to run this code in the indicator, everything is good (function return valid values).
Guys, I need your help. Thank you.