Back

Is there a way to get previous Day performance?

Hi Guys,
Is there a way to get the previous days performance? I want to implement an anti martingale strategy where if yesterdays performance was negative I would half my unit size during today's trading.

Anyone know where the documentation would be for a command like that or would I need to somehow get orders closed previous day?

Any thoughts would be appreciated :D 

Thanks!

Update Backtest








1. If you previous price / bar, try History()

https://www.quantconnect.com/forum/discussion/2947/error-with-history

2. If previous order closed by Stop Loss, you can try this

Portfolio["IBM"].LastTradeProfit 

3. In any case, you can check Portfolio.TotalProfit, at the beginning it's equal to 0, then it adds result of each trade, save its value when you open position, next time when you open second position compare actual value with saved

https://www.quantconnect.com/docs#Overview
1

Thanks I'll give the TotalProfit and last profit a try! 

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