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
-
-
12/27/2016 at 10:29 AM #1915012/27/2016 at 11:00 AM #19158
Hi Alco,
There are two easy approaches to estimate the required Pathfinder account size.
- multiply the maximum drawdown with 2 (or 3) and add the margin for the maximum position size or
- multiply the maximum position size with 1k.
With 10k and three running Pathfinder algos you have to reduce the position size. The default parameter settings for each Pathfinder version is for an 10k account.
Best, Reiner
12/27/2016 at 11:26 AM #19160Hi Pranik,
Thanks for your idea. In my opinion weekly low is a weak condition and doesn’t produce high quality signals. I have extended Pathfinder DAX 4H V6 with the weekly low setup and the result is worse especially the drawdown (double). Please find attached a comparison of original V6 and V6 adopt with weekly low setup.
Best, Reiner
1 user thanked author for this post.
12/27/2016 at 11:40 AM #19163Hi CKW,
I never had this error message and unfortunately I have no clue what is the reason. I suppose it has something todo with the preload bars settings. Try to reduce the default setting.
1DEFPARAM PRELOADBARS = 10000Maybe someone else can advise.
Best, Reiner
12/27/2016 at 11:52 AM #19164Hi Reddi and welcome,
In my experience with 5M timeframe the Pathfinder breakout algo has to many fake breakouts. Higher timeframes are working like filter and increase the quality of the trade signals. I will focus with Pathfinder on the daily timeframe for the swing trades and on 4H and 1H for the intraday trades.
I encourage you hereby to verify if Pathfinder works in 5M or 15M. Let me know when you find a profitable approach.
Best, Reiner
12/27/2016 at 12:14 PM #19171Hallo Pfeiler,
I just rework all the Pathfinder daily backtests and will publish all saisonal adjustments soon. NG and KC is already finished.
Thanks for your hint with the @Day-function. I have changed the code accordingly.
KC has a drawdown of 36% and doesn’t fulfill my quality Pathfinder requirements but is on the other side one of the profitable versions. I let it in the top list because of the drawdown was 1972.
Best, Reiner
12/27/2016 at 3:17 PM #19180Hi Reiner,
Thank you for sharing your code and the time you put into this. Can see a lot more members are getting on board and have different request which is great but getting a bit long and confusing. Perhaps can open individual forum for each indices/commodities (even forex), making it easier to follow the indices/commodities you are interested in trading now or maybe in the future, and for new members to pick up too.
Best regards,
Sylvester
12/27/2016 at 4:58 PM #19182Hey Reiner,
I am sure you are aware of this, but in the Excel I saw that there are big differences between the available history of the instruments. You mentioned that your ranking is based partially on the total performance. But if you look at the average annual performance you see that for example hangseng has a annual performance of 39% (based on the last 10 years) and coffee is 16.5 % (in 39 years).
Just as an idea for another performance criteria.
I am looking forward to see the rest of the systems. I will try to check how consistant the annual performance for the instruments is by calculate it for the single years.
mfg
flo
1 user thanked author for this post.
12/27/2016 at 7:40 PM #19185Dear Reiner. During the test of a more conservative management code, where I still add more position accordingly to the equity size I came across a small issue I could not explain. To simplify things the same issue is confirmed if I just adjust the max positionsize for 3 instead of 15 in the DAX V6. The issue is that the conservative closed the 2 position today at 9:01 and the original are still going with 4 position. Both codes started at 21 Dec. 9:00 with 2 positions. later the original added 2 pos at 23 Dec 9:00. I backtested manually both code and I can see the issue is ongoing- but not every time. I could understand if the original V6 DAX closed 2 of the 4 position today at 9:00 it would result in closing of all the 2 position today, but that’s not the case. Do you have any Idea of why this is happening? Maybe you could explain the exit strategy in details, or just say if you already have, I will find it 🙂
This is the changed lines
12maxPositionSizeLong = MAX(3, abs(round(maxRisk / (close * stopLossLong / 100) / PointValue) * pipsize))maxPositionSizeShort = MAX(3, abs(round(maxRisk / (close * stopLossShort / 100) / PointValue) * pipsize))Cheers Kasper
12/27/2016 at 8:01 PM #19186Update. I think I know why. when looking at the exit conditions, there is a
1posProfit = (((close - positionprice) * pointvalue) * countofposition) / pipsizeThe posprofit would be higher with double the size of countofposition- so that why we are closing before the Original V6 DAX. but when I set out for making a more conservative code, I didn’t expect it to be on the gain side :-s Just a quick look and knowing that you properly optimized the exit strategy(maxCandlesLongWithProfit) I actually think that the original posProfit is general with higher gain. I would be nice if adjusting the maxposition size, still would follow the original posProfit -accordingly, other vice we are not only dealing with profit limited by positionsize but also missing out of profit because getting out to soon. Does this make sense?
12/27/2016 at 8:08 PM #19187Hey guys,
I tried to adapt the dow to version 6
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311// 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 6// Instrument: DAX mini 4H, 9-21 CET, 2 points spread, account size 10.000 Euro, from August 2010// ProOrder code parameterDEFPARAM CUMULATEORDERS = true // cumulate orders if not turned offDEFPARAM PRELOADBARS = 10000// define intraday trading windowONCE startTime = 90000ONCE endTime = 210000// define instrument signalline with help of multiple smoothed averagesONCE periodFirstMA = 5ONCE periodSecondMA = 10ONCE periodThirdMA = 7// define filter parameterONCE periodLongMA = 160ONCE periodShortMA = 5// define position and money management parameterONCE positionSize = 1Capital = 10000Risk = 5 // in %equity = Capital + StrategyProfitmaxRisk = round(equity * Risk / 100)ONCE stopLossLong = 5.5 // in %ONCE stopLossShort = 1.5 // in % 1.5ONCE takeProfitLong = 1.5 // in % 2/1.5ONCE takeProfitShort = 0.5 // in 0.5%maxPositionSizeLong = MAX(10, abs(round(maxRisk / (close * stopLossLong / 100) / PointValue) * pipsize))maxPositionSizeShort = MAX(10, abs(round(maxRisk / (close * stopLossShort / 100) / PointValue) * pipsize))ONCE trailingStartLong = 1.25 // in %ONCE trailingStartShort = 0.75 // in %ONCE trailingStepLong = 0.2 // in %ONCE trailingStepShort = 0.2 // in %ONCE maxCandlesLongWithProfit = 17 // take long profit latest after 17 candlesONCE maxCandlesShortWithProfit = 3 // take short profit latest after 4 candlesONCE maxCandlesLongWithoutProfit = 40 // limit long loss latest after 40 candlesONCE maxCandlesShortWithoutProfit = 11 // limit short loss latest after 11 candles// define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)ONCE January1 = 3//3ONCE January2 = 1//1ONCE February1 = 2//2ONCE February2 = 1//1ONCE March1 = 2//2/3ONCE March2 = 3//3ONCE April1 = 2//2ONCE April2 = 0//0ONCE May1 = 0//0!ONCE May2 = 0//0!ONCE June1 = 3//3ONCE June2 = 3//3ONCE July1 = 0//0ONCE July2 = 0//0ONCE August1 = 0//0ONCE August2 = 0//0ONCE September1 = 3//3ONCE September2 = 3//3ONCE October1 = 0//0/1ONCE October2 = 3//3ONCE November1 = 1//1ONCE November2 = 3//3ONCE December1 = 1//0/1ONCE December2 = 3//// calculate daily high/low (include sunday values if available)dailyHigh = DHigh(1)dailyLow = DLow(1)// calculate weekly high/lowIf DayOfWeek < DayOfWeek[1] thenweeklyHigh = Highest[BarIndex - lastWeekBarIndex](dailyHigh)lastWeekBarIndex = BarIndexENDIF// calculate monthly high/lowIf Month[1] <> Month[2] then//If 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 openIf Time < startTime thenstartPositionLong = COUNTOFLONGSHARESstartPositionShort = COUNTOFSHORTSHARESEndIF// trade only in defined trading windowIF Time >= startTime AND Time <= endTime THEN// set saisonal multipliercurrentDayOfTheMonth = Date - ((CurrentYear * 10000) + CurrentMonth * 100)midOfMonth = 15IF CurrentMonth = 1 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = January1ELSEsaisonalPatternMultiplier = January2ENDIFELSIF CurrentMonth = 2 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = February1ELSEsaisonalPatternMultiplier = February2ENDIFELSIF CurrentMonth = 3 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = March1ELSEsaisonalPatternMultiplier = March2ENDIFELSIF CurrentMonth = 4 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = April1ELSEsaisonalPatternMultiplier = April2ENDIFELSIF CurrentMonth = 5 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = May1ELSEsaisonalPatternMultiplier = May2ENDIFELSIF CurrentMonth = 6 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = June1ELSEsaisonalPatternMultiplier = June2ENDIFELSIF CurrentMonth = 7 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = July1ELSEsaisonalPatternMultiplier = July2ENDIFELSIF CurrentMonth = 8 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = August1ELSEsaisonalPatternMultiplier = August2ENDIFELSIF CurrentMonth = 9 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = September1ELSEsaisonalPatternMultiplier = September2ENDIFELSIF CurrentMonth = 10 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = October1ELSEsaisonalPatternMultiplier = October2ENDIFELSIF CurrentMonth = 11 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = November1ELSEsaisonalPatternMultiplier = November2ENDIFELSIF CurrentMonth = 12 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = December1ELSEsaisonalPatternMultiplier = December2ENDIFENDIF// define trading filters// 1. use fast and slow averages as filter because not every breakout is profitablef1 = close > Average[periodLongMA](close)f2 = close < Average[periodLongMA](close)f3 = close > Average[periodShortMA](close)// 2. check if position already reduced in trading window as additonal filter criteriaalreadyReducedLongPosition = COUNTOFLONGSHARES < startPositionLongalreadyReducedShortPosition = COUNTOFSHORTSHARES < startPositionShort// 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 entry with order cumulationIF ( (l1 OR l4 OR l2 OR (l3 AND f2)) AND NOT alreadyReducedLongPosition) THEN// check saisonal booster setup and max position sizeIF saisonalPatternMultiplier > 0 THENIF (COUNTOFPOSITION + (positionSize * saisonalPatternMultiplier)) <= maxPositionSizeLong THENBUY positionSize * saisonalPatternMultiplier CONTRACT AT MARKETENDIFELSIF saisonalPatternMultiplier <> 0 THENIF (COUNTOFPOSITION + positionSize) <= maxPositionSizeLong THENBUY positionSize CONTRACT AT MARKETENDIFENDIFstopLoss = stopLossLongtakeProfit = takeProfitLongENDIF// short entry without order cumulationIF NOT SHORTONMARKET AND ( (s1 AND f3) OR (s2 AND f1) ) AND NOT alreadyReducedShortPosition THEN// check saisonal booster setup and max position sizeIF saisonalPatternMultiplier < 0 THENIF (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) / pipsizenumberCandles = (BarIndex - TradeIndex)m1 = posProfit > 0 AND numberCandles >= maxCandlesLongWithProfitm2 = posProfit > 0 AND numberCandles >= maxCandlesShortWithProfitm3 = posProfit < 0 AND numberCandles >= maxCandlesLongWithoutProfitm4 = posProfit < 0 AND numberCandles >= maxCandlesShortWithoutProfit// take profit after max candlesIF LONGONMARKET AND (m1 OR m3) THENSELL AT MARKETENDIFIF SHORTONMARKET AND (m2 OR m4) THENEXITSHORT AT MARKETENDIF// trailing stop function (convert % to pips)trailingStartLongInPoints = tradeprice(1) * trailingStartLong / 100trailingStartShortInPoints = tradeprice(1) * trailingStartShort / 100trailingStepLongInPoints = tradeprice(1) * trailingStepLong / 100trailingStepShortInPoints = tradeprice(1) * trailingStepShort / 100// reset the stoploss valueIF NOT ONMARKET THENnewSL = 0ENDIF// manage long positionsIF LONGONMARKET THEN// first move (breakeven)IF newSL = 0 AND close - tradeprice(1) >= trailingStartLongInPoints * pipsize THENnewSL = tradeprice(1) + trailingStepLongInPoints * pipsizestopLoss = stopLossLong * 0.1takeProfit = takeProfitLong * 2ENDIF// next movesIF newSL > 0 AND close - newSL >= trailingStepLongInPoints * pipsize THENnewSL = newSL + trailingStepLongInPoints * pipsizeENDIFENDIF// manage short positionsIF SHORTONMARKET THEN// first move (breakeven)IF newSL = 0 AND tradeprice(1) - close >= trailingStartShortInPoints * pipsize THENnewSL = tradeprice(1) - trailingStepShortInPoints * pipsizeENDIF// next movesIF newSL > 0 AND newSL - close >= trailingStepShortInPoints * pipsize THENnewSL = newSL - trailingStepShortInPoints * pipsizeENDIFENDIF// stop order to exit the positionsIF newSL > 0 THENIF LONGONMARKET THENSELL AT newSL STOPENDIFIF SHORTONMARKET THENEXITSHORT AT newSL STOPENDIFENDIF// superordinate stop and take profitSET STOP %LOSS stopLossSET TARGET %PROFIT takeProfitENDIF12/27/2016 at 8:33 PM #19191Correction: “The posprofit would be higher with double the size of countofposition- so that why we are closing before the Original V6 DAX.”
The posprofit would actually be lower with the double size of countofposition- at least in the latest exit.
Sorry about the mistake.
12/27/2016 at 9:43 PM #19197Perhaps can open individual forum for each indices/commodities (even forex), making it easier to follow the indices/commodities you are interested in trading now or maybe in the future, and for new members to pick up too.
I approve! Maybe we could put this as a rule: create individual topic for each different instrument version of Pathfinder. This is Reiner’s topic, so I think he may also have something to say about this idea.
But if you look at the average annual performance you see that for example hangseng has a annual performance of 39% (based on the last 10 years) and coffee is 16.5 % (in 39 years).
Good point! Normalized annualized performances should be used in this case. I believe anyone could do this calculation with the Excel file, Reiner has shared.
12/27/2016 at 10:44 PM #19200I like to have everything in one topic. it is easier to stay uppdated and a lot of the things that are discussed here are general for all the systems.
just my opinion…
12/28/2016 at 4:24 AM #19203I am having trouble getting anywhere close to your backtest.
I can only test from 30 aug 2012 and only get 57 trades (+48/-9) with time changed to 23.00 (instead of 21.00) and spread 2.8.
It seems as though I have done something wrong…
Regards, David
-
AuthorPosts
Find exclusive trading pro-tools on