Hi,
So, using my initial framework, this time I tried a trend based strategy for trading which makes use of a profit target to exit and an rsi indicator for its entry. The strategy performs very well achieving a return of over 1400%. Starting with cash $2000 I end up with just over $30000 over a period of almost 10 years. It achieves a win rate of 89% which a constant amount of risk per trade. To balance the portfolio, I use a few symbols at a time. The strategy performs very well and with better indicators may perform even better.
It would be fun to discuss what other indicators may do and may perform even better.
Stefano Raggi
@Deval, with the current master code, no fees are charged for limit or stop orders, if they are not filled.
Joaquin
I have shared it with you. It's basically your strategy, with some minor changes, as I use Oanda as my broker. As you can see, backtests work ok, the strange behaviour is when trading live.
I know your strategy maybe would give better results with other setups (other indicators and different entries/exits), but I do like your risk mgmt and would like to try this risk mgmt with other already winning strategies.
Jared Broad
Hey @Joaquin the Oanda data set isn't quite processed all the way! We're tidying up our FX data now and it should be ready for an Oanda market test / downloading within a week or two.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Paul deauna
cheers
Stephen Oehler
Deval, if there was an award for well-organized code, you would win it :-)
Deval Keralia
@Stephen Thanks a lot man. Much appreciated.
Zhaohao Liang
@Deval the fees is much lower than the live trade,please check the total lot and fee of a backtest result, it's a profitable stragery though, but the equity curve is no so smooth and the profit is lower.
T. ubay
Paul deauna
Genorse Gilbert
I am getting errors with this line of code from the clone above:
Securities[symbol].VolatilityModel = new ThreeSigmaVolatilityModel(STD(symbol, 390, _dataResolution));
and the error reads: Cannot implicitly convert type ...ThreeSigmaVolatilityModel to ...IVolatilityModel.
How do I properly cast that line of code so that they match? Thanks.
V/R,
Geno
JayJayD
Genorse Gilbert, the IVolatilityModel interface changed since Deval Keralia developed this algorithm.
Now you have to implement the GetHistoryRequirements method.
If you'll not use the algorithm in live mode you can just add the following code to ThreeSigmaVolatilityModel:
public IEnumerable<HistoryRequest> GetHistoryRequirements(Security security, DateTime { return Enumerable.Empty<HistoryRequest>(); }
Pongpanot Chuaysakun
Quant Stratege
This algorithm is no more working, I got the following errors when I backtest :
Backtest Error: Error initializing algorithm: This may be because history is using fake data while pre-analyzing an algorithm for a backtest
Backtest Error: Error initializing algorithm: Calling this method on a Forex or CFD security will return an empty result. Please use the generic version with QuoteBar type parameter.
Could you please provide some workarround ?
Thanks for your help.
Michael Manus
hi, have you tried it with the changes mentioned above by jayjayd?
JayJayD
Yes, I made this implementation based in Deval Keralia work.
Quant Stratege
Still have same error at backtest init : Error initializing algorithm: This may be because history is using fake data while pre-analyzing an algorithm for a backtest
I have implemented interface GetHistoryRequirements has mentionned
Jianwei Wang
Got same error as Mat L.
ERROR:: Calling this method on a Forex or CFD security will return an empty result. Please use the generic version with QuoteBar type parameter.
Any Idea please?
Ryan Brickey
Ryan Brickey
Viann
Deval Keralia
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!