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!
Artemiusgreat
1. If you previous price / bar, try 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
Crash Overide
Thanks I'll give the TotalProfit and last profit a try!
Crash Overide
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!