reiner can understand why pathfinder on eur / usd takes as many draws? You can take away from the code seasonality?
thank you
mig
ALEModerator
Master
Hi nyborjare,
to work with pathfinder DAX strategy account value should be at least 8/9000 € in my opinion
In general to know account value to run strategies , you can multiply maxdrwadown of the strategy x 5 at least
For example :
MAXDRAWDOWN= € 1850 THEN
( € 1850 X 5) ACCOUNT VALUE = €9250
ALEModerator
Master
@Roman
I don’t know before december 2008.
Does any one else still have problems with the program? or has experienced problems with another program an prorealtime?
I am using a version 3 code and there was a short position in the 3.11. that did not open and yesterday the long position opened at 17 o clock, not at 21:00 as the backtest shows.
all I changed in the code is that I split up the short and long conditions in order to define the stop and limit level induvidually ( or at least this is what I tried to do 😉 )
is it prorealtime or my code? I would be very thankful for some help.
Cheers
Flo
//-------------------------------------------------------------------------
// Hauptcode : Pathfinder_v3_1
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Hauptcode : Pathfinder_v3_1
//-------------------------------------------------------------------------
// Pathfinder DAX 4H, 9-22, 2 points spread
// DAX breakout system triggered by previous daily, weekly and monthly high/low crossings
// Version 3 with smart position sizing
// ProOrder code parameter
DEFPARAM CUMULATEORDERS = false // cumulate orders if not turned off
DEFPARAM PRELOADBARS = 10000
// trading window 8-22
ONCE startTime = 80000
ONCE endTime = 220000
// smoothed average parameter (signalline)
ONCE periodFirstMA = 5
ONCE periodSecondMA = 10
ONCE periodThirdMA = 3
// filter parameter
ONCE periodLongMA = 250
ONCE periodShortMA = 50
// trading paramter
// smart position sizing
ONCE PositionSize = 1
// money and position management parameter
ONCE stoppLossL1 = 3 // in %
ONCE stoppLossL2 = 4.75 // in %
ONCE stoppLossL3 = 5.5 // in %
ONCE stoppLossL4 = 4.25 // in %
ONCE stoppLossS1 = 2.25 // in %
ONCE stoppLossS2 = 2.5 // in %
ONCE stoppLossS3 = 3.25 // in %
ONCE takeProfitL1 = 5 // in %
ONCE takeProfitL2 = 4.25 // in %
ONCE takeProfitL3 = 6 // in %
ONCE takeProfitL4 = 4.25 // in %
ONCE takeProfitS1 = 2.5 // in %
ONCE takeProfitS2 = 1.15 // in %
ONCE takeProfitS3 = 3 // in %
ONCE maxCandlesLongWithProfit = 18 // take long profit latest after 18 candles
ONCE maxCandlesShortWithProfit = 15 // take short profit latest after 13 candles
ONCE maxCandlesLongWithoutProfit = 30 // limit long loss latest after 30 candles
ONCE maxCandlesShortWithoutProfit = 25 // limit short loss latest after 25 candles
ONCE startShortPattern = 4 // April
ONCE endShortPattern = 9 // September
ONCE longPositionMultiplier = 1 // multiplier for long position size in case of higher saisonal probability
ONCE shortPositionMultiplier = 1 // multiplier for short position size in case of higher saisonal probability
// calculate daily high/low
dailyHigh = DHigh(1)
dailyLow = DLow(1)
// calculate weekly high/low
If DayOfWeek < DayOfWeek[1] then
weeklyHigh = Highest[BarIndex - lastWeekBarIndex](dailyHigh)
lastWeekBarIndex = BarIndex
ENDIF
// calculate monthly high/low
If Month <> Month[1] then
monthlyHigh = Highest[BarIndex - lastMonthBarIndex](dailyHigh)
monthlyLow = Lowest[BarIndex - lastMonthBarIndex](dailyLow)
lastMonthBarIndex = BarIndex
ENDIF
// calculate signalline with multiple smoothed averages
firstMA = WilderAverage[periodFirstMA](close)
secondMA = TimeSeriesAverage[periodSecondMA](firstMA)
signalline = TimeSeriesAverage[periodThirdMA](secondMA)
// trade only in trading window 8-22
IF Time >= startTime AND Time <= endTime THEN
// filter criteria because not every breakout is profitable
c1 = close > Average[periodLongMA](close)
c2 = close < Average[periodLongMA](close)
c3 = close > Average[periodShortMA](close)
c4 = close < Average[periodShortMA](close)
// saisonal pattern
saisonalShortPattern = CurrentMonth >= startShortPattern AND CurrentMonth <= endShortPattern
// long position conditions
l1 = signalline CROSSES OVER monthlyHigh
l2 = signalline CROSSES OVER weeklyHigh
l3 = signalline CROSSES OVER dailyHigh
l4 = signalline CROSSES OVER monthlyLow
// short position conditions
s1 = signalline CROSSES UNDER monthlyHigh
s2 = signalline CROSSES UNDER monthlyLow
s3 = signalline CROSSES UNDER dailyLow
// long entry monthly (L1)
IF l1 THEN // cumulate orders for long trades
IF not saisonalShortPattern THEN
BUY PositionSize * longPositionMultiplier CONTRACT AT MARKET
SET STOP %LOSS stoppLossL1
SET TARGET %PROFIT takeProfitL1
ELSE
BUY PositionSize CONTRACT AT MARKET
SET STOP %LOSS stoppLossL1
SET TARGET %PROFIT takeProfitL1
ENDIF
ENDIF
// long entry weekly (L2)
IF l2 THEN // cumulate orders for long trades
IF not saisonalShortPattern THEN
BUY PositionSize * longPositionMultiplier CONTRACT AT MARKET
SET STOP %LOSS stoppLossL2
SET TARGET %PROFIT takeProfitL2
ELSE
BUY PositionSize CONTRACT AT MARKET
SET STOP %LOSS stoppLossL2
SET TARGET %PROFIT takeProfitL2
ENDIF
ENDIF
// long entry dayly (L3)
IF l3 AND c2 THEN // cumulate orders for long trades
IF not saisonalShortPattern THEN
BUY PositionSize * longPositionMultiplier CONTRACT AT MARKET
SET STOP %LOSS stoppLossL3
SET TARGET %PROFIT takeProfitL3
ELSE
BUY PositionSize CONTRACT AT MARKET
SET STOP %LOSS stoppLossL3
SET TARGET %PROFIT takeProfitL3
ENDIF
ENDIF
// long entry monthly low (L4)
IF l4 THEN // cumulate orders for long trades
IF not saisonalShortPattern THEN
BUY PositionSize * longPositionMultiplier CONTRACT AT MARKET
SET STOP %LOSS stoppLossL4
SET TARGET %PROFIT takeProfitL4
ELSE
BUY PositionSize CONTRACT AT MARKET
SET STOP %LOSS stoppLossL4
SET TARGET %PROFIT takeProfitL4
ENDIF
ENDIF
// short entry (S1)
IF NOT SHORTONMARKET AND s1 AND c3 THEN // no cumulation for short trades
IF saisonalShortPattern THEN
SELLSHORT positionSize * shortPositionMultiplier CONTRACT AT MARKET
SET STOP %LOSS stoppLossS1
SET TARGET %PROFIT takeProfitS1
ELSE
SELLSHORT positionSize CONTRACT AT MARKET
SET STOP %LOSS stoppLossS1
SET TARGET %PROFIT takeProfitS1
ENDIF
ENDIF
// short entry (S2)
IF NOT SHORTONMARKET AND s2 AND c4 THEN // no cumulation for short trades
IF saisonalShortPattern THEN
SELLSHORT positionSize * shortPositionMultiplier CONTRACT AT MARKET
SET STOP %LOSS stoppLossS2
SET TARGET %PROFIT takeProfitS2
ELSE
SELLSHORT positionSize CONTRACT AT MARKET
SET STOP %LOSS stoppLossS2
SET TARGET %PROFIT takeProfitS2
ENDIF
ENDIF
// short entry (S3)
IF NOT SHORTONMARKET AND s3 AND c1 THEN // no cumulation for short trades
IF saisonalShortPattern THEN
SELLSHORT positionSize * shortPositionMultiplier CONTRACT AT MARKET
SET STOP %LOSS stoppLossS3
SET TARGET %PROFIT takeProfitS3
ELSE
SELLSHORT positionSize CONTRACT AT MARKET
SET STOP %LOSS stoppLossS3
SET TARGET %PROFIT takeProfitS3
ENDIF
ENDIF
// stop and profit management
posProfit = (((close - positionprice) * pointvalue) * countofposition) / pipsize
m1 = posProfit > 0 AND (BarIndex - TradeIndex) >= maxCandlesLongWithProfit
m2 = posProfit > 0 AND (BarIndex - TradeIndex) >= maxCandlesShortWithProfit
m3 = posProfit < 0 AND (BarIndex - TradeIndex) >= maxCandlesLongWithoutProfit
m4 = posProfit < 0 AND (BarIndex - TradeIndex) >= maxCandlesShortWithoutProfit
IF LONGONMARKET AND (m1 OR m3) THEN
SELL AT MARKET
ENDIF
IF SHORTONMARKET AND (m2 OR m4) THEN
EXITSHORT AT MARKET
ENDIF
ENDIF
wp01Participant
Master
Dear Flo,
I have no problems with Pathfinder or PRT. It went long yesterday at 21.00 hrs. at the DAX in version 5. Depending on the amount of positions you have and if you did something with the change in the
saisonality i think you should now have 1 to 3 positions long. If this is not correct, maybe someone can complement this.
I think it is important to keep track with the latest version.
Several bugs have been solved by Reiner in the upcoming versions after version 3. I suggest you take the latest version and check the results with the backtest also here posted
and after that you can try to split the long and short conditions and see what is hapening.
regards,
Patrick
It went long yesterday at 17.00 hrs. at the DAX in version 5.
wp01Participant
Master
@Miguel.
Did it actually take position at 17.00 or 4 hours later at 21.00?
Thanks.
I am running v5 and it opened a long position at 17.00 yesterday.
yes long at 17.00 3 contract at 10.339,8
wp01Participant
Master
Thanks Miguel.
Mine took position at 21.00 hrs at 10.452. Any idea where the difference comes from? Maybe anything with time setting?
Sorry , I can not explain at 21:00 in demo buy real buy at 17:00
wp01Participant
Master
@Miguel.
Did you made any adjustments for yourself in the code then?
Because the price didn’t come near the 10.340 between 13.00 and 21.00 hours.
Candle 1300 : open 10430 high 10443 low 10407 close 10441
Candle 1700: open 10441 high 10467 low 10436 close 10451
Candle 2100: open 10451 high 10480 low 10445 close 10462
I saw by the way in the order list that indead it took position at 17.00 hrs. at 10.442,50.
I double-checked. Real pathinder gave buy at 17.00 yesterday.
exact purchase price 10,441.8
The strange thing is that the same code in backtests and demos me from buying at 21.00 to 10452.2 ( 10339,8 It was another system )
ALEModerator
Master
Hello
someone could share the latest version and optimization of Pathfinder dax?
Thanks
Ale
wp01Participant
Master
Little difference is the slippage. And in the backtest you see it popping up 4 hours later. That delay is also between BT and real is also normal.
So thats clear than.
May i ask which system you used that ordered a buy at 10.339,8?
Thanks.
regards,