Hi all,
The idea of this code does not come from me, but I wanted to test it.
The results are certainly not that great, but look promising on many actions.
However, I am disappointed with the CAC40 , whereas the code provides more than respectable performance on many actions.
The screenshot shows : the CAC40 , Total, Natixis, Sanofi. I think there’s frankly way to improve it, even if I have not yet tried .
You can test it, improve it, and have fun with it.
Good weekend to all !
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
DEFPARAM CumulateOrders = False // Cumul des positions désactivé n = 10000/close // I did set n = 2 for the CAC40 mmc = 6 // moyenne mobile courte mml = 14 // moyenne mobile longue // Conditions pour ouvrir une position acheteuse indicator1 = Average[mmc](RSI[14](close)) indicator2 = Average[mml](RSI[14](close)) c1 = (indicator1 CROSSES UNDER indicator2) IF c1 THEN BUY n SHARES AT MARKET ENDIF // Conditions pour fermer une position acheteuse c2 = (indicator1 CROSSES OVER indicator2) IF c2 THEN SELL AT MARKET ENDIF // Conditions pour ouvrir une position en vente à découvert c3 = (indicator1 CROSSES OVER indicator2) IF c3 THEN SELLSHORT n SHARES AT MARKET ENDIF // Conditions pour fermer une position en vente à découvert c4 = (indicator1 CROSSES UNDER indicator2) IF c4 THEN EXITSHORT AT MARKET ENDIF // Stops et objectifs //set stop %loss 5 |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
I wonder how this fairs on 5 or 15 mins. Maybe 21 or 25 instead of 14 .
Hello, you can test it. It’s not my best strategy… but I think someone can improve it.