How to close/open trade using time..... Please give any hint or references....
int bars = iBars(_Symbol, PERIOD_CURRENT);
for (int i=0; i<bars && i<20; i++) {
}
vilas korke:
How to close/open trade using time..... Please give any hint or references....
How to close/open trade using time..... Please give any hint or references....
int
bars = iBars(_Symbol, PERIOD_CURRENT); for
(int
i=0;
i<bars && i<20;
i++) { }
![Structure of the Date Type - Data Structures - Constants, Enumerations and Structures - MQL4 Reference Structure of the Date Type - Data Structures - Constants, Enumerations and Structures - MQL4 Reference](https://c.mql5.com/36/27/structure-of-the-date-type-data.png)
Structure of the Date Type - Data Structures - Constants, Enumerations and Structures - MQL4 Reference
- docs.mql4.com
Structure of the Date Type - Data Structures - Constants, Enumerations and Structures - MQL4 Reference
vilas korke:
How to close/open trade using time..... Please give any hint or references....
How to close/open trade using time..... Please give any hint or references....
int
bars = iBars(_Symbol, PERIOD_CURRENT); for
(int
i=0;
i<bars && i<20;
i++) { }
- Your code has nothing to do with time. It just iterates over all bars. No need for the function call in MT4,
just use
Bars.
- Get the current time and check.
Find bar of the same time one day ago - Simple Trading Strategies - MQL4 programming forum
William Roeder:
Thanks... Sir for your guidance.
- Your code has nothing to do with time. It just iterates over all bars. No need for the function call in MT4,
just use
Bars.
- Get the current time and check.
Find bar of the same time one day ago - Simple Trading Strategies - MQL4 programming forum
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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