Hi all,
This is my first entry, so please forgive and advise if I’m doing something wrong.
Created a very basic strategy using Bollinger and Exponential Moving Average. Strategy tested on South African Top 40.
BUY: Price above 1 std and EMA[20] crosses over EMA[50].
SELL: Price below EMA[20]
Some observations:
- Not doing any short selling on this (yet). My initial idea is to create a relatively low risk/low return strategy for now.
- Work well on 10min bars, but less so on 15min and 5min. Should it be a concern if a strategy seem so specific to a particular time.
- Number of gains and losses are very similar. I set a very small stop-loss (0.5%) to try and get out of any loss making trade as soon as possible.
Any comments/feedback will be highly appreciated.
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
indicator1 = Average[20](close)
indicator2 = Average[50](close)
c1 = (indicator1 CROSSES OVER indicator2)
indicator3 = close
indicator4 = Average[20](close)+std[20](close)
c2 = (indicator3 >= indicator4)
c3 = (indicator3 <= indicator4)
IF c1 AND c2 THEN
BUY 2 CONTRACT AT MARKET
ENDIF
IF c3 THEN
SELL 2 CONTRACT AT MARKET
ENDIF
// Stops and targets
SET STOP %LOSS 0.5
SET TARGET %PROFIT 5
WingParticipant
Veteran
Hello.
The amount of trades, 53, is not enough to evaluate the robustness of this system. Try the system with more data, on another index/commodity, and/or add a short side to give you more simulated trades.
Since the system is not intraday only, know that overnight fees may add to the transaction costs. Since it can sell at any time of day, the spreads will also be different.
A profit target and stop loss based on averagetruerange[10] might do better than one that does not take volatility into account.
If you can, optimize your SL and TP on at least 100 trades, then test the resulting system OOS (out-of-sample). This will tell you if the system can be trusted or not to function in an unknown environment.
Thank you for posting your trading strategy code. I have moved your submission from the Library pending queue to a new forum topic instead. Like Wing has already said, your strategy would need further investigation and improvement as it seems it were only tested on a short time period. What is the SA40 spread?