Single candle breakout code

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18965 quote
    Dave
    Participant
    Senior

    HI, Could somebody look at the attached code and see if there is a problem with it?. Although I’ve managed a few successful ‘assisted creation back tests’, I’m totally new to writing it!. What I’m trying to do first is to place an order when price breaks either above or below the high/low of the 8.00 – 8.15(UK) m15 candle but when I run this in a backtest nothing happens?.

     

    Thanks,  Dave

    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    
    MaxPrice = highest[1](high)
    MinPrice = lowest[1](low)
    IF (TIME = 081500) AND (close > MaxPrice) THEN
    BUY 1 PERPOINT AT MARKET
    ENDIF
    IF (TIME = 081500) AND (close < MinPrice) THEN
    SELL 1 PERPOINT  AT MARKET
    ENDIF
    SET STOP PLOSS 25
    SET TARGET PPROFIT 10
    
    #18966 quote
    Nicolas
    Keymaster
    Master

    To make a breakout system you should first have a look on this video I made to how to build a break out box: http://www.prorealcode.com/blog/video-tutorials/create-breakout-box-2-hours/

    Then add pending stop orders at found levels to be sure trades will be successfully executed at that prices instead of testing if the close of the next candlestick is above or below which is often too late because of the not inside bar look (code is only read once at Close).

    Let us know how it goes and any additional questions.

    #18967 quote
    Dave
    Participant
    Senior

    Thanks Nicolas, If only I had seen the video beforehand – I could have saved myself a couple of hours of hair pulling!!. I will report back when I have tried a few ideas. Dave

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

Single candle breakout code


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Dave @dave Participant
Summary

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

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