Hi guys,
The tendency of the last and first days of the month is one of the most well known and reliable statistical setups. This pattern has been working for decades and in many indices. I would like to share a trading system that based on the TDOM (trading day of the month) idea from Larry Williams one of the famous statistical traders.
The basic idea is to short the market on the first trading day of the month and to turn the position at the statistical monthly turning point. The system uses smart position management mechanism such as order cumulation, position sizing based on historical monthly behavior and maximal position size monitoring. Money management will be done by procentage stop loss and take profit orders.
The system is very simple but amazing profitable and works without any technical indicators.
The so-called Navigator trading system works in 4 hours timeframe and the backtest was done with 200.000 candles. Please find attached the first version for the DAX.
Reviews and suggestions for improvement are welcome.
I have created a forum topic for all discussions related to Navigator Trading System.
https://www.prorealcode.com/topic/navigator-trading-system/
Best, Reiner
// Navigator Trading System based on ProRealTime 10.3
// The algo based on the statistical advantage of the TDOM (trading day of the month) idea around the turn of the month
// Version 1
// Instrument: DAX mini 1 EUR, 4H, 9-17 CET, 1 point spread, account size 10.000 Euro
// ProOrder code parameter
DEFPARAM CUMULATEORDERS = true // cumulate orders
// define TDOM days
ONCE tradingDaySell = 1
ONCE tradingDayBuy = 8
// define intraday trading window
ONCE timeSell = 90000
ONCE timeBuy = 170000
// define position and money management parameter
ONCE positionSize = 1
ONCE maxPositionSizeLong = 10
ONCE maxPositionSizeShort = 10
ONCE minSizeLong = 1
ONCE midSizeLong = 5
ONCE maxSizeLong = 10
ONCE maxSizeShort = -10
ONCE stopLossLong = 8.5 // in %
ONCE takeProfitLong = 3 // in %
ONCE stopLossShort = 3.75 // in %
ONCE takeProfitShort = 1 // in %
// define position multiplier for each month (>0 - long / <0 - short / 0 - no trade)
ONCE longJanuary = 0
ONCE shortJanuary = maxSizeShort
ONCE longFebruary = 0
ONCE shortFebruary = maxSizeShort
ONCE longMarch = maxSizeLong
ONCE shortMarch = 0
ONCE longApril = minSizeLong
ONCE shortApril = 0
ONCE longMay = minSizeLong
ONCE shortMay = maxSizeShort
ONCE longJune = minSizeLong
ONCE shortJune = 0
ONCE longJuly = midSizeLong
ONCE shortJuly = maxSizeShort
ONCE longAugust = 0
ONCE shortAugust = maxSizeShort
ONCE longSeptember = 0
ONCE shortSeptember = maxSizeShort
ONCE longOctober = midSizeLong
ONCE shortOctober = maxSizeShort
ONCE longNovember = midSizeLong
ONCE shortNovember = maxSizeShort
ONCE longDecember = midSizeLong
ONCE shortDecember = maxSizeShort
// calculate TDOM
IF Month <> Month[1] THEN
tradingDay = 0
ENDIF
IF Time = 90000 THEN
IF CurrentDayOfWeek > 0 AND CurrentDayOfWeek < 6 THEN
tradingDay = tradingDay + 1
ENDIF
ENDIF
// set montly multiplier
IF CurrentMonth = 1 THEN
monthlyMultiplierLong = longJanuary
monthlyMultiplierShort = shortJanuary
ELSIF CurrentMonth = 2 THEN
monthlyMultiplierLong = longFebruary
monthlyMultiplierShort = shortFebruary
ELSIF CurrentMonth = 3 THEN
monthlyMultiplierLong = longMarch
monthlyMultiplierShort = shortMarch
ELSIF CurrentMonth = 4 THEN
monthlyMultiplierLong = longApril
monthlyMultiplierShort = shortApril
ELSIF CurrentMonth = 5 THEN
monthlyMultiplierLong = longMay
monthlyMultiplierShort = shortMay
ELSIF CurrentMonth = 6 THEN
monthlyMultiplierLong = longJune
monthlyMultiplierShort = shortJune
ELSIF CurrentMonth = 7 THEN
monthlyMultiplierLong = longJuly
monthlyMultiplierShort = shortJuly
ELSIF CurrentMonth = 8 THEN
monthlyMultiplierLong = longAugust
monthlyMultiplierShort = shortAugust
ELSIF CurrentMonth = 9 THEN
monthlyMultiplierLong = longSeptember
monthlyMultiplierShort = shortSeptember
ELSIF CurrentMonth = 10 THEN
monthlyMultiplierLong = longOctober
monthlyMultiplierShort = shortOctober
ELSIF CurrentMonth = 11 THEN
monthlyMultiplierLong = longNovember
monthlyMultiplierShort = shortNovember
ELSIF CurrentMonth = 12 THEN
monthlyMultiplierLong = longDecember
monthlyMultiplierShort = shortDecember
ENDIF
// all in if first day of month is Monday or Thuesday
IF tradingDay = tradingDayBuy AND ( CurrentDayOfWeek = 1 OR CurrentDayOfWeek = 2 ) THEN
monthlyMultiplierLong = maxSizeLong
ENDIF
// caculate current position profit
posProfit = (((close - positionprice) * pointvalue) * countofposition) / pipsize
// open long position with order cumulation
l1 = tradingDay = tradingDayBuy
l2 = tradingDay > tradingDayBuy AND posProfit < 0
IF ( (l1 OR l2) AND Time = timeBuy) THEN
// check monthly setup and max position size
IF monthlyMultiplierLong > 0 THEN
IF (COUNTOFPOSITION + (positionSize * monthlyMultiplierLong)) <= maxPositionSizeLong THEN
BUY positionSize * monthlyMultiplierLong CONTRACT AT MARKET
ENDIF
ELSIF monthlyMultiplierLong <> 0 THEN
IF (COUNTOFPOSITION + positionSize) <= maxPositionSizeLong THEN
BUY positionSize CONTRACT AT MARKET
ENDIF
ENDIF
stopLoss = stopLossLong
takeProfit = takeProfitLong
ENDIF
// sell short if valid month or close position only
s1 = tradingDay = tradingDaySell
IF ( s1 AND Time = timeSell ) THEN
// check monthly setup and max position size
IF monthlyMultiplierShort < 0 THEN
IF (COUNTOFPOSITION + (positionSize * ABS(monthlyMultiplierShort))) <= maxPositionSizeShort THEN
SELLSHORT positionSize * ABS(monthlyMultiplierShort) CONTRACT AT MARKET
ENDIF
ELSIF monthlyMultiplierShort <> 0 THEN
IF (COUNTOFPOSITION + positionSize) <= maxPositionSizeShort THEN
SELLSHORT positionSize CONTRACT AT MARKET
ENDIF
ELSIF monthlyMultiplierShort = 0 THEN
SELL AT MARKET
ENDIF
stopLoss = stopLossShort
takeProfit = takeProfitShort
ENDIF
// stop and profit management
SET STOP %LOSS stopLoss
SET TARGET %PROFIT takeProfit