PRT Premium backtests not working with stop
Forums › ProRealTime English forum › ProOrder support › PRT Premium backtests not working with stop
- This topic has 22 replies, 4 voices, and was last updated 4 years ago by GraHal.
-
-
06/01/2020 at 1:22 AM #133996Exit code123456789101112131415161718192021222324252627282930313233343536////////////////////////////////////////////////////////////////////////////////////////////////////////////timeframe(30minutes, updateonclose)ONCE TrailStart = varts //30 Start trailing profits from this pointONCE ProfitPerCent = varpct //66.6% Profit to keepONCE TrailStart2 = varts2 //30 Start trailing profits from this pointONCE ProfitPerCent2 = varpct2 //66.6% Profit to keepIF Not OnMarket THENy1 = 0ELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN //LONGx1 = (close - tradeprice) / pipsize //convert price to pipsIF x1 >= TrailStart THEN //go ahead only if 30+ pipsy1 = max(x1 * ProfitPerCent, y1) //y = % of max profitENDIFIF y1 THEN //Place pending STOP order when y>0SELL AT Tradeprice + (y1 * pipsize) STOP //convert pips to priceENDIFELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN //LONGx1 = (close - tradeprice) / pipsize //convert price to pipsIF x1 >= TrailStart2 THEN //go ahead only if 30+ pipsy1 = max(x1 * ProfitPerCent2, y1) //y = % of max profitENDIFIF y1 THEN //Place pending STOP order when y>0SELL AT Tradeprice + (y1 * pipsize) STOP //convert pips to priceENDIFendifif onmarket thenif (CurrentDayOfWeek=5 and time>=closetimefriday) thensell at marketexitshort at marketendifendifSET STOP %LOSS vsl // Not used because the Flip Stop is lower, just in case.SET TARGET %PROFIT 3.8
Hi
I have purchased access to PRT11 Premium so that I can perform longer back tests, for spot Forex this involves allocating a lot size.
I have found that systems using stops that are just values are fine with the results matching those of IG.com with PRT V10.3 but the attached stop produces completely different exit results. I’m guessing it may be to do with the lot size but I need help from a greater mind as I am stuck
Thanks
Ruark
06/01/2020 at 10:05 AM #134025Sorry I don’t understand what is the problem? At first read, the code seems ok to me, you are updating your pending STOP order to close long orders once each 30-minutes. Did you graph the pending stop levels you are calculating, are they correctly calculated?
06/01/2020 at 10:46 AM #134036Hi Nicolas
it seems okay today, it must have been pilot error last night when I first got the platform, apologies
thanks for taking the time to have a look
06/01/2020 at 8:55 PM #134102Hi @Nicolas
I have done some further testing this time using the spot Dax in PRT linked to IG.com and in Prorealtime Premium with the German Indicies licenced. I thought this would be a way to check that it was not the lot valuers that were throwing things out.
As you can see in the attached screens the same code produces drastically different results
My hope was to back test systems on PRT premium using their advanced tools to execute on IG.com PRT 10.3, is this going to be possible? I don’t know if IG’s altering of spreads means that you can only create reliable systems to trade on IG.com when linked to their data or if there is something that I have not done correctly in PRT premium
Thanks
Ruark
06/02/2020 at 12:19 PM #13419806/02/2020 at 1:04 PM #134212Hi Nicolas
Did I pick the wrong product or is the spot IG price unique to them so I cant’t use Prorealtime premium for backtesting?
Thanks
Ruark
06/02/2020 at 2:56 PM #13422206/02/2020 at 3:04 PM #134226Thanks Nicolas
06/02/2020 at 5:03 PM #13425206/02/2020 at 5:11 PM #134255Yes of course, so I don’t understand what you mean GraHal? By accepting to trade derivatives assets like CFD, you already agreed to use not real market instruments and trading “against” the broker. Just compare 2 CFDs brokers on any instrument and you’ll not get the exact same OHLC values, therefore the subject to over optimization to a specific data serie (broker X) is a concern, what would be the result on broker Y?
06/03/2020 at 8:25 PM #134469the same code produces drastically different results
Did you come to any conclusion what was the main / prime reason for the difference in results between broker x and broker y?
Did anyone one factor stand out / leap out at you?
I just noticed though that the 2 bots do not even have the same name / title … were you testing the same bot on each set of data?
Or am I reading it all wrong??
06/03/2020 at 9:27 PM #134475I couldn’t import the bot, it just gave a blank error message so I had just pasted it into a new strategy and just put a quick name in for the test
I noticed that the colours for the time period were different, the time period colours were consistent between codes within the IG PRT so I don’t know if that is a clue or if they are just random
I have attached an image with the entry code deleted to show this with PRT Premium on the left where the 2 hour timeframe is green but in IG PRT the 2 Hour is browny yet both the 30 minute codings had the same brown
The code and variables are exactly the same, the time period was greater in PRT Premium but it opened far less positions than IG and the positions don’t seem to have any correlation
Is there anything in the colour change?
If not I suppose the thing to do would be to look at the parameters and add them as indicators on the PRT Premium and see if they get close to matching up with IG, there may be some constant that could be used to align the results
06/03/2020 at 10:01 PM #134485I have had a look and the spot in PRT Premium and IG are two different products
You can see the prices are different, the PRT Premium data gaps a lot and using stochastics as an example the indicators that are used for triggers are therefore different when calculated
I have contacted PRT to see about using Premium on IG data but I will probably have to wait for IG to take version 11 in order to perform longer back tests and use the cool V11 features
06/03/2020 at 10:15 PM #134488the time period was greater in PRT Premium
PRT IG was 17 May 18 to 1 Jun 20 and PRT Premium was 17 may 18 to 29 may 20?
is there anything in the colour change?
I would think the techie who set up the colours just didn’t think to align the colours (although that would have made far more sense) between IG PRT and PRT Premium.
If not I suppose the thing to do would be to look at the parameters and add them as indicators on the PRT Premium and see if they get close to matching up with IG, there may be some constant that could be used to align the results
Probably a frustrating exercise to do above, so I doubt we will ever know?
If the difference had been 1 or 2 trades then we would not be having this discussion, but 19 trades on IG PRT and 6 trades on PRT Premium is too big a difference to be due to OHLC values being slightly different between broker x data and broker y data.
But then it’s not broker x and broker y data anyway … it’s IG PRT and PRT Premium … both running on broker x data??
06/04/2020 at 8:09 AM #134515Is there anything in the colour change?
No, they are random. Copy/Paste your code multiple times and you’ll see by yourself 😉
I have had a look and the spot in PRT Premium and IG are two different products
https://www.prorealcode.com/topic/prt-premium-backtests-not-working-with-stop/#post-134222
-
AuthorPosts
Find exclusive trading pro-tools on