Back

Scaedule Trading According To Data

Hey all,
Pretty new around here.
Wrote a simple algorithm which backtesting of buying and selling according to different avarages of data of BTCUSD values.
On some live trading services there's a limit for the amount of tradig you can do in a certain amount of time.
I would like to simulate that.
Saw the schedule options but all the examples talked about using the schedule options from the Initialize method, which makes since but, how can I write a function which will be called due to this schedule on and will act according to data like what happens in the ondata function?

* I'm using python.

Thanks ahead,
Eyal

Update Backtest








there is an schedule example provided by the quantconnect team maybe that helps:

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/ScheduledEventsAlgorithm.py
0

Thanks Michael, already played with that example.
The thing is I want to do the same with an event that will call a function which get the same data that the onData function get, but only this time it will be scheduled. Lets say call onScheduleData(self, data) every 10 mintues. But I don't know how to access that data without using the onData event function which being called each time data comes.
Since the data comes once in a minute, guess I can implement that by counting but knowing about the scheduling events option wondered if there's also built in option for that too.
 

0

yep simple count is the way to go.

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