Help identifying a mistake in this simple Forex breakout code

Forums ProRealTime English forum ProOrder support Help identifying a mistake in this simple Forex breakout code

Viewing 3 posts - 1 through 3 (of 3 total)
  • #38990

    Hi Colleagues,

    I am posting this strategy well known by most of you, but with some slight modifications. I would APPRECIATTE if someone could identify what is wrong.

    It seems to work but I cannot get all the conditions right in the backtest. I am new with programming, and I am frustrated with this system because I cannot get one operation everyday, or when I get it, the system is launching the orders at the same time everyday, etc.

    The system is a simple morning breakout for EUR-USD (TF: 15 min).

    1.Starts at 08:00h and collect the highest and lowest from the last 12 candlesticks (from 05:00 to 08:00h).

    2. After 08:00h, when the price breaks the highest of the channel + 3 pips, or the lowest of the channel– 3 pips, buy long or sell short (in the same candle, not at the opening of the next candle).

    3. Stops and Target Profits finish the trading.

    4. Only operates once a day, regardless if the trade was positive or negative.

    5. The system will shut down at 14:00h. Any open trade will be close at that time.

    6. I have included a NON OPERATING condition, in case the range of the channel of the 12 candlesticks is bigger than 32 pips.

    Although it seems very basic and the equity curve is not very attractive right now, I like the fact that I can control the operations once a day and limit and daily monitoring the results. It is a matter of adding other currencies everyday, and creating different schedules for US and Asian markets (i.e.- I could have 5 currencies from 0800 to 1400, 5 from 1500 to 2200, and other five overnight for Asian market). It is just a matter, once it works, to change the time in the code).

    Thanks so much in advance,

    Juan

     

    #38995

    Your pending stop orders will only last 1 single bar in your code. Pending orders must be set each bar, because they only last 1 candlestick. In order to let the system put the STOP Orders continuously at each new bar until one of them triggered you should try this modified code instead:

    This is a rough and quick Sunday afternoon fix, not tested 😉

    #38997

    Hi Nicolas,

    Thanks so much for your prompt response, especially on Sunday. You are super reliable for everyone here.

    I will test it myself 😉

    Have a great day,

    Juan

Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login