Here’s one of my code examples, which clearly shows that we can win when the stock market drops !
This code is favorable on most indices and shares. On the CAC40, it is very efficient.
The rules are simple : you enter short if :
– The closure is < 200 days moving average
– There are 4 new high closing days
We close the position as soon as it closes < the 5 days moving average.
Coupled with a strategy to buy in bullish market, this strategy can let you earn more money !
Here is the code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
DEFPARAM CumulateOrders = False n = 4 // Conditions pour ouvrir une position VENDEUSE c1 = close < Average[200](close) c2 = close > close[1] and close[1] > close[2] and close[2] > close[3] IF c1 and c2 THEN SELLSHORT n shares at market ENDIF // Condtions pour fermer une position vendeuse IF close < Average[5](close) THEN EXITSHORT at market ENDIF |
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
@doctrading – Do you trade any of these strategies with real money – manually or automated?
Hello Stef,
I post some codes, many on the CAC40, but of course I don’t use 4 codes for buying the CAC40 !
I have a similar but far more efficient strategy, that I trade manually (It’s a combination of some of the most effective of them), on the CAC40. My own strategy makes +33% / year with a drawdown of max 20% even with reinvesting earnings, >3 profit factor and 75% winning positions. It’s the reward of months / years of researches and hard work.
But we can’t trade automatically on the CAC40 (it is an index), on the FRA40 (CFD) because the opening and closing times are not the same, so the backtests are far different. My backtests are for the CAC40, but I take position on the FRA40 CFD, so I take position manually. With 5 orders / month, it only takes a few minutes.
So, I look for my indicator, if I must take position or not at 9 AM, and I enter manually position.
But you can trade automatically with some strategies : the “Breakout CAC40” in M15 (the code is available in one of these posts), some algorithms on stocks, forex, etc. I personally use also an algorithm on the DAX and on stocks.
Best Regards,
@doctrading – Hi, is your algorithm on the DAX posted here? Thanks.
@doctrading – Hi, is your algorithm on the DAX posted here? Thanks.
Hello Bobtrader,
No, it isn’t posted here, as it is for sale on my website.
On “ProRealCode” I will post some nice strategies for everybody. For example, you can use this “short strategy” for the CAC40, with a “long strategy” for the CAC40, such as the “Cumulative RSI” (that Nicolas posted) or the “RSI 2” (that I did post).
With those 2 strategies you can trade the CAC40 quite well !
Strategies for sale usually are not worth their money, ’cause if they were, the author would use them to make money himself and trade them. When they are not suitable to make money, he sells them instead to the ignorant public.
Thats not cool at all.
Hello,
I improved your algorithm by adding long positions:
“`
DEFPARAM CumulateOrders = False
n = 4
// Conditions pour ouvrir une position VENDEUSE
c1 = close close[1] and close[1] > close[2] and close[2] > close[3]
c3 = close > Average[200](close)
c4 = close close[2] and close[2] > close[3]
IF c1 and c2 THEN
SELLSHORT n shares at market
ENDIF
// Condtions pour fermer une position vendeuse
IF close < Average[5](close) THEN
EXITSHORT at market
ENDIF
// Condition pour ouvrire une position ACHTEUSE
IF c3 and c4 THEN
BUY n shares at market
ENDIF
// Condtions pour fermer une position vendeuse
IF close < Average[50](close) THEN
SELL at market
ENDIF
SET STOP LOSS 60
SET TARGET PPROFIT 85
“`
What do you think it?