End of Day PRT closes trades on last bar.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #75348 quote
    Vonasi
    Moderator
    Master

    I’m testing out the new MTF on an end of day PRT account but I noticed that no matter what I did the last quarters results were terrible so I looked closer at the chart. On the last bar of the chart all trades are closed for no reason. The strategy is also trying a partial closure idea but even without this all trades are closed on the last bar.

    The criteria for closing positions is as follows:

    count = 0
    for z = 1 to countofposition
    if  onmarket and close > highest[z](high[1]) then
    count = z
    endif
    next
    
    sell count contracts at market

    and the last bar does not meet this criteria. The graph below the equity curve shows the value of count and it can also clearly be seen that the close of the second to last bar is not higher than the preceding highs.

    [attachment file=75349]

    Why does it close all the trades?

    Screenshot_7.png Screenshot_7.png
    #75352 quote
    Nicolas
    Keymaster
    Master

    Yes, it acts like this if you have not subscribed to real time data (intraday). Otherwise, you’ll be able to follow an automated strategy on your screen without paying any fee for the data.

    Vonasi and robertogozzi thanked this post
    #75360 quote
    Vonasi
    Moderator
    Master

    Thanks for clearing that up although it does then also mean that any meaningful back-testing is not possible. If you happen to be holding a large position on the last candle then the results will look terrible as you will suddenly have a big loser in the results whereas if you had no positions on the last candle then you get accurate results. This means that optimizing any variables to any accuracy is impossible.

    #75368 quote
    Nicolas
    Keymaster
    Master

    Don’t include the current day in your backtest period to see what happens.

    #75371 quote
    Vonasi
    Moderator
    Master

    Don’t include the current day in your backtest period to see what happens.

    That was my first thought and so I put the code within this condition:

    if opendate <> 20180705 then
    (my strategy)
    endif

    …but it crashes out and asks me to send a report. I then noticed that the last candle on the chart is in fact 20180703. I changed the date but it was the same result.

    #75376 quote
    Nicolas
    Keymaster
    Master

    I’m talking about this setting in ProBacktest:

    [attachment file=”backtest ending date.png”]

    backtest-ending-date.png backtest-ending-date.png
    #75381 quote
    Vonasi
    Moderator
    Master

    I’m talking about this setting in ProBacktest:

    Far too obvious and simple – but unfortunately it does not fix the problem – it just closes all trades a day earlier!

    #75389 quote
    Nicolas
    Keymaster
    Master

    Ok, I know we discussed that before somewhere in the forums, but it was a long time ago.. and maybe in French.. I’ll try to dig into the forums tomorrow.

    #75391 quote
    Vonasi
    Moderator
    Master

    Don’t waste too much time on it – it was just something that I observed that I thought was a bit odd.

    Using the end of day platform for MFT testing is more like a taster menu rather than a proper restaurant meal. Hopefully we will have the Michelin starred restaurant soon!

    I think most people will wait for it to become available on the proper PRT demo platform before getting properly involved in testing and coding with it. Today has been fun but also slightly frustrating due to the limitations of end of day testing.

    #75442 quote
    Nicolas
    Keymaster
    Master

    Do you have real time Forex feed? on your EOD account?

    #75469 quote
    Vonasi
    Moderator
    Master

    Do you have real time Forex feed? on your EOD account?

    No I don’t think so – I assume that is a pay option and I just wanted to try out MTF with no costs!

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

End of Day PRT closes trades on last bar.


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Vonasi @vonasi Moderator
Summary

This topic contains 10 replies,
has 2 voices, and was last updated by Vonasi
7 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/05/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...