I would like to introduce a very nice and simple strategy. Unfortunately it is not mine. I found it on https://www.trading-treff.de/wissen/handelsstrategie-fuer-daytrader-im-eurusd-backtest-inklusive and rebuilt it once. It just make Short-Trades, because Long-Trades would increase the Equity curve. As you can see, it works quite well (Spread: 1). If someone can test it for a longer period of time, that would be nice. If someone had an idea to minimize the drawdowns a bit, it also would be nice.
// Festlegen der Code-Parameter
DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
// Das Handelssystem wird um 0:00 Uhr alle pending Orders stornieren und alle Positionen schließen. Es werden vor der "FLATBEFORE"-Zeit keine neuen Orderaufträge zugelassen.
DEFPARAM FLATBEFORE = 100000
// Stornieren aller pending Orders und Schließen aller Positionen zur "FLATAFTER"-Zeit
DEFPARAM FLATAFTER = 140000
// Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen vor einer bestimmten Uhrzeit
noEntryBeforeTime = 100000
timeEnterBefore = time >= noEntryBeforeTime
// Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen nach einer bestimmten Uhrzeit
noEntryAfterTime = 140000
timeEnterAfter = time < noEntryAfterTime
// Verhindert das Trading an bestimmten Wochentagen
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// Bedingungen zum Einstieg in Short-Positionen
indicator1 = Average[200](close)
c1 = (close < indicator1)
IF c1 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
SELLSHORT 5 CONTRACT AT MARKET
ENDIF
// Stops und Targets
SET STOP %LOSS 1
PaulParticipant
Master
Hi imokdesign
Thanks for sharing! Did give it a spin and I’am surprised about the results!
defparam cumulateorders = false
DEFPARAM FLATBEFORE = 100000
DEFPARAM FLATAFTER = 140000
noEntryBeforeTime = 100000
timeEnterBefore = time >= noEntryBeforeTime
noEntryAfterTime = 140000
timeEnterAfter = time < noEntryAfterTime
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
indicator1 = Average[200](close)
c1 = (close < indicator1)
if c1 and timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
sellshort 5 contract at market
endif
SET STOP %LOSS 1
Paul, i have good result but maybe not enough history. Could you test 200K on UT1 with
indicator1 = Average[50](close)
Maybe interesting with the frequency per day and a higher position size. What are you thinking about it ?
PaulParticipant
Master
it’s not good enough
perhaps I will work on it later
AbzParticipant
Veteran
hello
backtest from april 2006 , it performs much better with average 50 rather than 200. Attached result are for average 50
I try this system on ut1, but it’s stop by pro order. That’s often the case with ut1. Someone know why and how to avoid that?
The best results are with the average between 70 and 120
indicator1 = Average[80](close)
Tips: you can backtest this strategy with a 1hour timeframe, it give very similar results and the backtest is much longer.
Also, you can reduce the %LOSS to 0.5-0.75
It does not affect the G/L ratio, but it helps to reduce the max loose for 1 trade.
I join you the report with TF=1hour, spread=0.6, average=80, %LOSS=0.75
What if you still pay attention to the moneymanagement. I like the argument of the compound interest. I inserted it from this link:
https://www.prorealcode.com/blog/learning/money-management-prorealtime-code/
I hope I have inserted this correctly … does not look bad, but I have not tested if that works. (EUR/USD mini)
// Festlegen der Code-Parameter
DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
// Das Handelssystem wird um 0:00 Uhr alle pending Orders stornieren und alle Positionen schließen. Es werden vor der "FLATBEFORE"-Zeit keine neuen Orderaufträge zugelassen.
DEFPARAM FLATBEFORE = 100000
// Stornieren aller pending Orders und Schließen aller Positionen zur "FLATAFTER"-Zeit
DEFPARAM FLATAFTER = 140000
// Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen vor einer bestimmten Uhrzeit
noEntryBeforeTime = 100000
timeEnterBefore = time >= noEntryBeforeTime
// Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen nach einer bestimmten Uhrzeit
noEntryAfterTime = 140000
timeEnterAfter = time < noEntryAfterTime
// Verhindert das Trading an bestimmten Wochentagen
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// Bedingungen zum Einstieg in Short-Positionen
indicator1 = Average[80](close)
c1 = (close < indicator1)
REM Money Management
Capital = 1000
Risk = 10
StopLoss = 0.75 // Could be our variable X
REM Calculate contracts
equity = Capital + StrategyProfit
maxrisk = round(equity*Risk)
PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)
// SELL order example
IF c1 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry then
SELLSHORT PositionSize CONTRACTS AT MARKET
ENDIF
// Stops und Targets
SET STOP %LOSS StopLoss
I noticed that the author runs the moving average on a daily basis. that would be multitime. It would also work so far, except that sometimes whole months are not traded.
i think is more or less exactly the same as the other “Short the eur/usd in this time” code which is on this forum? Cant find it right now but its not old either. I do belive the other one looks better than this one. Someone dig it up! 🙂
I Just want to update this thread, with very little improvement (more histroy). Its the Resault with the max Profit and not with the min Drawdown. With SMA80 there is a big Drawdown from 2012 -2016. With the SMA 14 its much better but since 2020 a little worse.
indicator1 = Average[14](close)