Announcement

Collapse
No announcement yet.

Backtest Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Backtest Problem

    Hi

    I have built a trading system which changes the bar background color on the chart when trades are entered - red for short, green for long etc.

    On the chart, the bar background is changing exactly as I wish it to, with trades being entered and exited at the right time. Unfortunately, when I backtest the system, it merely opens a long at the first long signal, then stays long until the end of the backtest (i.e. end of trading today).

    Has anyone had this problem before? Does anyone have any ideas if this is a generic type error ?

    Many thanks

    Deax.

  • #2
    Deax
    Are you painting the bar background based on signals triggered directly by the conditions or based on the strategy being long/short?
    If the former then try adding the commands to paint the background based on the strategy ie
    if(Strategy.isLong()) setBarBgColor(Color.lime);
    If the bar background then matches the result(s) you are getting with the Back Tester then the error is more than likely in the strategy logic.
    Alex

    Comment


    • #3
      Alex,

      Apologies for not replying earlier. I have now resolved the issue - the problem was in the logic.

      Thanks for your help.

      Deax.

      Comment

      Working...
      X