Good day everyone , I am a novice in programming and I need help with making an algorithm that is able to trade forex news events. I decided to try and use an algorithm for backtesting purposes and to be able to execute trades faster while trading live during these events. I came across a universe template that reads data from a csv file stored in dropbox and I tried to modify it but this has amounted to plenty of errors. I wanted my algo to basically read event dates from the csv file and use it as an input in executing a scheduled event. so instead of manually setting dates and time , I want the algo to read the directly from the file and place orders 3 minutes before the news release. I have spent several weeks trying to get a hang arount this. Anybody's input would be highly appreciated.
The link below is for the csv reading Algo.
Algorithm.Python/DropboxBaseDataUniverseSelectionAlgorithm.py
Douglas Stridsberg
Hi,
The algorithm you attached has none of the features you describe in your post - are you sure you've attached the correct one?
I would recommend firstly going through the Bootcamp sections - these will teach you a lot about how the framework operates, and you'll be able to answer most of your own questions through there. Also, using the Documentation will be a great help.
Theo Wesley Sekgetho
Hey
The algorithm I attached is basically an example I got hold of which only reads CSV data from Dropbox to determine which symbol to trade. I cloned it to my lab and tried to alter it to meet my specifications.
Link Liang
Hi Theo,
First of all, I have trouble opening your link of csv reading script. For executing an action at specific time, there are many ways besides self.Schedule.On(). Here is a quick example that might work with your design:
from datetime import timedelta
...
def Ondata(self)
if self.Time == your_release_time_list[next_release] - timedelta(minutes=3):
self.DoSomething()
def DoSomething(self):
# your algo here
Since you want minute-level time scheduling, please make sure your data resolution is also minute level.
Hope it helps!
Theo Wesley Sekgetho
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!