ejmin ejoni:
hi guys , i want write a program for calculate deffrent of close price between last tick and one before it , but i dont know whats the problem
Every tick needs to be stored in a different element and the array to be sized accordingly.
Its seems MQL5 has a function to get tick data. See if it helps
Documentation on MQL5: Timeseries and Indicators Access / CopyTicks
- www.mql5.com
CopyTicks - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
-
Do not post code that will not even compile. You have no variable i.
-
You need only the previous and current tick; arrays are not required.
double closeCur=0; ⋮ double closePre = closeCur; closeCur = Close[0]; // Or Bid double dif = (closeCur - closePre);
Code fails on JPY pairs and metals. deffrent[i]=10000*(closes[i]-closes[i-1]);
Don't hard code constants deffrent[i]= (closes[i]-closes[i-1]) / _Point;
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
hi guys , i want write a program for calculate deffrent of close price between last tick and one before it , but i dont know whats the problem