How to open/close trade using time

To add comments, please log in or register
vilas korke
40
vilas korke  
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++) { }
Mohamad Zulhairi Baba
16377
Mohamad Zulhairi Baba  
vilas korke:
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++) { }

https://docs.mql4.com/constants/structures/mqldatetime

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
  • docs.mql4.com
Structure of the Date Type - Data Structures - Constants, Enumerations and Structures - MQL4 Reference
William Roeder
20207
William Roeder  
vilas korke:
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++) { }
  1. 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.
  2. Get the current time and check.
              Find bar of the same time one day ago - Simple Trading Strategies - MQL4 programming forum
vilas korke
40
vilas korke  
William Roeder:
  1. 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.
  2. Get the current time and check.
              Find bar of the same time one day ago - Simple Trading Strategies - MQL4 programming forum
Thanks... Sir for your guidance. 
To add comments, please log in or register