Hello fellow quants. I'm having some issues with inserting data into my algorithm. It seems to be with the pricing but I don't know if the issue is somewhere else in my code. This algo first checks that the 100 hour SMA is above or below the price, then if there's an EMA crossover in it's favor, it takes a Long/Short position and sets a Stop Loss and Take Profit. I then plot my points, but it seems like it's either not being plotted correctly, or it is being plotted correctly but the data is off. And lastly, you can see no matter how many backtests I do with different values, in the beginning the Equity always plummets, then starts evening out. Can someone please look over this and help me out?
Varad Kabade
Hi Xavier Lopez,
The above algorithm is using the same series/chart to plot the sl/tp values of both types of position (Long/Short). We recommend using a separate chart or series for the above algorithm. The above algorithm has a minute resolution and runs for one year; due to the charting limitation, data points are skipped. We recommend limiting the plotting frequency.
Best,
Varad Kabade
Faultsaycool
Thank you Varad. Could you please explain what you mean by using a separate series? I’m not sure how to implement it as it’s my first time hearing about this method.Â
Varad Kabade
Hi Xavier,
A Series is a class that interacts with a Chart object. A Chart object include many Series objects:
Â
In the above example in the Chart object "Trade Plot" we create a Series object 'Buy' and add it to our chart object.
Refer to the following doc for more information.
Best,
Varad Kabade
Faultsaycool
Thank you Varad. I will try this out. Do you know why the algorithm is taking such a huge dip in the beginning no matter what time frame I use? It's very strange behavior.
Faultsaycool
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!