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
-
-
01/23/2017 at 9:05 PM #2220101/23/2017 at 9:13 PM #22202
@ALCO
Hi,
In demo account no. In demo account Pathfinder open short position on FTSE at 7135,9 today at 17.00. Thanks
01/23/2017 at 9:24 PM #2220301/23/2017 at 9:32 PM #22204Strange behaviour- signal line crossed under daily low between 13:00 and 17:00 so the short signal is good. However why it opened at 21:00 I don’t know. Also it didn’t open any short for me- though the signal line is 11566 and daily low is 11573 @17:00. I have no rejected or cancelled order in DAX trying to make a short position. If back tested DAX 4H V6 there is also no opening in short signal @17:00 or 21:00
Anyone Else?
01/23/2017 at 9:41 PM #22210@ALLCO
v6 and v6_small in demo account
01/23/2017 at 9:44 PM #22211Hi guys,
Dax 4H V6 is not supposed to open any position because january2 = 0.
My FTSE live account opened a position at 5 pm. My backtest opened the same position at 9pm, but timestamped 5pm, but that’s a normal behaviour – backtest open the position always next candle comparing to live.
So everything is OK I guess..
01/23/2017 at 9:53 PM #22212Opened short on demo DAX, version 3.
01/23/2017 at 10:01 PM #22213correct, But I changed it to 1. I forgot to mention that.
01/23/2017 at 10:21 PM #22214@ALCO
Correct, I have set january2=0
01/24/2017 at 8:53 PM #2236101/25/2017 at 2:30 PM #22430Hi Reiner,
Nice to see the progress you are making here. The exit in my Grid Step System works like this, PRT draws a curve of floating profit/loss and applies a bollinger bands to the profit curve, if the profit curve crosses below the lower bollinger band and floating profit is above the RR threshold the exit kicks in and all positions are closed (if RR set to 3 it will apply after 3 % floating profit is reached). Make sure to pay attention to the MA period and standard deviation. Here is the code;
12345678910111213141516171819202122232425262728293031323334353637383940414243defparam preloadbars = 10000once RRreached = 0//parametersaccountbalance = 10000 //account balance in money at strategy startriskpercent = 1 //whole account risk in percent%amount = 1 //lot amount to open each traderr = 0 //risk reward ratio (set to 0 disable this function)//money managementliveaccountbalance = accountbalance+strategyprofitmoneyrisk = (liveaccountbalance*(riskpercent/100))if onmarket thenonepointvaluebasket = pointvalue*countofpositionmindistancetoclose =(moneyrisk/onepointvaluebasket)*pipsizeendif//floating profitfloatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual trade gainsMAfloatingprofit = average[20](floatingprofit)BBfloatingprofit = MAfloatingprofit - std[20](MAfloatingprofit)*2//floating profit risk reward checkif rr>0 and floatingprofit>moneyrisk*rr thenRRreached=1endif//stoploss trigger when risk reward ratio is not met alreadyif onmarket and RRreached=0 thenSELL AT positionprice-mindistancetoclose STOPendif//stoploss trigger when risj reward ratio has been reachedif onmarket and RRreached=1 thenif floatingprofit crosses under BBfloatingprofit thenSELL AT MARKETendifSELL AT positionprice-mindistancetoclose STOPendif//resetting the risk reward reached variableif not onmarket thenRRreached = 0endif1234567891011121314151617181920212223242526272829303132333435363738394041424344defparam preloadbars = 10000once RRreached = 0//parametersaccountbalance = 10000 //account balance in money at strategy startriskpercent = 1 //whole account risk in percent%amount = 1 //lot amount to open each traderr = 2 //risk reward ratio (set to 0 disable this function)//money managementliveaccountbalance = accountbalance+strategyprofitmoneyrisk = (liveaccountbalance*(riskpercent/100))if onmarket thenonepointvaluebasket = pointvalue*countofpositionmindistancetoclose =(moneyrisk/onepointvaluebasket)*pipsizeendif//floating profitfloatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual trade gainsMAfloatingprofit = average[20](floatingprofit)BBfloatingprofit = MAfloatingprofit - std[20](MAfloatingprofit)*2//floating profit risk reward checkif rr>0 and floatingprofit>moneyrisk*rr thenRRreached=1endif//stoploss trigger when risk reward ratio is not met alreadyif onmarket and RRreached=0 thenEXITSHORT AT positionprice-mindistancetoclose STOPendif//stoploss trigger when risj reward ratio has been reachedif onmarket and RRreached=1 thenif floatingprofit crosses under BBfloatingprofit thenEXITSHORT AT MARKETendifEXITSHORT AT positionprice-mindistancetoclose STOPendif//resetting the risk reward reached variableif not onmarket thenRRreached = 0endif101/25/2017 at 3:40 PM #22438Hi. In addition to the orginal CFTA code, I have combined it into pathfinder. I removed the original SL code, and replaced it with the BBExit function. It only has one move. When RR is reached it will go into the BBExit function. As I wrote before it is not as profitable as the original code, so there is definitely something to work with. Please note that I have renamed some of the original Pathfinder’s variables so it was easier to merge into the CFTA code.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302// 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 7b1 Pathfinder BBExit// 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 = 3// define filter parameterONCE periodLongMA = 300ONCE periodShortMA = 50// define position and money management parameterONCE positionSize = 1ONCE RRreached = 0accountbalance = 10000 //account balance in money at strategy startriskpercent = 5 // in %liveaccountbalance = accountbalance + StrategyProfitmoneyrisk = round(liveaccountbalance * riskpercent / 100)rr = 0.088//x1//0.25 //risk reward ratio (set to 0 disable this function and run orginal pathfinder V6 cod)//money managementliveaccountbalance = accountbalance+strategyprofitmoneyrisk = (liveaccountbalance*(riskpercent/100))if onmarket thenonepointvaluebasket = pointvalue*countofpositionmindistancetoclose =(moneyrisk/onepointvaluebasket)*pipsizeendif//floating profitfloatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual trade gainsMAfloatingprofit = average[20](floatingprofit)BBfloatingprofit = MAfloatingprofit - std[20](MAfloatingprofit)*2ONCE stopLossLong = 5.5 // in %ONCE stopLossShort = 3.25 // in %ONCE takeProfitLong = 3.25 // in %ONCE takeProfitShort = 3.25 // in %maxPositionSizeLong = MAX(15, abs(round(moneyrisk / (close * stopLossLong / 100) / PointValue) * pipsize))maxPositionSizeShort = MAX(15, abs(round(moneyrisk / (close * stopLossShort / 100) / PointValue) * pipsize))ONCE maxCandlesLongWithProfit = 16 // take long profit latest after 16 candlesONCE maxCandlesShortWithProfit = 15 // take short profit latest after 15 candlesONCE maxCandlesLongWithoutProfit = 30 // limit long loss latest after 30 candlesONCE maxCandlesShortWithoutProfit = 12 // limit short loss latest after 12 candles// define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)ONCE January1 = 3ONCE January2 = 0ONCE February1 = 3ONCE February2 = 3ONCE March1 = 3ONCE March2 = 2ONCE April1 = 1ONCE April2 = 3ONCE May1 = 1ONCE May2 = 1ONCE June1 = 2ONCE June2 = 2ONCE July1 = 3ONCE July2 = 1ONCE August1 = 1ONCE August2 = 1ONCE September1 = 3ONCE September2 = 0ONCE October1 = 3ONCE October2 = 2ONCE November1 = 1ONCE November2 = 3ONCE December1 = 3ONCE December2 = 2// 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 THENif rr>0 and floatingprofit>moneyrisk*rr thenRRreached=1Endif// 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// superordinate stop and take profitSET STOP %LOSS stopLossSET TARGET %PROFIT takeProfit//stoploss trigger when risk reward ratio has been reachedif onmarket and RRreached=1 thenif floatingprofit crosses under BBfloatingprofit thenSELL AT MARKETEXITSHORT AT MARKETendifSELL AT positionprice-mindistancetoclose STOPEXITSHORT AT positionprice-mindistancetoclose STOPendif//resetting the risk reward reached variableif not onmarket thenRRreached = 0endifENDIF//graph posProfit COLOURED(0,0,255) AS "posProfit"//graph breakeven COLOURED(255,0,0) AS "breakeven"//AquaGraph RRreached COLOURED(0,0,255) AS "RRReached"01/25/2017 at 3:42 PM #2243901/25/2017 at 3:48 PM #2244101/25/2017 at 4:04 PM #22442 -
AuthorPosts
Find exclusive trading pro-tools on