MazParticipant
Veteran
Hi again,
Found another quirky logic for which I’m not sure on the premise:
For the selling Short (or exiting long) side, we are setting stop losses and targets to stopLossShort and takeProfitShort REGARDLESS of whether we actually took a short trade or not. So in other words we might still be LONG on the market – we tested for contitions to go short but may not have actually placed a short trade – yet nevertheless we reset stop loss and targets to the short set of variables whilst we are still potentially in a long trade.
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 // this will never occur
IF (COUNTOFPOSITION + positionSize) <= maxPositionSizeShort THEN
//SELLSHORT positionSize CONTRACT AT MARKET
ENDIF
ELSIF monthlyMultiplierShort = 0 THEN
SELL AT MARKET
ENDIF
// ****** THESE GET TRIGGERED REGARDLESS OF WHETHER WE ARE ACTUALLY LONG OR SHORT ON THE MARKET *****
stopLoss = stopLossShort
takeProfit = takeProfitShort
// NOTE: As per above logic we may not have actually gone short
// ************************************* //
ENDIF
CNParticipant
Senior
What is the difference in result?
MazParticipant
Veteran
…and same goes for the long side – long stops and targets are set regardless of whether we actually look a long or not… ie we may actually be short at the time of setting the stops and targets to the long variables. If you stick a “graph countofShortShares” above the two lines that set the stops for the long you’ll see the conditions where we amended stops for the long side but were actually short and vice versa
// for the long side
graph countOfShortShares // should always be 0??
stopLoss = stopLossLong
takeProfit = takeProfitLong
// ...
// and for the short side
graph countOfLongShares // should always be 0?
stopLoss = stopLossShort
takeProfit = takeProfitShort
MazParticipant
Veteran
Obviously the results are very different with any amendments to any line. I’m unsure what the author intended. But obviously optimizations can be applied upon any form of quirk and still be profitable (or even more profitable) perhaps without realizing. But it’s important to understand the underlining premise and see if the conditional logic matches that premise.
CNParticipant
Senior
Thanks @Maz Awesome as usual
@Reiner, what would you say to the discorvery that Maz did?
Hallo Rainer,
da ich neu bin zuerst einmal herzlichen Dank für die genialen Strategien.
Bin gerade dabei Deinen Navigator Dax 4H zu testen … unfassbar …
Nur eine wichtige Frage … beim backtest in kleineren Einheiten = 100-1000,
frisst sich die Liquidität auf bzw. hat er extreme Abstürze … bei 200 Einheiten von 80.000€ auf unter 30.000€ … muss ich den SL irgendwie anpassen???
1000 Dank im Voraus
Dominik
Hey Dominik,
you are using the full Dax CFD Contract. Try the one 1 Euro Mini Contract 😉
Hey flowsen123,
thanxxxs 🙂
Is the a different between Germany 30 Standard and Mini???
It is the same Index??? 😢😊
sunny greeting
dominik
@Dominik
Yes it is the same one, but the Mini is only 1€/point.
Hi team,
I’m just discovering this trading strategy. And I would like to understand if this strategy is running live for someone? (I saw the discussion about backtests showing not so good results..)
I did not understand the last remarks from Maz..Do I need to change the V1 or V2 version before running it in my demo?
Thanks!
I’ve imported the code but it does not seem to work. I do not understand why! Can someone help me?
wp01Participant
Master
@fepabe,
You should take the mini DAX instead of the normal DAX.
I used the V2 version and it seems to work. The problem is that the results are different from those posted by you. I used the Mini Dax and Micro Dax (5 and 1 euro). I still not understand. The V1 version continues to fail. I find a lot of difference between the “gain of the best trade” and the “loss of worst trade”.
Thanks
Good Morning,
I have been using the V2 version of the Navigator System in the demo account since March and the results do not correspond exactly with the backtest ones. Anyway, the drowndown of V2 is still very high.
I have modified some code parameters to reduce the drowndown and, although it only performs half of operations. I leave the code.
Is someone running it on a real account?
Best regards.
// Navigator DAX 4H V2 (5K)
// 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 2
// 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 = 20
ONCE tradingDayBuy = 8
// define intraday trading window
ONCE timeSell = 090000
ONCE timeBuy = 170000
// define position and money management parameter
ONCE positionSize = 1
ONCE maxPositionSizeLong = 4
ONCE maxPositionSizeShort = 4
ONCE minSizeLong = 1
ONCE midSizeLong = 2
ONCE maxSizeLong = 4
ONCE maxSizeShort = -10
ONCE stopLossLong = 8 // in %
ONCE takeProfitLong = 3 // in %
ONCE stopLossShort = 2 // in %
ONCE takeProfitShort = 1.25 // in %
ONCE maxCandlesLongWithProfit = 40
ONCE maxCandlesShortWithProfit = 6
ONCE maxCandlesLongWithoutProfit = 41
ONCE maxCandlesShortWithoutProfit = 13
// 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
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
SET STOP %LOSS stopLoss
SET TARGET %PROFIT takeProfit