How to trade specific hours

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #206420 quote
    ACACAC
    Participant
    New

    Hi,

    how to a make it so my algorithms only trade for certain hours a day. I want to keep the codes running but only trade between for example, 9am -5 pm. is this done within the code, or within the pro real time software.

    thanks

    #206422 quote
    robertogozzi
    Moderator
    Master

    There you go (just add TradingAllowed to your conditions to enter a trade):

    TradingAllowed = (Time >= 090000) AND (Time <= 173000)  //9am to 5pm
    #206431 quote
    JS
    Participant
    Senior

    Hi @ACACAC

    You say “I want to keep the codes running” but do you also want your positions to remain open outside of your trading hours?

    If you also want to close your positions outside your trading hours, you can use:

    DefParam FlatBefore=090000

    DefParam FlatAfter=170000

    ACACAC thanked this post
    #206457 quote
    MaoRai54
    Participant
    Master
    Hi everybody, another way I’m using to trade in certain period is adding to the IF condition this:  and (hour=>H1 and hour<=H2) In this way you can put H1 and H2 as variables to be checked to find the best hours to trade.
    ACACAC and robertogozzi thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

How to trade specific hours


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
ACACAC @acacac Participant
Summary

This topic contains 3 replies,
has 4 voices, and was last updated by MaoRai54
3 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/28/2022
Status: Active
Attachments: No files
Logo Logo
Loading...