Pathfinder Trading System
Forums › ProRealTime English forum › ProOrder support › Pathfinder Trading System
- This topic has 1,834 replies, 139 voices, and was last updated 1 year ago by CFD AutoTrading.
Tagged: Pathfinder
-
-
09/25/2016 at 5:57 PM #13717
The DOW result is impressive but there are also a couple of higher losses.
Pathfinder DOW V4
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167// Pathfinder Trading System based on ProRealTime 10.2// Breakout system triggered by previous daily, weekly and monthly high/low crossings with smart position management// Version 4// Instrument: DOW mini 4H, 8-22 CET, 2.8 points spread, account size 10.000 Euro// ProOrder code parameterDEFPARAM CUMULATEORDERS = true // cumulate orders if not turned offDEFPARAM PRELOADBARS = 10000// define intraday trading windowONCE startTime = 80000ONCE endTime = 220000// define instrument signalline with help of multiple smoothed averagesONCE periodFirstMA = 5ONCE periodSecondMA = 10ONCE periodThirdMA = 7// define filter parameterONCE periodLongMA = 300ONCE periodShortMA = 10// define position and money management parameterONCE positionSize = 1ONCE maxPositionSizeLong = 3ONCE maxPositionSizeShort = 3ONCE stopLossLong = 5.5 // in %ONCE stopLossShort = 1.75 // in %ONCE takeProfitLong = 2.75 // in %ONCE takeProfitShort = 1.75 // in %ONCE maxCandlesLongWithProfit = 17 // take long profit latest after 15 candlesONCE maxCandlesShortWithProfit = 13 // take short profit latest after 13 candlesONCE maxCandlesLongWithoutProfit = 40 // limit long loss latest after 30 candlesONCE maxCandlesShortWithoutProfit = 25 // limit short loss latest after 25 candles// define saisonal position multiplier >0 - long / <0 - shortONCE January = 2ONCE February = 3ONCE March = 2ONCE April = 2ONCE May = 2ONCE June = 2 // 3ONCE July = 2ONCE August = 2ONCE September = -2ONCE October = 3ONCE November = 2ONCE December = 2// calculate daily high/lowdailyHigh = DHigh(1)dailyLow = DLow(1)// calculate weekly high/lowIf DayOfWeek < DayOfWeek[1] thenweeklyHigh = Highest[BarIndex - lastWeekBarIndex](dailyHigh)lastWeekBarIndex = BarIndexENDIF// calculate monthly high/lowIf Month <> Month[1] thenmonthlyHigh = Highest[BarIndex - lastMonthBarIndex](dailyHigh)monthlyLow = Lowest[BarIndex - lastMonthBarIndex](dailyLow)lastMonthBarIndex = BarIndexENDIF// calculate instrument signalline with multiple smoothed averagesfirstMA = WilderAverage[periodFirstMA](close)secondMA = TimeSeriesAverage[periodSecondMA](firstMA)signalline = TimeSeriesAverage[periodThirdMA](secondMA)// trade only in defined trading windowIF Time >= startTime AND Time <= endTime THEN// filter criteria because not every breakout is profitablef1 = close > Average[periodLongMA](close)f2 = close < Average[periodLongMA](close)f3 = close > Average[periodShortMA](close)// saisonal patternIF CurrentMonth = 1 THENsaisonalPatternMultiplier = JanuaryELSIF CurrentMonth = 2 THENsaisonalPatternMultiplier = FebruaryELSIF CurrentMonth = 3 THENsaisonalPatternMultiplier = MarchELSIF CurrentMonth = 4 THENsaisonalPatternMultiplier = AprilELSIF CurrentMonth = 5 THENsaisonalPatternMultiplier = MayELSIF CurrentMonth = 6 THENsaisonalPatternMultiplier = JuneELSIF CurrentMonth = 7 THENsaisonalPatternMultiplier = JulyELSIF CurrentMonth = 8 THENsaisonalPatternMultiplier = AugustELSIF CurrentMonth = 9 THENsaisonalPatternMultiplier = SeptemberELSIF CurrentMonth = 10 THENsaisonalPatternMultiplier = OctoberELSIF CurrentMonth = 11 THENsaisonalPatternMultiplier = NovemberELSIF CurrentMonth = 12 THENsaisonalPatternMultiplier = DecemberENDIF// long position conditionsl1 = signalline CROSSES OVER monthlyHighl2 = signalline CROSSES OVER weeklyHighl3 = signalline CROSSES OVER dailyHighl4 = signalline CROSSES OVER monthlyLow// short position conditionss1 = signalline CROSSES UNDER monthlyHighs2 = signalline CROSSES UNDER dailyLow// long entryIF ( l1 OR l4 OR l2 OR (l3 AND f2) ) THEN // cumulate orders for long tradesIF saisonalPatternMultiplier > 0 THEN // check saisonal booster setup and max position sizeIF (COUNTOFPOSITION + (positionSize * saisonalPatternMultiplier)) <= maxPositionSizeLong THENBUY positionSize * saisonalPatternMultiplier CONTRACT AT MARKETENDIFELSIF saisonalPatternMultiplier <> 0 THENIF (COUNTOFPOSITION + positionSize) <= maxPositionSizeLong THENBUY positionSize CONTRACT AT MARKETENDIFENDIFstopLoss = stopLossLongtakeProfit = takeProfitLongENDIF// short entryIF NOT SHORTONMARKET AND ( (s1 AND f3) OR (s2 AND f1) ) THEN // no cumulation for short tradesIF saisonalPatternMultiplier < 0 THEN // check saisonal booster setup and max position sizeIF (COUNTOFPOSITION + (positionSize * ABS(saisonalPatternMultiplier))) <= maxPositionSizeShort THENSELLSHORT positionSize * ABS(saisonalPatternMultiplier) CONTRACT AT MARKETENDIFELSIF saisonalPatternMultiplier <> 0 THENIF (COUNTOFPOSITION + positionSize) <= maxPositionSizeLong THENSELLSHORT positionSize CONTRACT AT MARKETENDIFENDIFstopLoss = stopLossShorttakeProfit = takeProfitShortENDIF// stop and profit managementposProfit = (((close - positionprice) * pointvalue) * countofposition) / pipsizem1 = posProfit > 0 AND (BarIndex - TradeIndex) >= maxCandlesLongWithProfitm2 = posProfit > 0 AND (BarIndex - TradeIndex) >= maxCandlesShortWithProfitm3 = posProfit < 0 AND (BarIndex - TradeIndex) >= maxCandlesLongWithoutProfitm4 = posProfit < 0 AND (BarIndex - TradeIndex) >= maxCandlesShortWithoutProfitIF LONGONMARKET AND (m1 OR m3) THENSELL AT MARKETENDIFIF SHORTONMARKET AND (m2 OR m4) THENEXITSHORT AT MARKETENDIFSET STOP %LOSS stopLossSET TARGET %PROFIT takeProfitENDIF09/26/2016 at 8:39 AM #13730So a little play with V4 IN/OUT sample. Jan 2009 – March 2014.
Actually picks out first and third MA as 2…
Bit choppier than your version with MUCH more drawdown, overall result slightly better but prefer your version. I think it proves that your version is solid…?
1234567891011121314151617181920212223// define instrument signalline with help of multiple smoothed averagesONCE periodFirstMA = 2 //5ONCE periodSecondMA = 12 //10ONCE periodThirdMA = 2 //3// define filter parameterONCE periodLongMA = 280 //300ONCE periodShortMA = 45 //50// define position and money management parameterONCE positionSize = 1ONCE maxPositionSizeLong = 15ONCE maxPositionSizeShort = 10ONCE stopLossLong = 6.5 // in % 5.5ONCE stopLossShort = 2.75 // in % 3.5ONCE takeProfitLong = 3.25 // in % 2.75ONCE takeProfitShort = 1.5 // in % 1.75ONCE maxCandlesLongWithProfit = 18 // take long profit latest after 15 candlesONCE maxCandlesShortWithProfit = 10 // take short profit latest after 13 candlesONCE maxCandlesLongWithoutProfit = 32 // limit long loss latest after 30 candlesONCE maxCandlesShortWithoutProfit = 27 // limit short loss latest after 25 candles09/26/2016 at 9:55 AM #1374009/26/2016 at 12:25 PM #1374409/26/2016 at 3:26 PM #13751Miguel, You are right. In Pathfinder DOW V4 the new variables maxPositionSizeLong and maxPositionSizeShort have the wrong values (3) and limit the result. Please change the values to 15 and you will see a comparable V3 result. I have attached a comparison of V3 and V4. Sorry for the confusion.
09/26/2016 at 5:05 PM #13763Hi Reiner, DOW not looking so pretty before 2012.
If you want to ping me a message on email travel141 at gmail dot com I can give you skype details if you want to throw any code like this at the extended data I have if that would help?
09/27/2016 at 1:21 AM #13774Hi Reiner,
Great work!
I have been running v3 live since Sept 19 and it opened a long position on Sept 26 17 pm, but the backtest did not, unless I limit the starting date and time to Sept 19. Is there anything I should think about before starting v4?
Regards,
David
09/27/2016 at 2:12 AM #1377509/27/2016 at 6:45 AM #1378009/27/2016 at 7:41 AM #13782Hi Reiner,
I’ve been following your progress over the last few months and its been really impressive. I only put it on a live demo account in the last few weeks. How have things matched up in relation to the backtest and live testing/trading since you started.
I know you have talked about this in a previous post but I think this is the topic everyone is keen to find out about. Many of my simple strategies produce fine results on PRT but when it is a complex piece of coding it concerns me that the live results and backtest may be quite different.
Thanks for all your effort,
James
09/27/2016 at 9:39 AM #1378909/27/2016 at 12:48 PM #13802No worries.
IN/OUT optimise with 10 years of data. 2.8 Spread.
12345678910111213141516171819202122ONCE periodFirstMA = 7 //5ONCE periodSecondMA = 10 //10ONCE periodThirdMA = 6 //7// define filter parameterONCE periodLongMA = 315 //300ONCE periodShortMA = 3 //10// define position and money management parameterONCE positionSize = 1ONCE maxPositionSizeLong = 15ONCE maxPositionSizeShort = 15ONCE stopLossLong = 6.25 // in 5.5%ONCE stopLossShort = 2 // in 1.75%ONCE takeProfitLong = 3.25 // in 2.75%ONCE takeProfitShort = 1.75 // in 1.75%ONCE maxCandlesLongWithProfit = 20 // take long profit latest after 17 candlesONCE maxCandlesShortWithProfit = 11 // take short profit latest after 13 candlesONCE maxCandlesLongWithoutProfit = 41 // limit long loss latest after 40 candlesONCE maxCandlesShortWithoutProfit = 21 // limit short loss latest after 25 candles09/27/2016 at 1:16 PM #13805Miguel, I have tested your idea that Pathfinder avoid intraday reopen a position in the same direction. Please find attached the comparison of both backtests with DAX mini. Your idea is valueable!
Here is the code, changes are tagged with #Miguel:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177// Pathfinder Trading System based on ProRealTime 10.2// Breakout system triggered by previous daily, weekly and monthly high/low crossings with smart position management// Version 4 - avoid reopen of intraday positions in same direction (from Miguel)// Instrument: DAX mini 4H, 8-22 CET, 2 points spread, account size 10.000 Euro// ProOrder code parameterDEFPARAM CUMULATEORDERS = true // cumulate orders if not turned offDEFPARAM PRELOADBARS = 10000// define intraday trading windowONCE startTime = 80000ONCE endTime = 220000// define instrument signalline with help of multiple smoothed averagesONCE periodFirstMA = 5ONCE periodSecondMA = 10ONCE periodThirdMA = 3// define filter parameterONCE periodLongMA = 300ONCE periodShortMA = 50// define position and money management parameterONCE positionSize = 1ONCE maxPositionSizeLong = 15ONCE maxPositionSizeShort = 10ONCE stopLossLong = 5.5 // in %ONCE stopLossShort = 3.5 // in %ONCE takeProfitLong = 2.75 // in %ONCE takeProfitShort = 1.75 // in %ONCE maxCandlesLongWithProfit = 15 // take long profit latest after 15 candlesONCE maxCandlesShortWithProfit = 13 // take short profit latest after 13 candlesONCE maxCandlesLongWithoutProfit = 30 // limit long loss latest after 30 candlesONCE maxCandlesShortWithoutProfit = 25 // limit short loss latest after 25 candles// define saisonal position multiplier >0 - long / <0 - short / 0 no tradeONCE January = 2ONCE February = 2ONCE March = 2ONCE April = 3ONCE May = 2ONCE June = 2ONCE July = 3ONCE August = -1ONCE September = -2ONCE October = 1ONCE November = 3ONCE December = 3// calculate daily high/lowdailyHigh = DHigh(1)dailyLow = DLow(1)// calculate weekly high/lowIf DayOfWeek < DayOfWeek[1] thenweeklyHigh = Highest[BarIndex - lastWeekBarIndex](dailyHigh)lastWeekBarIndex = BarIndexENDIF// calculate monthly high/lowIf Month <> Month[1] thenmonthlyHigh = Highest[BarIndex - lastMonthBarIndex](dailyHigh)monthlyLow = Lowest[BarIndex - lastMonthBarIndex](dailyLow)lastMonthBarIndex = BarIndexENDIF// calculate instrument signalline with multiple smoothed averagesfirstMA = WilderAverage[periodFirstMA](close)secondMA = TimeSeriesAverage[periodSecondMA](firstMA)signalline = TimeSeriesAverage[periodThirdMA](secondMA)// save position before trading window is open #MiguelIf Time < startTime thenstartPositionLong = COUNTOFLONGSHARESstartPositionShort = COUNTOFSHORTSHARESEndIF// trade only in defined trading windowIF Time >= startTime AND Time <= endTime THEN// filter criteria because not every breakout is profitablef1 = close > Average[periodLongMA](close)f2 = close < Average[periodLongMA](close)f3 = close > Average[periodShortMA](close)// reduced position? #MiguelreduceLongInTradingWindow = COUNTOFLONGSHARES < startPositionLongreduceShortInTradingWindow = COUNTOFSHORTSHARES < startPositionShort// saisonal patternIF CurrentMonth = 1 THENsaisonalPatternMultiplier = JanuaryELSIF CurrentMonth = 2 THENsaisonalPatternMultiplier = FebruaryELSIF CurrentMonth = 3 THENsaisonalPatternMultiplier = MarchELSIF CurrentMonth = 4 THENsaisonalPatternMultiplier = AprilELSIF CurrentMonth = 5 THENsaisonalPatternMultiplier = MayELSIF CurrentMonth = 6 THENsaisonalPatternMultiplier = JuneELSIF CurrentMonth = 7 THENsaisonalPatternMultiplier = JulyELSIF CurrentMonth = 8 THENsaisonalPatternMultiplier = AugustELSIF CurrentMonth = 9 THENsaisonalPatternMultiplier = SeptemberELSIF CurrentMonth = 10 THENsaisonalPatternMultiplier = OctoberELSIF CurrentMonth = 11 THENsaisonalPatternMultiplier = NovemberELSIF CurrentMonth = 12 THENsaisonalPatternMultiplier = DecemberENDIF// long position conditionsl1 = signalline CROSSES OVER monthlyHighl2 = signalline CROSSES OVER weeklyHighl3 = signalline CROSSES OVER dailyHighl4 = signalline CROSSES OVER monthlyLow// short position conditionss1 = signalline CROSSES UNDER monthlyHighs2 = signalline CROSSES UNDER dailyLow// long entryIF ( (l1 OR l4 OR l2 OR (l3 AND f2)) AND not reduceLongInTradingWindow ) THEN // cumulate orders for long trades #MiguelIF saisonalPatternMultiplier > 0 THEN // check saisonal booster setup and max position sizeIF (COUNTOFPOSITION + (positionSize * saisonalPatternMultiplier)) <= maxPositionSizeLong THENBUY positionSize * saisonalPatternMultiplier CONTRACT AT MARKETENDIFELSIF saisonalPatternMultiplier <> 0 THENIF (COUNTOFPOSITION + positionSize) <= maxPositionSizeLong THENBUY positionSize CONTRACT AT MARKETENDIFENDIFstopLoss = stopLossLongtakeProfit = takeProfitLongENDIF// short entryIF NOT SHORTONMARKET AND ( (s1 AND f3) OR (s2 AND f1) ) AND not reduceShortInTradingWindow THEN // no cumulation for short trades #MiguelIF saisonalPatternMultiplier < 0 THEN // check saisonal booster setup and max position sizeIF (COUNTOFPOSITION + (positionSize * ABS(saisonalPatternMultiplier))) <= maxPositionSizeShort THENSELLSHORT positionSize * ABS(saisonalPatternMultiplier) CONTRACT AT MARKETENDIFELSIF saisonalPatternMultiplier <> 0 THENIF (COUNTOFPOSITION + positionSize) <= maxPositionSizeLong THENSELLSHORT positionSize CONTRACT AT MARKETENDIFENDIFstopLoss = stopLossShorttakeProfit = takeProfitShortENDIF// stop and profit managementposProfit = (((close - positionprice) * pointvalue) * countofposition) / pipsizem1 = posProfit > 0 AND (BarIndex - TradeIndex) >= maxCandlesLongWithProfitm2 = posProfit > 0 AND (BarIndex - TradeIndex) >= maxCandlesShortWithProfitm3 = posProfit < 0 AND (BarIndex - TradeIndex) >= maxCandlesLongWithoutProfitm4 = posProfit < 0 AND (BarIndex - TradeIndex) >= maxCandlesShortWithoutProfitIF LONGONMARKET AND (m1 OR m3) THENSELL AT MARKETENDIFIF SHORTONMARKET AND (m2 OR m4) THENEXITSHORT AT MARKETENDIFSET STOP %LOSS stopLossSET TARGET %PROFIT takeProfitENDIF09/27/2016 at 2:55 PM #13811Hi James,
Pathfinder is a completely transparent project from the first idea up to the current state every step is documented here in the forum. The backtest with the DAX seems to be realible over the last years but to be honest I have no idea whether such a system realy works under real condition. From mid of July until now I traded several versions V2, V3 and now V4 but not continously and the return is more or less zero. An automatic trading system needs volatility and a trend to make money and over the last month DAX was a “lame duck”. It requires hundreds of trades to realy judge a system and requires a lot of patience. In a 4H timeframe it will take a time (months).
I’m not a professional trader and I’m far away to be a professional trading system developer so every idea, reniew and improvement from the real pros are welcome.best Regards,Reiner1 user thanked author for this post.
09/27/2016 at 6:45 PM #13817 -
AuthorPosts
Find exclusive trading pro-tools on