PRT Premium backtests not working with stop

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #133996 quote
    deletedaccount100622
    Participant
    New
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////
    timeframe(30minutes, updateonclose)
    ONCE TrailStart    = varts        //30     Start trailing profits from this point
    ONCE ProfitPerCent = varpct    //66.6%  Profit to keep
    ONCE TrailStart2    = varts2        //30     Start trailing profits from this point
    ONCE ProfitPerCent2 = varpct2    //66.6%  Profit to keep
    IF Not OnMarket THEN
    y1 = 0
    
    ELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN                         //LONG
    x1 = (close - tradeprice) / pipsize           //convert price to pips
    IF x1 >= TrailStart THEN                      //go ahead only if 30+ pips
    y1 = max(x1 * ProfitPerCent, y1)           //y = % of max profit
    ENDIF
    IF y1 THEN                                       //Place pending STOP order when y>0
    SELL AT Tradeprice + (y1 * pipsize) STOP      //convert pips to price
    ENDIF
    ELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN                         //LONG
    x1 = (close - tradeprice) / pipsize           //convert price to pips
    IF x1 >= TrailStart2 THEN                      //go ahead only if 30+ pips
    y1 = max(x1 * ProfitPerCent2, y1)           //y = % of max profit
    ENDIF
    IF y1 THEN                                       //Place pending STOP order when y>0
    SELL AT Tradeprice + (y1 * pipsize) STOP      //convert pips to price
    ENDIF
    endif
    
    if onmarket then
    if (CurrentDayOfWeek=5 and time>=closetimefriday) then
    sell at market
    exitshort at market
    endif
    endif
    
    SET 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

    #134025 quote
    Nicolas
    Keymaster
    Master

    Sorry 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?

    #134036 quote
    deletedaccount100622
    Participant
    New

    Hi 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

    #134102 quote
    deletedaccount100622
    Participant
    New

    Hi @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

    Comparitive-Graphs.png Comparitive-Graphs.png Comparitive-Reports.png Comparitive-Reports.png
    #134198 quote
    Nicolas
    Keymaster
    Master

    Sorry, but you should not compare 2 different instruments to get the same exact results!

    #134212 quote
    deletedaccount100622
    Participant
    New

    Hi 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

    #134222 quote
    Nicolas
    Keymaster
    Master

    CFD are contracts created by the broker, so the OHLC values are indeed not the same as the ones from real market.

    thanked this post
    #134226 quote
    deletedaccount100622
    Participant
    New

    Thanks Nicolas

    #134252 quote
    GraHal
    Participant
    Master

    Do we not expect IG CFD to be the same as the underlying except for spread differences and slippage due to speed of execution etc.

    There should not be wide differences else what is to stop IG manipulating prices etc??

    #134255 quote
    Nicolas
    Keymaster
    Master

    Yes 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?

    #134469 quote
    GraHal
    Participant
    Master

    the 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??

    #134475 quote
    deletedaccount100622
    Participant
    New

    I 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

    colour-query.png colour-query.png IG.png IG.png prt.png prt.png
    #134485 quote
    deletedaccount100622
    Participant
    New

    I 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

    products.png products.png
    #134488 quote
    GraHal
    Participant
    Master

    the 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??

    #134515 quote
    Nicolas
    Keymaster
    Master

    Is 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

    PRT Premium backtests not working with stop

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

PRT Premium backtests not working with stop


ProOrder: Automated Strategies & Backtesting

New Reply
Summary

This topic contains 22 replies,
has 4 voices, and was last updated by GraHal
5 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/01/2020
Status: Active
Attachments: 7 files
Logo Logo
Loading...