EUR/USD 2 Hour Breakout strategy on price action

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

    2 Hour breakout strategy on price action. Goes long on 2 hour breakout with 50 Day EMA filter. Exits on either hitting Stop loss or Profit target or if price goes below 2 hour low of previous period. Opposite strategy for short trades.  This is my first time to post so feedback from other members will be great to have. Below is the code.

    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Prevents the system from creating new orders to enter the market or increase position size before the specified time
    noEntryBeforeTime = 090000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // Prevents the system from placing new orders to enter the market or increase position size after the specified time
    noEntryAfterTime = 160000
    timeEnterAfter = time < noEntryAfterTime
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions to enter long positions
    c1 = (close CROSSES OVER high[1])
    indicator1 = ExponentialAverage[50](close)
    c2 = (close > indicator1)
    
    IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    c3 = (close < low[1])
    
    IF c3 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    c4 = (close CROSSES UNDER low[1])
    indicator2 = ExponentialAverage[50](close)
    c5 = (close < indicator2)
    
    IF (c4 AND c5) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    c6 = (close > high[1])
    
    IF c6 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP pLOSS 25
    SET TARGET pPROFIT 25
    eurusd-breakout-hour-15243966064clp8.png eurusd-breakout-hour-15243966064clp8.png
    #69544 quote
    Eric
    Participant
    Master

    You know of this?

    https://www.prorealcode.com/topic/tick-mode-help/

    Mat thanked this post
    #69549 quote
    GraHal
    Participant
    Master

    Hi Mat

    Further to Eric’s comment, you need to have the Tick Mode box ticked  when backtesting to give results nearest to what you will get in Live Trades.

    For full details read Eric’s Ref, but see below how to tick the tick by tick box! 🙂

    Cheers
    GraHal
    PS If you make the change below you get attached equity curve, so your code / values has potential.

    SET STOP pLOSS 40
    SET TARGET pPROFIT 120
    Mat thanked this post
    Mat-1.jpg Mat-1.jpg mat-2.jpg mat-2.jpg
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

EUR/USD 2 Hour Breakout strategy on price action


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Mat @jppatil Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by GraHal
7 years, 10 months ago.

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