Pathfinder Trading System

Forums ProRealTime English forum ProOrder support Pathfinder Trading System

Tagged: 

Viewing 15 posts - 1,546 through 1,560 (of 1,835 total)
  • #58566

    The sell of the 9 positions are now in BT.

    Mine bought the 2nd. long. Probably messed up when i stopped it. I assume you do not have any longs now with the Dax 1H V8 David?

    #58567

    @Patrick correct. All quiet now.

    #58576

    It looks like there is an issue with the trendmultiplier. It is not working properly or not at all. If you change that to 1 in the code it is shut off and the trades look more or less what has happened in live trading. But with the multiplier to 1 it is still in postion. As attached:

    So you think that the trend multiplier is not working in live but is working in demo if I understand right.

     

    #58577

    Yes you understand it right.

    If you set it to 1 the trades of yesterday and today of the BT and live are in line.

    #58583

    Oh dear…. it seems we have another case of backtest not matching reality. Is reality more profitable though – if so that could be a PRT first!

    This backtest of v8 can never match reality completely. The first reason is that the spread is set to 2 points, which is incorrect for most of the day, and the second reason is that there is no correction for slippage.

    Look at the exit of today’s 8 contracts : They were closed at 9:00 due to line 297 in the code, because posprofit (defined in line 287) was positive at this time and the maximum number of candles with profit exceeded (lines 51, 290 and 296).

    When the spread is set to 2, posprofit at 9:00 according to the backtest was only 10,60 € for all 8 contracts. Now imagine, that due to slippage (entry prices a little worse than in the backtest), posprofit in reality may have been slightly negative, say for example, -1,30 €. Could have well occured and would have prevented the closure of the 8 contracts at 9:00, because maxCandlesLongWithoutProfit = 75.

    When you want backtest results to match reality almost completely, you need to build in a correction for this and other types of slippage in the code. The backtest calculates with the candles’ close or open +- spread as entry and exit prices, and there must be a correction so that the live trading system does this too. Normally, a live trading system calculates with the actual entry or exit prices (not close and open) and they may be slightly different from the candles because of slippage.

    Also, the spread should be adjusted to the actual values at different times of the day in the code, when you want a better match between backtest and reality.

    3 users thanked author for this post.
    #58585

    @verdi55,

    The spread is set to 2 is actually more than it is. From 09.00 to 17.30 it is 1 and after that it is 2 until 22.00 hours.

    According to the code Dax 1H V8 is trading between 09.00 and 22.00 hours.

    kind regards,

     

    #58586

    Very good analysis Verdi55.

    Do you have an example of code that you add to your strategies to adjust the spread throughout the day and on different days of the weeks? It shouldn’t be too hard to write but if someone else has done and was willing to share it it could give us all a few hours ofour lives back to do something else.

    Even if the spread settings do not exactly match the live market closer it better than nothing at all for improved accuracy.

    On a separate note – I’m not keen on strategies that exit after a certain number of bars if in profit or otherwise. There is a huge potential for curve fitting with ideas like that. For the same reason I hate strategies that sell up everything and go flat at certain times. If you are in a trade either stick with it or get out if it is going wrong – not just because a certain time has arrived.

    #58588

    On a separate note – I’m not keen on strategies that exit after a certain number of bars if in profit or otherwise. There is a huge potential for curve fitting with ideas like that. For the same reason I hate strategies that sell up everything and go flat at certain times. If you are in a trade either stick with it or get out if it is going wrong – not just because a certain time has arrived.

    Absolutely. A fixed time generates just a perfect fit for the backtest. I take supertrend cuts, for example, as exit signals. Then a sideward movement may run as long as wants to.

    I will see what I have in my code drawer as slippage correction.

    #58589

    And DAX 1h v8 is running 2 long positions.

    1 user thanked author for this post.
    #58591

    @verdi55, The spread is set to 2 is actually more than it is. From 09.00 to 17.30 it is 1 and after that it is 2 until 22.00 hours. According to the code Dax 1H V8 is trading between 09.00 and 22.00 hours. kind regards,

    But that is the problem. A wide spread will stop us repeatedly tripping into buy and sells whereas a narrow spread will trigger events more often. So a backtest on a fixed 2 pip spread will perform very differently to a live run on varying spread. This does not explain why PRTdemo live is different to PRTcomplete live as surely both use the same live data feed? Or do they?

    A good exercise is to put the Bid Ask Colour Band indicator onto a short time frame graph and just watch how much the spread changes over a time period to see how spread can change from second to second.

    #58592

    Guys, my demo closed the long, but the real one no.

    #58598

    @Vonasi,

    Yes that is true that if you put the band on the screen you see it change from second to second. But it is not always in your disadvantage. I sometimes even see for moments no spread at all.

    But the discussion was not that we had differences in the slippage and spreads, but differences in times when V8 went long and with how many positions. That showed a discrepancy caused by

    the trendmultiplier from my point of view.

    #58599

    for me the trend multiplier is working right on real and not on demo

    #58600

    @Gianluca Albino,

    Is yours set to 2 and did your V8 bought yesterday 3 times 2 positions and sold them this morning at 09.00 O ‘clock in live trading?

    #58606

    Do you have an example of code that you add to your strategies to adjust the spread throughout the day and on different days of the weeks?

    Here is a little code for correction of spread and slippage issues :

    I add this code at the top of a trading system, before all buy or sellshort orders occur. Then, I calculate the return of a position not with positionprice or positionperf, but with posopen, which is the theoretical positionprice from the backtest.

    0.5 is half of the normal DAX spread from 9:00-17:30 h, and it should be set to different values at different times of the day. 0.5 points from 9:00-17:30, 2.5 points overnight, 1 point for the rest.

    When you calculate the theoretical backtest return of a position, you need to add the real spread to the “close” values, too.

    Return of a long position from 9:00-17:30 is then :

    (close – 0.5) – posopen,

    not “pprice * positionperf”

    So when you say : “close a position when its return exceeds or falls below a certain value at the end of a bar”, backtest and reality will match more frequently when you apply this correction.

    Keep in mind that anything that can cause differences between reality and backtest due to spread and slippage (for example the total return “strategyprofit”) may make the real system behave differently than the backtest. So you may want to include this correction for all commands that refer to actual entry and exit prices and to the return of a position or strategy. This may be quite some work.

     

    1 user thanked author for this post.
Viewing 15 posts - 1,546 through 1,560 (of 1,835 total)

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