previous bid

 

hi guys,

I'm currently trying my first steps on MT4 and a strange problem occured.

I know how to get the actual Bid-Price - its simply the command "Bid", but how do I get the Bid-Price one Tick before the actual one??

thanks for your help!


jürgen

 

hi jürgen, you need to store the previous value, no build in function for that:

int start(){

static double Bid.old=0;

/*here goeas all your code





*/
Bid.old=Bid;
}
 
zzuegg:

hi jürgen, you need to store the previous value, no build in function for that:


thanks man!

shouldnt the static variable be defined outside the int start () ?

 

static variables keep its value.. they don't get reinitialized.


//z

 
jdegenfellner:

shouldnt the static variable be defined outside the int start () ?

Variables declared outside of start() are static by default.
Reason: