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
Viewing 15 posts - 1,186 through 1,200 (of 1,835 total)
-
-
04/24/2017 at 7:14 PM #3323704/24/2017 at 7:35 PM #3324004/25/2017 at 5:51 AM #3327104/25/2017 at 9:23 AM #33289
Right now I have 9 long DOW and 6 DAX open.
I use Rainer’s version 6 which are published in the first post. I hope all of us contributing in this thread, are using the same versions without any personal changes. Otherwise it makes no sense discussing why different positions did open or close. I noticed in the trade log, and also above in the thread, that DOW closed 6 longs. In my opinion and according to the algos logics, they should still be open.
Don’t you agree?
04/25/2017 at 9:36 AM #3329704/25/2017 at 9:43 AM #3329804/25/2017 at 2:34 PM #3332804/25/2017 at 3:38 PM #3334204/25/2017 at 3:46 PM #3334304/25/2017 at 4:11 PM #3335104/25/2017 at 4:12 PM #3335204/25/2017 at 4:18 PM #3335304/25/2017 at 7:38 PM #3338604/25/2017 at 7:40 PM #3338704/25/2017 at 8:34 PM #33400I agree for the HS
Here is my dow version
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310/ 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 - last optimization from 15.01.2017// Instrument: DOW mini 4H, 9-21 CET, 1.8 points spread, account size 10.000 Euro, from May 2006// 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 = 130 //160ONCE periodShortMA = 5// define position and money management parameterONCE positionSize = 1//Capital = 10000//Risk = 5 // in %//equity = Capital + StrategyProfit//maxRisk = round(equity * Risk / 100)ONCE stopLossLong = 5.5 // in %ONCE stopLossShort = 1.5 // in %ONCE takeProfitLong = 2.5 //1.5 in %ONCE takeProfitShort = 1.5 // in %maxPositionSizeLong = 6maxPositionSizeShort = 6ONCE trailingStartLong = 1.25 // in %ONCE trailingStartShort = 1.25 // in %ONCE trailingStepLong = 0.6 //0.3 in %ONCE trailingStepShort = 0.6 //0.3 in %ONCE maxCandlesLongWithProfit = 17 // take long profit latest after x candlesONCE maxCandlesShortWithProfit = 3 // take short profit latest after x candlesONCE maxCandlesLongWithoutProfit = 45 //40 limit long loss latest after x candlesONCE maxCandlesShortWithoutProfit = 11 // limit short loss latest after x candles// define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)ONCE January1 = 0//0 ok 1ONCE January2 = 3//2 chanceONCE February1 = 2//1 chanceONCE February2 = 2//0 risk(2)ONCE March1 = 2//0 risk(2) 0ONCE March2 = 3//2 chanceONCE April1 = 3//3 okONCE April2 = 3//3 okONCE May1 = 0//3 okONCE May2 = 0//0 okONCE June1 = 2//0 risk(2) 3ONCE June2 = 2//0 risk(2) 3ONCE July1 = 3//1 chance ok 1ONCE July2 = 1//1 okONCE August1 = 0// okONCE August2 = 0// okONCE September1 = 3//0 risk(3)ONCE September2 = 3//0 risk(3)ONCE October1 = 0//0 okONCE October2 = 3//3 okONCE November1 = 0//0 okONCE November2 = 3//3 okONCE December1 = 3//3 okONCE December2 = 3//2 chance// 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 takeProfitENDIF -
AuthorPosts
Find exclusive trading pro-tools on
Similar topics: