Hello,
I create a code to trade EUR/USD 1h. The globals results look correct but there are certainly many things to improve it. It uses moving average and RSI in MTF.
What is interesting are that risk is short and Profit/Loss >= 1.2, every years win since 2015 (only 1 quarter real lost)
What can be improve are the enter in position (cross MM), didn’t work before 2015.
In ITF file, i double short than long, that’s why the results looks different. In screenshot, i use 2 contracts Sell and buy with 2000€ capital
I didn’t use walkforward yet.
Please tell me what do you think about it.
// Définition des paramètres du code
DEFPARAM CumulateOrders = false // Cumul des positions désactivé
DEFPARAM Preloadbars = 6000
// Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiés
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
//////////////////////////////////////////////////////////////////////
// Timeframe Weekly
Timeframe (weekly)
LgW1 = RSI[21] > 30
LgW = LgW1
// Timeframe Daily
Timeframe (daily)
// positions Longs
Lg1 = RSI[21] > 40
//Lg2 = RSI[21] < 57
LgDly = Lg1
// Positions Shorts
Ss1 = RSI[21] < 65
Ss2 = average[20] < average[20](10)
ShDly = Ss1 and Ss2
// Timeframe 4 heures
Timeframe (4 hours)
// Positions Longs
L1 = Close > average[15]
//L2 = average[20] > average[20](1)
L3 = RSI[21] > 49
L4 = RSI[21] < 80
LgH4 = L1 and L3 and L3 and L4
// Positions Shorts
S1 = Close < average[30]
S2 = average[30](10) > average[30]
//S3 = average[20] > average[50]
//S4 = average[50](5) > average[50]
S5 = RSI[21] < 60
S6 = RSI[21] > 40
ShH4 = S1 and S2 and S1 and S1 and S5 and S6
//////////////////////////////////////////////////////////////////////
// Timeframe 1 heure
Timeframe(default)
// Conditions pour ouvrir une position acheteuse
indicator1 = RSI[21](totalPrice)
c1 = (indicator1 > 50)
indicator2 = Average[100](close)
c2 = (close > indicator2)
//indicator3 = Average[25](close)
//indicator4 = Average[35](close)
//c3 = (indicator3 > indicator4)
indicator5 = Average[10](close)
c4 = (close CROSSES OVER indicator5)
indicator6 = Average[35](close)
c5 = (close > indicator6)
IF (c1 AND c2 AND c2 AND c4 and c5 and LgH4 and LgDly and LgW) AND not daysForbiddenEntry THEN
BUY 5 CONTRACT AT MARKET
ENDIF
// Conditions pour ouvrir une position en vente à découvert
indicator7 = RSI[21](totalPrice)
c6 = (indicator7 < 49.5)
indicator8 = Average[100](close)
c7 = (close < indicator8)
indicator9 = Average[25](close)
indicator10 = Average[35](close)
c8 = (indicator9 < indicator10)
indicator11 = Average[10](close)
c9 = (close CROSSES UNDER indicator11)
indicator12 = Average[15](close)
c10 = (close < indicator12)
IF (c6 AND c7 AND c8 AND c9 and c10 and ShH4 and ShDly ) AND not daysForbiddenEntry THEN
SELLSHORT 10 CONTRACT AT MARKET
ENDIF
// Stops et objectifs
SET STOP pLOSS 31
SET TARGET pPROFIT 40
Equity Curve looks okay on 15 min TF.
But despite chopping out loads of conditions, it does not take any Short trades?
Do you see Short trades?
In 1 hour default time frame, it takes shorts. Ratio are also better in short. You can see it in detail report above.
Hello guys,
I share you results of this program after 4 weeks in reel account. It looks pretty good, better than back test.
Looks good. I have never had any joy with forex but this seems worth a try, thanks for sharing!
Hello
well done for your work
I wanted to know on which line to modify the quantity of lots sold or bought ?
Hello Ayrton,
If you want buy, it’s line 87 (5 contracts) and for sellshort it’s line 104 (10 contracts). I choose sell more than buy because statistics are better by this way.
Have fun
Here are news after 5 months in real account.
Not so bad for a simple code
I certainly will developp different codes for Short and Long.
I think it should give better result. I will share you results
Fast try with short only.
I mean specific code for short and long.
I find it a little bit better. 1 contract long and 2 contracts in shorts for the presents tests.
Results are quite good since 2018. Not so good before. It means it needs upgrade parameters every 6 months or year.
It looks good. Can you share the itf file?
Thx. I´ll check it tomorrow.