Back

Some question about coding

Hi Quantconnect,

Firstly, thank for your support. With your help, I can do some simple example with Quantconnect.

But I met another issues, please give me some advise.

1. About TimeSpan.FromDays(7), my target is running this code for stock, it only work 5 day per week.
So in the input value of TimeSpan.FromDays(7) is it 7 or 5?

2. About the ATR, I create one daily ATR and Register it in to week, but it fail.
ATR can not Register like example you gave me.

3.How can I call to get the data from previous, like on 2015/04/02 I call back to check data of the day 2015/04/01.

4. On the method OnData(TradeBars data), I want to get the value open,close,high,close of this day or week but don't know how.

5. Do you have any easy way to debug Quantconnect, like print or some think like that

I attach my project as below, please give me some advise.

Thanks,
Linh

P/S: I post on my old topic but no respond, please help me
Update Backtest








1) Is this because trading only occurs 5 days of the week?
3) You will have to write code to "remember" the previous day's price. You could do decimal _prevdayprice; at the top of your code then at the end of the day make _prevdayprice = data[symbol].Close;
5) Try the Log function. e.g.
Log("Buying AAPL at " + Time.Hour + " " + Time.Minute);
0

Hey ?ào, check out my answer on the old post.

Let me know over there if it helps, if not I can whip together a specific example for you.
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.


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