Backtesting on 2 minutes – how to get more data?
Forums › ProRealTime English forum › ProOrder support › Backtesting on 2 minutes – how to get more data?
- This topic has 8 replies, 3 voices, and was last updated 5 years ago by David Hall.
-
-
02/16/2019 at 7:19 AM #91502
Hello I am trying to backtest a 2 min strategy how can I get data from further back in time than the period shown on the screen,
Thanks
Dave Hall
02/16/2019 at 7:56 AM #91504Please update your country flag. Thank you.You can change dates as from attached pic.
02/16/2019 at 9:09 AM #91507If you want to go back beyond the 100k or 200k bars (the amount depends on your PRT platform type) then you can’t. You get the most recent 100k or 200k bars whether that is 100k times 2 minute candles or 100k times 1 day candles.
02/16/2019 at 10:15 AM #91508Thanks the trouble is using a 2min time frame it only lets me go back to 10th Jan even with 10,000 bars selected
02/16/2019 at 10:17 AM #91509Thanks that ‘s a bit of a shame as with 2min strategy I can’t get much meaningful data, I can get back as far as August 1 2018 but thats it
02/16/2019 at 11:08 AM #91514Unfortunately this is one of the disadvantages of back testing on faster time frames – the history available is very limited. All you can really do is create a strategy based on the data available and then forward test it by running it live in demo. Not ideal and a very slow way of testing but it is the only way unfortunately. The good news is that if it is curve fitted to the data sample you used then on a fast time frame it shouldn’t be too long before forward testing confirms this especially if it opens a lot of trades. You may have to include emergency get out of the market conditions in case of black swan moments that your back test was never developed on but that it might have to trade through one day in the future.
Note: I changed your topic title to something a little more meaningful.
1 user thanked author for this post.
02/16/2019 at 11:15 AM #91515Sorry one last question if I want to set trading hours ie between 19:00 – 21:00 uk time is this possible to add to my code?
02/16/2019 at 11:26 AM #91516Yes you can use the following:
12Defparam FlatBefore = 190000Defparam FlatAfter = 210000These will not allow trading before 190000 and close all trades at 210000 and not allow any trades after that time.
Alternatively you can just set a condition to allow or disallow trading:
12345Timeok = time >= 190000 and time < 210000if Timeok and (your conditions) thenbuy 1 contract at marketendifMost answers to coding questions and examples can be found here:
02/16/2019 at 12:26 PM #91519That,s great thanks very much
-
AuthorPosts
Find exclusive trading pro-tools on