5 Day Lows & Highs

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

    Good afternoon all,

    I am trying to generate a piece of code that will provide a buy or sell signal on the chart dependent on when we break above or below the highest or lowest point of the last 5 periods.

    I am sure this is easily done however I am inexperienced in coding.

    Any help would be gratefully received.

    Thanks all! Happy trading

    #181799 quote
    PhilstradingPhilstrading
    Participant
    Senior
    myhigh=highest[5]
    Mylow=lowest[5]
    
    If not onmarket and close> myhigh then
    buy  myamount perpoint at market
    endif
    
    If notonmarket and close <mylow then
    sellshort myamount perpoint at market
    endif
    
    
    // Use this on the 1 seconds chart and change 5 to whatever the sconds value of your timeframe x5 (so 5 mins would be [300]

    The only issue is that with 1,000,000 units you can only test about 1 month in backtest…. If you are happy entering on the close of the 1 minute candle run it on the 1 minutes..

    There are programming manuals on here to download, and a programming coarse I’d recommend…

    #181800 quote
    PhilstradingPhilstrading
    Participant
    Senior

    you can also substitute close for high or low

    #181801 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    In lines 4 and 8 you need to add  [1] to myhigh and  mylow, as CLOSE will never close above the current high.

Viewing 4 posts - 1 through 4 (of 4 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

5 Day Lows & Highs


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
al_craig @al_craig Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by robertogozzirobertogozzi
4 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/18/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...