Time ranged high

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #124823 quote
    SlowlyslowlySlowlyslowly
    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
    VonasiVonasi
    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
    VonasiVonasi
    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.
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

Time ranged high


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by VonasiVonasi
6 years, 6 months ago.

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