Time ranged high

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #124823 quote
    Slowlyslowly
    Participant
    Average

    Using a 5 min code starting at 11am – is there a way to code a trigger that buys when the high of 10-11am previous hour is achieved.

     

    Many thanks for any help.

    #124828 quote
    Vonasi
    Moderator
    Master

    Like this (not tested):

    if opentime = 100000 then
    myhigh = high
    endif
    
    if time > 100000 and time <= 110000 then
    myhigh = max(myhigh,high)
    endif
    
    if time >= 110000 then
    buy 1 contract at myhigh stop
    endif

     

    #124829 quote
    Vonasi
    Moderator
    Master
    Alternatively you can use MTF (not tested):
    timeframe(1 hour)
    if opentime = 100000 then
    myhigh = high
    endif
    
    timeframe(5 minutes)
    if time >= 110000 then
    buy 1 contract at myhigh stop
    endif
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Time ranged high


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Vonasi
5 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/06/2020
Status: Active
Attachments: No files
Logo Logo
Loading...