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
-
-
07/09/2018 at 11:06 AM #75631
Your own code did a BC trade or do you mean the PF (it did)?
07/09/2018 at 11:09 AM #75632Your own code did a BC trade or do you mean the PF (it did)?
hahahaha it was a misunderstood sry
08/23/2018 at 1:49 PM #78847Hola hola,
the dax Pathfinder 1H and 4H but also the Pathfinder Hangseng didn’t t take any trade for over a month in demo but when backtesting it did take a few trades. not sure why.
The dax systems takes half and quarter positions in backtest. could that be one of the reasons?
08/23/2018 at 3:18 PM #7885208/23/2018 at 3:24 PM #7885408/24/2018 at 7:32 AM #78887Hola hola,
the dax Pathfinder 1H and 4H but also the Pathfinder Hangseng didn’t t take any trade for over a month in demo but when backtesting it did take a few trades. not sure why.
The dax systems takes half and quarter positions in backtest. could that be one of the reasons?
the dax 4h took 2 trade for me in the last 2 weeks so i don’t know why for you, i’m running live.
1 user thanked author for this post.
09/26/2018 at 9:41 AM #81322Here is a version DAX 4H with some MF filter function and a different trailing sistem, i hope you guys will find usefull.
The @reiner pathfinder is an Huge system and i found it awesome 🙂
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410// ProOrder code parameterDEFPARAM CUMULATEORDERS = true // cumulate orders if not turned offDEFPARAM PRELOADBARS = 10000// define intraday trading windowONCE startTime = 90000 // start time of trading window in CETONCE endTime = 210000 // end time of trading window in CET// define instrument signalline with help of multiple smoothed averagesONCE periodFirstMA = 5 // 5 is center of gravity, do not changeONCE periodSecondMA = 10 // 10 is center of gravity, do not changeONCE periodThirdMA = 3 // heartbeat of the instrument// define filter parameterONCE periodLongMA = 400 // period lenght of the long moving average that works as filterONCE periodShortMA = 50 // period lenght of the short moving average that works as filter// define money and position management parameter// dynamic scaling of the chance/risk profile depending on account sizeONCE startRisk = 2.5 // start risk level e.g 0.25 - 25%, 0.5 - 50%, 0.75 - 75%, 1 - 100% and so onONCE maxRisk = 20 // max risk level e.g 1.5 - 150%ONCE increaseRiskLevel = 500 // amount of profit from which the risk is to be increasedONCE increaseRiskStep = 0.5 // step by which the risk should be increased// size calculation: size = positionSize * trendMultiplier * saisonalPatternMultiplier * scaleFactorONCE positionSize = 1 // default start sizeONCE trendMultiplier = 2 // >1 with dynamic position sizing; 1 withoutONCE maxPositionSizePerTrade = 6 // maximum size per tradeONCE maxPositionSizeLong = 10 // maximum size for long positionsONCE maxPositionSizeShort = 10 // maximum size for short positionsONCE stopLossLong = 3 // in %ONCE stopLossShort = 3.5 // in %ONCE takeProfitLong = 6 // in %ONCE takeProfitShort = 2.5ONCE maxCandlesLongWithProfit = 16 // take long profit latest after x candlesONCE maxCandlesShortWithProfit = 13 // take short profit latest after x candlesONCE maxCandlesLongWithoutProfit = 30 // limit long loss latest after x candlesONCE maxCandlesShortWithoutProfit = 30 // limit short loss latest after x candles *changed from 25//////////////// define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)ONCE January1 = 2 //0 risk(2) *changed from 3ONCE January2 = 0 //3 okONCE February1 = 3 //3 okONCE February2 = 3 //0 risk(3)ONCE March1 = 3 //0 risk(3)ONCE March2 = 2 //3 okONCE April1 = 2 //3 ok *changed from 1ONCE April2 = 3 //3 okONCE May1 = 1 //0 risk(1)ONCE May2 = 2 //0 risk(2)ONCE June1 = 1 //1 okONCE June2 = 2 //3 okONCE July1 = 3 //1 chanceONCE July2 = 2 //3 okONCE August1 = 2 //1 okONCE August2 = 1 //3 ok chance 1 *changed from 3ONCE September1 = 3 //0 risk(3)ONCE September2 = 0 //0 okONCE October1 = 3 //0 risk(3)ONCE October2 = 3 //3 ok *changed from 2ONCE November1 = 2 //1 chance *changed from 1ONCE November2 = 3 //3 okONCE December1 = 3 //1 chanceONCE December2 = 2 //3 ok///////////////////////timeframe (1h)//1////////////////////////////////////////////////////////once trailinstop= 1 //1 on - 0 offtrailingstart = 100 //trailing will start @trailinstart points profittrailingstep = 20 //trailing step to move the "stoploss"//////////////once breakeaven = 1 //1 on - 0 offstartBreakeven = 100 //how much pips/points in gain to activate the breakeven function?PointsToKeep = 120 //how much pips/points to keep in profit above of below our entry price when the breakeven is activated (beware of spread)/////////////////////////////////////////////////////////////2/////////////////////////////////////////////////reset the breakevenLevel when no trade are on marketIF NOT ONMARKET THENbreakevenLevel=0ENDIFtimeframe(default)////////FILTRI////////////////////condizioniFILTROLONG = (C02 < 0.15) and (c02 > -0.9) and (adxweigh < 63) and (i1 < 0.7)and (i1 > 0.1) and (m01<0.2)and (MT>CLOSE)FILTROSHORT = (c02 < -0.28) and (c02 > -0.9) and (adxweigh > 25) and (i1 < 0.9) and (i1 > 0) and (m01>0.03)//and (cc > 280)timeframe (1H)MT = CALL "Main Trend"timeframe (default)//filtro TILS/R2ONCE P = 5ONCE COEFF = 0.7ONCE MM = 50once PERIODO = 30 //provare con 50 POI 30MME3 = ExponentialAverage[P](ExponentialAverage[P](ExponentialAverage[P](close)))MME4 = ExponentialAverage[P](MME3)MME5 = ExponentialAverage[P](MME4)MME6 = ExponentialAverage[P](MME5)REM Calcolo dei coefficientiONCE c1 = SQUARE(coeff)*coeffONCE c1 = -c1ONCE c2 = 3*SQUARE(coeff)-3*c1ONCE c3 = -2*c2 -3*c1 -3*coeffONCE c4 = 1 + 3*coeff + c2 +2*c1Tilson = c1*MME6 + c2*MME5 + c3*MME4 + c4*MME3c02=R2[mm](Tilson)-r2[mm](average[mm])////filtro2adxweigh, ignored, ignored, ignored = CALL "ADX Weighted RSI"[14, 14, 50](close)ignored, ignored, ignored, M01, ignored, ignored = CALL "Filtro Elasticita'"//filtro3i1 = R2[PERIODO](close)//cc=CCI[20]// calculate the scaling factor based on the parameterscaleFactor = MIN(maxRisk, MAX(startRisk, ROUND(StrategyProfit / increaseRiskLevel) * increaseRiskStep))// dynamic position sizing based on weekly performanceONCE profitLastWeek = 0IF DayOfWeek <> DayOfWeek[1] AND DayOfWeek = 1 THENIF StrategyProfit > profitLastWeek + 1 THENpositionSize = MIN(trendMultiplier, positionSize + 1) // increase riskELSEpositionSize = MAX(1, positionSize - 1) // decrease riskENDIFprofitLastWeek = strategyProfitENDIF// calculate daily high/low (include sunday values if available)dailyHigh = DHigh(1)dailyLow = DLow(1)previousDailyHigh = DHigh(2)// calculate weekly high, weekly low is a poor signalIf DayOfWeek < DayOfWeek[1] AND lastweekbarindex = 0 THENlastWeekBarIndex = BarIndexELSEIF DayOfWeek < DayOfWeek[1] THENweeklyHigh = Highest[BarIndex - lastWeekBarIndex](dailyHigh)lastWeekBarIndex = BarIndexENDIFENDIF// calculate monthly high/lowIF Month <> Month[1] AND lastMonthBarIndex=0 THENlastMonthBarIndex=barindexELSIF 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 = OpenDaymidOfMonth = 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 dailyLows3 = signalline CROSSES UNDER previousDailyHigh// 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 THENnumberContracts = MAX(1, MIN(maxPositionSizePerTrade, positionSize * saisonalPatternMultiplier) * scaleFactor)IF (COUNTOFPOSITION + numberContracts) <= maxPositionSizeLong * scaleFactor THENIF SHORTONMARKET THENEXITSHORT AT MARKETENDIFif filtrolong thenBUY numberContracts CONTRACT AT MARKETENDIFendifELSIF saisonalPatternMultiplier <> 0 THENnumberContracts = MAX(1, MIN(maxPositionSizePerTrade, positionSize) * scaleFactor)IF (COUNTOFPOSITION + numberContracts) <= maxPositionSizeLong * scaleFactor THENIF SHORTONMARKET THENEXITSHORT AT MARKETENDIFif filtrolong thenBUY numberContracts CONTRACT AT MARKETENDIFendifENDIFstopLoss = stopLossLongtakeProfit = takeProfitLongENDIF// short entry with order cumulationIF ( (s1 AND f3) OR (s2 AND f1) OR (s3 AND f3) ) AND NOT alreadyReducedShortPosition THEN// check saisonal booster setup and max position sizeIF saisonalPatternMultiplier < 0 THENnumberContracts = MAX(1, MIN(maxPositionSizePerTrade, positionSize * ABS(saisonalPatternMultiplier)) * scaleFactor)IF (ABS(COUNTOFPOSITION) + numberContracts) <= maxPositionSizeShort * scaleFactor THENIF LONGONMARKET THENSELL AT MARKETENDIFif filtroshort thenSELLSHORT numberContracts CONTRACT AT MARKETENDIFendifELSIF saisonalPatternMultiplier <> 0 THENnumberContracts = MAX(1, MIN(maxPositionSizePerTrade, positionSize) * scaleFactor)IF (ABS(COUNTOFPOSITION) + numberContracts) <= maxPositionSizeShort * scaleFactor THENIF LONGONMARKET THENSELL AT MARKETENDIFif filtroshort thenSELLSHORT numberContracts CONTRACT AT MARKETENDIFendifENDIFstopLoss = 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// superordinate stop and take profitSET STOP %LOSS stopLossSET TARGET %PROFIT takeProfitENDIFtimeframe(1h)//3//////////////////////////////test if the price have moved favourably of "startBreakeven" points alreadyif breakeaven>0 thenIF onmarket AND close-tradeprice(1)>=startBreakeven*pipsize THEN//calculate the breakevenLevelbreakevenLevel = tradeprice(1)+PointsToKeep*pipsizeENDIF//place the new stop orders on market at breakevenLevelIF breakevenLevel>0 THENSELL AT breakevenLevel STOPENDIFendif//************************************************************************//trailing stop functionif trailinstop>0 then//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFendiftimeframe (default)09/26/2018 at 10:07 AM #8132409/26/2018 at 10:17 AM #8132709/26/2018 at 10:19 AM #8132809/26/2018 at 10:19 AM #8133009/26/2018 at 10:27 AM #8133109/26/2018 at 10:33 AM #8133209/26/2018 at 10:33 AM #8133309/26/2018 at 10:37 AM #81334 -
AuthorPosts
Find exclusive trading pro-tools on