Error in back test product

Forums ProRealTime English forum ProOrder support Error in back test product

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

    Hi, I think that my back test product is showing an error.  I’d be interested in other people’s views as to whether I’m right, or whether I’m making some fundamental error.

    I’ve got a system that is really simple, though it works off a fairly complicated indicator.  Here’s the code

    So, the issue arises when an existing position is in place, and a signal is generated in the opposite direction to the existing position, (ie, i’ve got a long position and a signal is generated which says I should open a short position.   My intention was that, in this case, the system should simply close out the existing position and wait for the next opportunity.  However, the live system and pro-back test treat this differently.  Here’s a  case, (AUD/USD 5 minutes) where this happened. (first attachment).  When I ran this in live against an IG spreadbetting account, the system behaved as I would expect, the system opened a position at 11:05 and closed it out at 15:40, I’ve attached the transaction history, and you can see that the sell order is opened but immediately nets out against the long position and both then close.

    However!  when I run a pro-back test over the same period, it not only closes the long position, but it also opens a new short position, giving entirely different results to the live situation.  I’ve attached the picture of the pro-back test, and also the detailed results.

    Am I being stupid, or is this actually an error in pro-back test.

    Any input very gratefully received.

    #33947
    Maz

    Hiya. Without seeing the indicator code I can’t help. But one or two things are springing to mind.

    1. Make the logic robust by testing if on market / if longOnMarket / if not shortOnMarkrt etc just to avoid any ambiguity. Explicitly say when it is and when it is not allowed to flip direction. Try elsif where appluckable
    2. Avoid call. Import your indicator to the system code.

     

    #33967

    Agree with Maz, you could also GRAPH Indicator1 in backtest to see how really the signals are read by your code.

    My first idea would be to completely include your indicator into your automatic strategy code and make new comparison.

    #33975

    thanks both.  I’ll try the ideas out.  much obliged for the input

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