Hourly Trading

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #92156 quote
    MarcMarc
    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
    GraHalGraHal
    Participant
    Legend

    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 GraHalGraHal
7 years, 8 months ago.

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