Back

Error encountered in live testing

My algorithm is working fine while I was backtesting it but it stopped working when I went live with Paper trading. I am getting following error for bunch of different symbols and none of my trades are getting executed:

Backtest Handled Error: The order quantity for RDSB cannot be calculated: the price of the security is zero.

Here is my initialized function:

def Initialize(self):

        self.SetStartDate(2007, 1, 1)                          # Set Start Date: Right after original paper published
        self.SetEndDate(2020, 3,31)                           # Set End Date
        self.SetCash(100000)                                   # Set Strategy Cash
        self.SetBenchmark("SPY")
        # Download Fama French factors data as a dataframe
        self.fama_french_factors_per_day = self._get_fama_french_factors()
        self.SetBrokerageModel(NoFeeBrokerageModel(self))

        self.number_of_coarse_symbol = 200                     # Set the number of coarse symbol to be further filtered by expected skewness
        self.bottom_percent = 0.025                             # Set the bottom percent to long out of coarse symbols according to skewness ranking
        self.weights = {}                                      # Dictionary to save desired weights with symbols as key
        self.nextRebalance = self.Time                         # Define next rebalance time

        self.UniverseSettings.Resolution = Resolution.Daily    # Subscribe daily data for selected symbols in universe
        self.AddUniverse(self.CoarseSelectionAndSkewnessSorting, self.GetWeightsInFineSelection)

 

Thanks in advance for the help.

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.


Hey Manoj,

It's difficult to debug the issue without seeing the live deployment. Please submit a live support ticket with your live deployment attached. You can learn how to submit a live support ticket in this YouTube video.

Best
Rahul

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