Help with Code in mq4 for fixed Time section?
Page 1 of 502 12 LastLast
Results 1 to 10 of 15

Thread: Help with Code in mq4 for fixed Time section?

  1. #1
    Hi Guys

    How can I code in MT4 fixed Time section.
    For example I want out of my indi that it will look for some patterns just from 7:00 to 10:00 GMT and 13:00 to 15:00 GMT.
    Is for this in mq4 some purpose or I must write code for this?

    Could I utilize for example TimeCurrent function? However, I believe that this won't work because I want repaired time...
    How I can define that Time section.

    Many thanks for help!!

  2. #2
    You'll need the time functions to understand where to work.
    And for your patterns you need iBarShift to get the bar then the High/Low/Open/Close with iHigh/iLow/iOpen/iLow.
    The GMT detection is another story.

  3. #3
    Wau this seems for me too much complied I am not a good coder... Better to state quite terrible coder. Only basic stuff I know....
    Is there no way that I will only code from example like this:
    check yesterdays time from 7 to 10 server time?
    No purpose in MT4 for some thing like that?

    Quote Originally Posted by ;
    quote Assess the http://docs.mql4.com/predefined/variables/time to your pub that you are working on, even if it's inside your time range it is possible to replie your buffers, or even within the time range leave the buffers empty for that pub. If you are working with a timeframe other than the current chart usehttp://docs.mql4.com/series/iTime rather than

  4. #4
    The best way is iBarShift(), but if you're not a strong coder, you'll need to use something else like Hour() and Day().

  5. #5
    Guys what if I will do something like this...

    if(TimeCurrent()gt; London Open Server Time ) (TimeCurrent() lt; London Close Sever Time)....

    Where London Open Server Time etc.... will be repaired time from server.
    Is there purpose where I could call particular server time?

    thx

  6. #6
    Quote Originally Posted by ;
    Men what if I will do something like that... if(TimeCurrent()gt; London Open Server Time ) (TimeCurrent() lt; London Close Sever Time).... Where London Open Server Time etc.... will probably be fixed time from host. Is there purpose where I can call specific server time? Thx
    crusader1-
    Use something like that:
    Inserted Code if((Hour()gt;=StartHour Hour()lt;=EndHour)){

  7. #7
    THX

    StartHour and EndHour are my variables right?

    Something like that

    extern int StartHour = 0900; // will be 9:00 am server Time?

  8. #8
    Quote Originally Posted by ;
    THX StartHour and EndHour are my factors right? Something like this extern int StartHour = 0900; // will be 9:00 am host Time?
    No, like this...

    Inserted Code extern int StartHour = 9;
    if you would like to use hours and moments you need to do something a bit different. You need also know what a datetime represents in the event that you would like to work with times and dates in mql4/5.

  9. #9
    Wau Really Easy?
    Simply put if((Hour()gt;=9 Hour()lt;=11))and mq4 will understand my time range.... nice.

    Guys I've also Q about the way to pick second highest volume from preceding x candles....
    I understand how to pick highest because I will use iHighest work but what about second highest??


    thx

  10. #10
    Quote Originally Posted by ;
    Wau so Easy? Only set if((Hour()gt;=9 Hour()lt;=11))and mq4 will understand my time range.... nice. Men I have also Q about the way to select second highest volume from preceding x candles.... I understand how to pick highest because I'll use iHighest work but what about second highest?? thx
    For the second highest find the highest from the onset of the range to the 1st highest bar and compare with the highest from the 1st highest bar towards the end of the range.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners more information