Bollinger System

Viewing 4 posts - 1 through 4 (of 4 total)
  • #14307

    Hi,

    I just started working with PRT. I tried to create a system that works with the Bollinger Bands. Basically the idea is to sell if the price crosses the upper band and vice versa (in 1h timeframe).

    That´s the code I have so far:

     

    The Problem now is that it buys/sells at the previous and not at the current bollinger value. Does someone have an idea how to solve this problem?

    Thank you!

     

    Regards Thomas

     

    #14310

    I have modified your code a bit.

    You don’t have to calculate yourself the standard deviation as it is already a language instruction. Only one trade will be launch at the same time.

    Results are great, but this is due to the “0 bar” behaviour of the tester.

     

    #14329

    Hi Nicolas,

    thanks for your reply and your modifications.

    I still face the problem, that positions are openend even if the price doesn´t cross the Bollinger Bands. The reason is, that the system buys on the previous Bollinger value.

    As an example: Let´s say we are at the 3 o´clock candle, then the system buys/sells at the 2 o´clock bollinger value.

    Do you have any ideas how to solve that problem?

    And could you please explain what you mean by “0 bar” behaviour?

    Thanks

    #14339

    You are putting LIMIT orders at market at the actual bollinger bands values. If price touch this value, the trade is open. You could have also try to use the cross of the close of candlesticks instead, with CROSSES OVER and CROSSES UNDER. What you think of a delay about the correct bollinger values may come from these conditional pending orders you are using in your strategy. Also, please have in mind that conditions are tested only 1 time at close of the candlestick and trades are executed at the next open.

    You’ll find a lot of topics and discussions here about the not look inside what happen in a bar, but it is now an old problem since version 10.3 now include a new tick by tick backtest engine.

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

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