1. Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)
    Dismiss Notice

Question How do I add a Timefilter to an EA? Please Help!

Discussion in 'Belajar MQL dari Nol' started by ERA, 02 Sep 2022.

  1. ERA

    ERA Member

    Equity
    Credit
    Ref Point
    I would love to Add a Timefilter to an EA so that when I am not home I don't risk losing my account. I don't wanna trade during NY session
     
  2. Wabbit

    Wabbit Member Credit Hunter

    Equity
    Credit
    Ref Point
    try searching in MQL5 website for a possible solution
     
  3. Niguru

    Niguru Member Credit Hunter

    Equity
    Credit
    Ref Point
    This question should be posted in the "learning center" area.

    upload_2022-9-3_15-10-26.png
     
  4. Niguru

    Niguru Member Credit Hunter

    Equity
    Credit
    Ref Point
    here the code:

    Code:
    // MQL5
    MqlDateTime mTime;
    input int t_start = 8;  //Start
    input int t_end   = 17; //End
    
    bool time_filter() {
    bool hour_limit = true;
    if(mTime.hour >= t_start && mTime.hour <= t_end) hour_limit=false;
    return(hour_limit);
    }
     
  5. ERA

    ERA Member

    Equity
    Credit
    Ref Point
    Thank you very much! I really appreciate it. And thank you to the other persons for responding
     
  6. ahmet

    ahmet Member Credit Hunter

    Equity
    Credit
    Ref Point
    Thank you for the information.

    trade time

    start hour:
    start minute:
    end hour:
    end minute:


    all trade hard close time

    hard close hour:
    hard close minute:

    How do we add this?
     
  7. blackking

    blackking Well-Known Member Credit Hunter

    Equity
    Credit
    Ref Point
    Programing language is very complicated for me
    It is the reason I like manual trading.
     
  8. Wabbit

    Wabbit Member Credit Hunter

    Equity
    Credit
    Ref Point
    You could always get someone to program your manual strategy for you or look for EA's that are a good fit for you, and that way you dont have to be at the computer all the time.
     
  9. tinek36

    tinek36 Member Credit Hunter

    Equity
    Credit
    Ref Point
    extern int a=0;
    extern int b=24;

    simple ...find codition for buy sel and add
    if(....................&&Hour()>a&&Hour()<b) .........
     
    • Agree Agree x 1
  10. hvn000

    hvn000 Member Credit Hunter

    Equity
    Credit
    Ref Point
     

    Attached Files:

  11. ERA

    ERA Member

    Equity
    Credit
    Ref Point
    Thank you my friend! Words are not enough to thank you.
     

Share This Page