Problem with duplicate figures for symultaneous trades

Forums ProRealTime English forum ProRealTime platform support Problem with duplicate figures for symultaneous trades

Viewing 14 posts - 1 through 14 (of 14 total)
  • #241092

    Hello everyone, I have a simple problem and I hope someone here may be able to help me. When I write out a list of simple entry and exit commands PRT’s ‘detailed report’ within its backtest does not like 2 trades being held simultaneously. The overall loss is correct in this example, its just when two trades are on at the same time, you can see it duplicates entry dates and it simply halves the overall realised figure between the simultaneous trades within the closed positions list.

    For example the trades listed 2 dec are actually placed at different times, so the realised figures should be different, prt has simply totalled it up and halved it. Another example dated 25.11.24 shows two trades which list different losses as there entrys are different, however again prt backtest lumps them together as they were on at the same time. The other examples are a loss and a win, but im sure you get the idea. It also simply duplicates dates I note even if they were placed on different dates. I hope someone can help.

     

    Heres the code;

     

     

    #241106

    Hi there Bill,

    This will be the same issue as this thread talks about (or runs into after a couple of posts) : https://www.prorealcode.com/topic/no-or-incorrect-display-of-drawdown-in-v12/

    People still report this once in a while, and now you. So this is apparently still not solved.
    After reading into that thread, it would be good if you send it as a Technical Report (via Help in the main menu), so that the developers have more data points.

    Best regards,
    Peter

     

    2 users thanked author for this post.
    #241143

    Thankyou for replying so promtly Peter that is great and appreciated. Ive looked through it’s quite a long chain, I cant seem to find anything specific on this other than overall annoyance at tech issues with the backtest feature. Ill take it as this is a technical issue that is unresovled at PRT and theres nothing I can do to amend my code? If you can confirm that that would be great. I will take your advice and forward this issue to them. It seems strange that somethign so fundamentel is overlooked by them, is the backtest particularly new or something.

    #241168

    What I suggested myself in that thread, is that you can put an end date/time in the backtest so you’d force the Detailed Report not to do a final recalculation for the current moment (which would incur for the double trades, as I see it). That end date/time can just be from an hour or so ago. For me this works, I hope for you too.

    #241176

    BillTarrej if you close the Detailed Report and open it again … do the figures then show as correct?

    #241215

    Thanks for reply, no unfortunately same effect if I open close and run script again. Lists as duplicate trades, divides final figures of symaltaneuos trades.

    #241216

    Thankyou for the response, I gave this a try same effect. Its not happy with this either.

    #241217

    Check your Orders List also, see attached …

    1.  Image1 Closed Positions List – yellow squiggle looks like duplicates for 19 Nov 24?
    2. Image2 Orders List – yellow squiggle shows 2 separate buys at different times for 19 Nov 24.

    Does above help?

    #241228
    JS

    Hi,

    Are you looking for this kind of report?

     

    #241233

    BillTarrej problem is that …

    1.   The Orders List shows 2 entries at 2 different times.
    2.   Closed Positions List shows the above 2 entries both at the same identical entry time (also both trades exit at the same time, so they look like duplicated trades in the Closed Position List)

    You can see above in the screenshots I posted as I ran BillTarrej code on my Platform.

    #241234
    JS

    That’s correct, I noticed that too, but isn’t that solved in ‘my’ reports…?

    #241235

    It appears so, but what does Bill need to do to achieve same as you show?

    #241237
    JS

    “The ‘problem’ is that Bill opens an order while the other order is still active, resulting in cumulative orders. You know how PRT handles this: the purchase prices are averaged, and when this cumulative position is closed, the profits are evenly distributed…
    Technically, the report isn’t incorrect, but it differs due to the cumulative positions…
    If you want to handle the orders separately, you need to use:
    DefParam CumulateOrders = False”

    1 user thanked author for this post.
    #241250

    On first impressions, this was perfect and listed the trades individually so no cumultative total, however the issue is that it doesnt allow for all symaltaneous orders to go through. Your getting the first one and then it doesnt allow for the second, etc if the first is still open. Thanks a lot for your help so far

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

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