MT3 How to get previous tick?

 
MT3 -How to get previous tick.
Examle:
time is 14:04:24 price is 1.2755
then in 14:04:25 how to get price from 14:04:24 (1.2755)???
In other words how to get price from previous second(CurTime-1)?
Please help.
Jeff
 
MT3 -How to get previous tick.
Examle:
time is 14:04:24 price is 1.2755
then in 14:04:25 how to get price from 14:04:24 (1.2755)???
In other words how to get price from previous second(CurTime-1)?
Please help.
Jeff


For Mt4 (don't know the syntax for Mt3) :
double PrevBid;   // declaration at global level
if(PrevBid>0)
{
   // do something with previous Bid
   .......
} 
PrevBid = Bid;





 
Thank you MichelB,but I don't understand if "PrevBid = Bid "
how MT4 will identify current bid?
I am sorry but I am not ok with programming.
Please explane.
Jeff

For Mt4 (don't know the syntax for Mt3) :
double PrevBid;   // declaration at global level
if(PrevBid>0)
{
   // do something with previous Bid
   .......
} 
PrevBid = Bid;






[/quote]

 
Thank you MichelB,but I don't understand if "PrevBid = Bid "
how MT4 will identify current bid?
I am sorry but I am not ok with programming.
Please explane.
Jeff


Each time there is a new bid price, your ea is called. So, when your ea is running, the reserved variable "Bid" is automatically assigned by the terminal to the value of the bid price of your broker. You do not have to care that.
" if(PrevBid>0) " is usefull only the first tick the ea is called : the value of PrevBid at this first tick is the default one, ie 0, and has not yet any signification. After that, "PrevBid = Bid" will assigne it the value of the current Bid, so it will become significant for the next tick.
 
Thank you MichelB.
I will try it.
Regards,
Jeff

Each time there is a new bid price, your ea is called. So, when your ea is running, the reserved variable "Bid" is automatically assigned by the terminal to the value of the bid price of your broker. You do not have to care that.
" if(PrevBid>0) " is usefull only the first tick the ea is called : the value of PrevBid at this first tick is the default one, ie 0, and has not yet any signification. After that, "PrevBid = Bid" will assigne it the value of the current Bid, so it will become significant for the next tick.

[/quote]
Reason: