hi!
I'm developing a simple trading strategy in which, using a CSV file, every day a list of financial instruments is bought at a certain time (in hours and minutes) and is liquidated at a certain time. I will include stop losses and take profits but a later stage. I parse the data from my CSV correctly and it is stored on a df, where I retrieve it correctly with no problems.
The problem I have is that I can't find a way to "link" correctly the scheduled event buy or sell action to the relative stock. I've tried using a for loop but this way I can't "link" the correct schedule time of the day to the relative stock.
Emiliano fraticelli
this is the structure of the CSV file, but again the problem is not there. I correctly get the data in the df
https://ibb.co/RQPrZFYEmiliano fraticelli
I've tried using datetime and imposing to make the trade relative to the instrument only at a specific time (in hours and minutes) but it does not work
Emiliano fraticelli
Ok, solved by myself this way
Emiliano fraticelli
ok, solved by myself using this code
Emiliano fraticelli
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!