Hourly Trading

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #92156 quote
    Marc
    Participant
    Average

    HI together,

    I wanted to open a trade at hour x and want to close order at hour y.

    The code looks fine (I think), but a lot more orders were opened.

    Is there a reason why and can anybody help me how to enter trades only within tradingwindow mentioned in the code?

    Defparam Cumulateorders = False
    n = 1
    
    IF NOT ONMARKET AND DayOfWeek = 4 and HOUR > 8 THEN
    BUY n SHARES AT MARKET nextbaropen
    endif
    
    IF ONMARKET AND DayOfWeek = 4 and HOUR > 11 THEN
    SELL n SHARES AT MARKET nextbaropen
    endif

    Pls attached a trade overview

    Unbenannt.jpg Unbenannt.jpg
    #92169 quote
    GraHal
    Participant
    Master

    Yeah … isn’t below what you want (= not > ) else you’ll be opening trades at 12, 14 etc and closing every alternate hour at 13 15 etc.

    IF NOT ONMARKET AND DayOfWeek = 4 and HOUR = 8 THEN
    BUY n SHARES AT MARKET nextbaropen
    endif
     
    IF ONMARKET AND DayOfWeek = 4 and HOUR = 11 THEN
    SELL n SHARES AT MARKET nextbaropen
    endif
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Hourly Trading


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Marc @mast83 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by GraHal
7 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/23/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...