Simple Breakout strategy

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #101712 quote
    Ivan Donatiello
    Participant
    Average

    Hi everyone, I wanted to test this strategy:

    Long Entry:

    1 – Pending order on the daily maximum
    2 – Monetary stop loss
    3 – Take profit fixed at the level: yesterday’s maximum + yesterday’s ATR value

    Short entry all the opposite

    Tks

    #101714 quote
    robertogozzi
    Moderator
    Master

    1 – which day? Yesterday?

    2 – example? do you want it to be fixed or determined in which way?

    #101721 quote
    Ivan Donatiello
    Participant
    Average

    1 – of the last bar

    2 – We want both the stop loss and the take profit to be fixed and not to move anymore. Fixed at the entry level + a quantity of ATR for example ATR * 1.5

    So the rules of the system are:

    1 – Enter long at the breakout of the maximum of the last bar
    2 – Fixed monetary stop loss (example $ 100)
    3 – It sets take profit at an entry price level + a quantity of volatility calculated with a multiple of atr

    🙂

    #101740 quote
    robertogozzi
    Moderator
    Master

    There you go:

    DEFPARAM CumulateOrders = false
    MyAtr = AverageTrueRange[14](close) * 1.5
    IF Not OnMarket THEN
       BUY 1 CONTRACT AT high[1] STOP
       SET STOP   $LOSS  100
       SET TARGET PROFIT MyAtr
    ENDIF
    
    #101921 quote
    Ivan Donatiello
    Participant
    Average

    Thank you Roberto for the help, but to enter the maximum of the previous day this is the exact code:

    DEFPARAM CumulateOrders = false
    MyAtr = AverageTrueRange[14](close) 
    IF Not OnMarket THEN
    BUY 1 CONTRACT AT high[0] STOP
    SET STOP   $LOSS  5000
    SET TARGET PROFIT MyAtr
    ENDIF
    

    high[0] to enter on the max of the previus day.

    Stop loss value it is variable based on its own operations.

    Well now I would like to try building a pyramid over it, which allows me to enter volatility multiples. For example, add a lot when the position reaches: Open Trade Price + ATR multiple.

    Do you think it’s possible?

    #101928 quote
    robertogozzi
    Moderator
    Master

    I don’t know who told you about HIGH[0] or where you read it, but it’s wrong whatever!

    [0] or NOTHING means the current bar (the one just closed, before the new one opens), so the bar before the current one is identified by [1].

    If you are using daily bars, at the end of today’s bar you strategy is executed, just before the new bar opens, so the bar tagged July 4th is the CURRENT bar identified by [0].

    I never dealt with pyramids, I know you can find several pieces of code about it searching this forum.

    In any case if you tell me what you want to do I’ll try to help.

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

Simple Breakout strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

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