I need the CODE of the difference between the last tick and the previous tick of the last tick for Example
the last tick for Eur is 1.3254 and the previous tick of the last tick is 1.3256 so the difference between them is 1.3254-1.3256=-0.0002
Hi, see this example how to get the previous price by using a static double variable.
I use the BID price for the calculation.
// Previous BID price static double dBid_Price; double dOldBid_Price = dBid_Price; // To be used for getting recent/latest price quotes MqlTick Latest_Price; SymbolInfoTick(Symbol() ,Latest_Price);
// Update the BID price dBid_Price = Latest_Price.bid; // Check the difference between prices. double dDifferencePrice = 0; dDifferencePrice = dBid_Price - dOldBid_Price;
Hi, see this example how to get the previous price by using a static double variable.
I use the BID price for the calculation.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need the CODE of the difference between the last tick and the previous tick of the last tick for Example
the last tick for Eur is 1.3254 and the previous tick of the last tick is 1.3256 so the difference between them is 1.3254-1.3256=-0.0002