I would like to ask if you could do the coding of the following momentum strategy for me so that I can backtest it on Multicharts platform.
It is a simple momentum strategy which would be subsequently tested on daily
data on hundreds of stocks.
We enter a long position, when the stock price rises 3 consecutive days. We
should enter the position immediatelly after the close of the 3rd candle.
Vice versa for a short position. If there are 3 consecutive down days, we
enter a short position.
As for closing the position, I would like to have two possible scenarios
1. The position would be closed after two days (regardless of any other
2. There should be a protective stop loss. SL: should be placed at the last candles low for a long position and at the last candles high for a short position. SL should be placed immediately at the beginning of a trade and should stay where it is for the whole time (no trailing SL).
Second version of closing
1. The position would be closed when the trend ends, meaning that: Long
position would be closed when first down day occures, short position would be
closed when first up day occures
2. There would be a stop loss as well. The same SL settings as for the first version should be used.
Specifications: The system will be backtested on daily data, so the SL does not have to to be coded in a way it can be triggered intrabar, because it can only be triggered by daily close.