Simple breakout

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #67775 quote
    DMas
    Participant
    New

    Hello, I’m new to PRT and just try to start with some basics. And….I just come up with some questions.

    My intention is to enter the market with a long position as soon as the actual close is above the highest highs of the previous 5 bars. When my fist bar is January 1 does highest[5](high) mean the highest high of Jan 1 – Jan 5? Then I would put the actual close with the bar number 6 in front of it?

    c1 = (close[6] > highest[5](high))
    
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    Then I figured out that the opening will be always the next and not the current bar, but the ladder one is essential for me as I trade in daily bar mode. I reads somewhere there’s a way to use a limit order.

    So my idea:

    H1 = highest[5](high)
    
    c1 = (close[6] > H1)
    
    IF c1 THEN
    BUY 1 CONTRACT AT H1 Limit
    ENDIF

     

    Does I make work to trade at the current bar, as soon as the close price crossed the upper channel?

    Thank you for your help.

    DMas

    #67779 quote
    robertogozzi
    Moderator
    Master

    To write code, please use the <> “insert PRT code” button, to make code easier to read and understand. Thank you.

    #67780 quote
    robertogozzi
    Moderator
    Master

    It is not possible to reference future data (candles/bars).

    It is only possible to reference past data.

    So whatever day or timeframe you are,

    highest[5](high)

    will always refer to the highest price of the LAST 5 bars, that is from HIGH[0] through HIGH[4]. If you want to refer to the LAST previous 5 bars you’ll have to write

    highest[5](high[1])

    Any code will be executed ONLY, as of this version of the platform, when each bar closes, whose high price may refrenced as HIGH[0] or just HIGH, then HIGH[1], and so on….

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Simple breakout


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
DMas @dmas Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by robertogozzi
7 years, 11 months ago.

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