Not logged in

Forums

Viewing 15 posts - 1 through 15 (of 25 total)

Forums>EA Wizard>General Discussion>Trades only 8 am – 3 pm

  • #232923 |
    Participant
    89 Posts

    Hello, I would like to go long only at certain times eg 8am – 3 pm. Optional 5-9 clock.
    It does not work in the backtest. The orders are opened only in the time from 8 am to about 10 am.
    What could it be? Here my example:

    Best regards

    • This topic was modified 6 months, 3 weeks ago by  Uwe6000.
    Attachments:
    You must be logged in to view attached files.
    #232947
    Administrator
    761 Posts

    Hello,

    please zip all the files into a ZIP archive and try to re-attach

    #232967
    Participant
    89 Posts

    Hello, once again…

    Attachments:
    You must be logged in to view attached files.
    #233025
    Administrator
    761 Posts

    Hello,

    the condition needs to be modified slightly. Check the file attached

    Attachments:
    You must be logged in to view attached files.
    #233056
    Participant
    89 Posts

    Hello, great !!!  thank you

    #233057
    Participant
    89 Posts

    and if i like trade 8 – 15 and 16.30 – 22  ?

    i try this without minutes:
    And ((Hour[0] >= 8)
    And ((Hour[0] <= 15)
    And ((Hour[0] >= 16)
    And (Hour[0] <= 22)

    its not working, no trade will be open.

    Close all positions at 21.55 sounds good. How can i do this?

    regards

     

    #233072
    Conmariin
    Participant
    98 Posts

    I think the condition will never happen and parenthesis is wrong.

    Try it with

    ((Hour[0] >= 8) AND (Hour[0] <= 15))
    OR ((Hour[0] >= 16) AND (Hour[0] <= 22))

     

    Conmariin 🙂

    #233097
    Administrator
    761 Posts

    Hello,

    yes Conmariin is correct on this. You need to use the OR operator so market is either in range from 8 to 15 OR from 16 to 22

    #233171
    Participant
    89 Posts

    Hello,
    that sounds good, but where can I find the OR operator? Whenever I create a rule, it is always AND operator at the beginning of each line.

    #233177
    Administrator
    761 Posts

    Hello,

    click on the “and” and select “or” instead 😉

    #233191
    Participant
    89 Posts

    Hello, oh thanks, I had not discovered that

    #233197
    Participant
    89 Posts

    Hello, something is wrong…

    Attachments:
    You must be logged in to view attached files.
    #233201
    Administrator
    761 Posts

    Hello,

    you need to use parentheses as Conmariin showed higher.

    ((Hour[0] >= 8 AND Hour[0] <= 15)
    OR (Hour[0] >= 16 AND Hour[0] <= 22))

    So you enclose “ANDs” together. If you need me to edit the project for you please send to support@strategyquant.com or upload ZIP file

    #233205
    Participant
    89 Posts

    hello tomas, I have sent you a mail with file and explanation on your e-mail. Best regards Uwe

    #233285
    Participant
    89 Posts

    hello, can I change that in the wizard or is that only possible in the Meta Editor?

Viewing 15 posts - 1 through 15 (of 25 total)

You must be logged in to reply to this topic.