Download MetaTrader 5
To add comments, please log in or register
Unable to find the answer to your question? Use the search!
chua le
234
chua le 2015.06.25 08:12 

Hi,

 

May I know how to write the coding  to find the diferrences between the current tick price and previous tick price?

 Regards 

whroeder1
13610
whroeder1 2015.06.25 11:47  
Save the current tick price in a static/global, when the next tick comes in you have the previous tick price.
chua le
234
chua le 2015.06.26 14:32  
May I know the coding to be used?
whroeder1
13610
whroeder1 2015.06.26 18:01  
chuale: May I know the coding to be used?
  1. You are asking how to assign a value to a variable? Look at any documentation page, (that has a code example,) and you will see many.
  2. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
JD4
1101
JD4 2015.06.27 04:44  

Generic code for programming assignment of a value to a variable.  (Note, this may or may not work for MQL, check documentation for better examples.)

currentTick=whatever value the program you write sends to it;
firstTick=currentTick;
programming code here, next tick comes in
check value of currentTick against value of firstTick
do something here depending on value of firstTick in relation to currentTick
(this could be calculate difference between the 2, check to see if it is higher, lower, or equal.  it all depends on what you want the program to do with the information
/
To add comments, please log in or register