Basic breakout

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11716 quote
    Tom C
    Participant
    New

    Hi can anyone help me with some basic coding?

    Need to enter long at 0800 when price moves above high of last 3 hours or short position if price goes below last 3 hours.

    Mid there anyway to increase your pip size automatically when your account reaches certain amounts?

    Many Thanks

    TC

    #11941 quote
    robertogozzi
    Moderator
    Master

    This  should work:

    //                           example for H1 timeframe
    //
    MaxPrice = highest[3](high)                                //180 on a 1-minute timeframe (60 x 3)
    MinPrice = lowest[3](low)                                    //180 on a 1-minute timeframe (60 x 3)
    IF (TIME = 080000) AND (close > MaxPrice) THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    IF (TIME = 080000) AND (close < MaxPrice) THEN
    SELLSHORT  AT MARKET
    ENDIF
    #11963 quote
    Tom C
    Participant
    New

    Thanks Roberto,

    #22748 quote
    ozcabman
    Participant
    New

    Hello,

    Today was my first day trying to understand the prt platform for back testing and auto trading….I’ve never coded anything before so please be gentle.

    In regards to the above breakout is it possible to set orders one or two pips above the high? From what I have read so far I can only see orders placed AT a above the high price.

    I hope that makes sense.

    Many thanks for any help.

    #22841 quote
    Nicolas
    Keymaster
    Master

    MaxPrice and MinPrice variables in the example above are already made of recent highest/lowest price. If you want to add/subtract points to their values, you can add them as follows:

    MaxPrice = highest[3](high)  + 2*pointisze                      
    MinPrice = lowest[3](low) -2*pointsize                                  

    Hope it helps.

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

Basic breakout


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Tom C @tom_c Participant
Summary

This topic contains 4 replies,
has 4 voices, and was last updated by Nicolas
9 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/15/2016
Status: Active
Attachments: No files
Logo Logo
Loading...