Back

Executing a scheduled trade correctly

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.  

Update Backtest








0

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.


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/RQPrZFY

 

0

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

0


Ok, solved by myself this way

 

0


ok, solved by myself using this code

0


Update Backtest





0

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.


Loading...

This discussion is closed