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
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) :
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
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]
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]
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
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