Hi!
My live dows are still open and i use the algo on first page. Strange…
Regards
Henrik
Mine are also still open. Running live v6 from Jan 15.
rebParticipant
Master
Hi guys
I use v6-1 :
description in the code : Version 6 – last optimization from 15.01.2017
backtest gives me same results as live
Reb
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?
Strange. I have no positions open on DAX :/
Anyone else?
My last DAX position was 13/04/17
I have 6 long on DAX v6 from Jan 15. 1st opened yesterday at 1pm and the 2nd yesterday at 9pm.
Also 9 long on DOW. Also v6 from Jan 15.
Best regards, David
ALEModerator
Master
Hi
the same positions of Dajvop DAX for me.
@Dajvop, did you have DAX open since January?
@ALE
Yes, but I had to restart the system in early February, so I can’t see the performance before that.
The 9 DOW longs closed at 17.00 GMT+1 with a nice profit: €2.662 !
rebParticipant
Master
I don’t understand such differences
for me dow long closed on friday (bad luck)
And I have no dax position opened
@reb
Are you sure you are using Rainers versions published in the first post in this thread?
Without any modifications!
@reb
Upload your version here of DOW here.
Best regards, David
rebParticipant
Master
@dajvop
I agree for the HS
Here is my dow version
/ 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 parameter
DEFPARAM CUMULATEORDERS = true // cumulate orders if not turned off
DEFPARAM PRELOADBARS = 10000
// define intraday trading window
ONCE startTime = 90000
ONCE endTime = 210000
// define instrument signalline with help of multiple smoothed averages
ONCE periodFirstMA = 5
ONCE periodSecondMA = 10
ONCE periodThirdMA = 7
// define filter parameter
ONCE periodLongMA = 130 //160
ONCE periodShortMA = 5
// define position and money management parameter
ONCE 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 = 6
maxPositionSizeShort = 6
ONCE 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 candles
ONCE maxCandlesShortWithProfit = 3 // take short profit latest after x candles
ONCE maxCandlesLongWithoutProfit = 45 //40 limit long loss latest after x candles
ONCE 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 1
ONCE January2 = 3//2 chance
ONCE February1 = 2//1 chance
ONCE February2 = 2//0 risk(2)
ONCE March1 = 2//0 risk(2) 0
ONCE March2 = 3//2 chance
ONCE April1 = 3//3 ok
ONCE April2 = 3//3 ok
ONCE May1 = 0//3 ok
ONCE May2 = 0//0 ok
ONCE June1 = 2//0 risk(2) 3
ONCE June2 = 2//0 risk(2) 3
ONCE July1 = 3//1 chance ok 1
ONCE July2 = 1//1 ok
ONCE August1 = 0// ok
ONCE August2 = 0// ok
ONCE September1 = 3//0 risk(3)
ONCE September2 = 3//0 risk(3)
ONCE October1 = 0//0 ok
ONCE October2 = 3//3 ok
ONCE November1 = 0//0 ok
ONCE November2 = 3//3 ok
ONCE December1 = 3//3 ok
ONCE December2 = 3//2 chance
// calculate daily high/low (include sunday values if available)
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[1] <> Month[2] then
//If Month <> Month[1] then
monthlyHigh = Highest[BarIndex - lastMonthBarIndex](dailyHigh)
monthlyLow = Lowest[BarIndex - lastMonthBarIndex](dailyLow)
lastMonthBarIndex = BarIndex
ENDIF
// calculate instrument signalline with multiple smoothed averages
firstMA = WilderAverage[periodFirstMA](close)
secondMA = TimeSeriesAverage[periodSecondMA](firstMA)
signalline = TimeSeriesAverage[periodThirdMA](secondMA)
// save position before trading window is open
If Time < startTime then
startPositionLong = COUNTOFLONGSHARES
startPositionShort = COUNTOFSHORTSHARES
EndIF
// trade only in defined trading window
IF Time >= startTime AND Time <= endTime THEN
// set saisonal multiplier
currentDayOfTheMonth = Date - ((CurrentYear * 10000) + CurrentMonth * 100)
midOfMonth = 15
IF CurrentMonth = 1 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = January1
ELSE
saisonalPatternMultiplier = January2
ENDIF
ELSIF CurrentMonth = 2 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = February1
ELSE
saisonalPatternMultiplier = February2
ENDIF
ELSIF CurrentMonth = 3 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = March1
ELSE
saisonalPatternMultiplier = March2
ENDIF
ELSIF CurrentMonth = 4 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = April1
ELSE
saisonalPatternMultiplier = April2
ENDIF
ELSIF CurrentMonth = 5 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = May1
ELSE
saisonalPatternMultiplier = May2
ENDIF
ELSIF CurrentMonth = 6 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = June1
ELSE
saisonalPatternMultiplier = June2
ENDIF
ELSIF CurrentMonth = 7 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = July1
ELSE
saisonalPatternMultiplier = July2
ENDIF
ELSIF CurrentMonth = 8 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = August1
ELSE
saisonalPatternMultiplier = August2
ENDIF
ELSIF CurrentMonth = 9 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = September1
ELSE
saisonalPatternMultiplier = September2
ENDIF
ELSIF CurrentMonth = 10 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = October1
ELSE
saisonalPatternMultiplier = October2
ENDIF
ELSIF CurrentMonth = 11 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = November1
ELSE
saisonalPatternMultiplier = November2
ENDIF
ELSIF CurrentMonth = 12 THEN
IF currentDayOfTheMonth <= midOfMonth THEN
saisonalPatternMultiplier = December1
ELSE
saisonalPatternMultiplier = December2
ENDIF
ENDIF
// define trading filters
// 1. use fast and slow averages as filter because not every breakout is profitable
f1 = 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 criteria
alreadyReducedLongPosition = COUNTOFLONGSHARES < startPositionLong
alreadyReducedShortPosition = COUNTOFSHORTSHARES < startPositionShort
// 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 dailyLow
// long entry with order cumulation
IF ( (l1 OR l4 OR l2 OR (l3 AND f2)) AND NOT alreadyReducedLongPosition) THEN
// check saisonal booster setup and max position size
IF saisonalPatternMultiplier > 0 THEN
IF (COUNTOFPOSITION + (positionSize * saisonalPatternMultiplier)) <= maxPositionSizeLong THEN
BUY positionSize * saisonalPatternMultiplier CONTRACT AT MARKET
ENDIF
ELSIF saisonalPatternMultiplier <> 0 THEN
IF (COUNTOFPOSITION + positionSize) <= maxPositionSizeLong THEN
BUY positionSize CONTRACT AT MARKET
ENDIF
ENDIF
stopLoss = stopLossLong
takeProfit = takeProfitLong
ENDIF
// short entry without order cumulation
IF NOT SHORTONMARKET AND ( (s1 AND f3) OR (s2 AND f1) ) AND NOT alreadyReducedShortPosition THEN
// check saisonal booster setup and max position size
IF saisonalPatternMultiplier < 0 THEN
IF (COUNTOFPOSITION + (positionSize * ABS(saisonalPatternMultiplier))) <= maxPositionSizeShort THEN
SELLSHORT positionSize * ABS(saisonalPatternMultiplier) CONTRACT AT MARKET
ENDIF
ELSIF saisonalPatternMultiplier <> 0 THEN
IF (COUNTOFPOSITION + positionSize) <= maxPositionSizeLong THEN
SELLSHORT positionSize CONTRACT AT MARKET
ENDIF
ENDIF
stopLoss = stopLossShort
takeProfit = takeProfitShort
ENDIF
// stop and profit management
posProfit = (((close - positionprice) * pointvalue) * countofposition) / pipsize
numberCandles = (BarIndex - TradeIndex)
m1 = posProfit > 0 AND numberCandles >= maxCandlesLongWithProfit
m2 = posProfit > 0 AND numberCandles >= maxCandlesShortWithProfit
m3 = posProfit < 0 AND numberCandles >= maxCandlesLongWithoutProfit
m4 = posProfit < 0 AND numberCandles >= maxCandlesShortWithoutProfit
// take profit after max candles
IF LONGONMARKET AND (m1 OR m3) THEN
SELL AT MARKET
ENDIF
IF SHORTONMARKET AND (m2 OR m4) THEN
EXITSHORT AT MARKET
ENDIF
// trailing stop function (convert % to pips)
trailingStartLongInPoints = tradeprice(1) * trailingStartLong / 100
trailingStartShortInPoints = tradeprice(1) * trailingStartShort / 100
trailingStepLongInPoints = tradeprice(1) * trailingStepLong / 100
trailingStepShortInPoints = tradeprice(1) * trailingStepShort / 100
// reset the stoploss value
IF NOT ONMARKET THEN
newSL = 0
ENDIF
// manage long positions
IF LONGONMARKET THEN
// first move (breakeven)
IF newSL = 0 AND close - tradeprice(1) >= trailingStartLongInPoints * pipsize THEN
newSL = tradeprice(1) + trailingStepLongInPoints * pipsize
stopLoss = stopLossLong * 0.1
takeProfit = takeProfitLong * 2
ENDIF
// next moves
IF newSL > 0 AND close - newSL >= trailingStepLongInPoints * pipsize THEN
newSL = newSL + trailingStepLongInPoints * pipsize
ENDIF
ENDIF
// manage short positions
IF SHORTONMARKET THEN
// first move (breakeven)
IF newSL = 0 AND tradeprice(1) - close >= trailingStartShortInPoints * pipsize THEN
newSL = tradeprice(1) - trailingStepShortInPoints * pipsize
ENDIF
// next moves
IF newSL > 0 AND newSL - close >= trailingStepShortInPoints * pipsize THEN
newSL = newSL - trailingStepShortInPoints * pipsize
ENDIF
ENDIF
// stop order to exit the positions
IF newSL > 0 THEN
IF LONGONMARKET THEN
SELL AT newSL STOP
ENDIF
IF SHORTONMARKET THEN
EXITSHORT AT newSL STOP
ENDIF
ENDIF
// superordinate stop and take profit
SET STOP %LOSS stopLoss
SET TARGET %PROFIT takeProfit
ENDIF