Ejemplo n.º 1
0
        /// <summary>
        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
        /// </summary>
        public override void Initialize()
        {
            SetStartDate(2019, 1, 23);  //Set Start Date
            SetEndDate(2019, 10, 31);   //Set End Date
            SetCash(100000);            //Set Strategy Cash

            // Find more symbols here: http://quantconnect.com/data
            // Equities Resolutions: Tick, Second, Minute, Hour, Daily.
            AddEquity("YESBANK", Resolution.Minute, Market.India);

            //Set Order Prperties as per the requirements for order placement
            DefaultOrderProperties = new IndiaOrderProperties(exchange: Exchange.NSE);
            //override default productType value set in config.json if needed - order specific productType value
            //DefaultOrderProperties = new IndiaOrderProperties(exchange: Exchange.NSE, IndiaOrderProperties.IndiaProductType.CNC);

            // General Debug statement for acknowledgement
            Debug("Intialization Done");
        }
        /// <summary>
        /// Initialize your algorithm and add desired assets.
        /// </summary>
        public override void Initialize()
        {
            SetAccountCurrency("INR"); //Set Account Currency
            SetStartDate(2019, 1, 1);  //Set End Date
            SetEndDate(2019, 1, 5);    //Set End Date
            SetCash(1000000);          //Set Strategy Cash

            // Use indicator for signal; but it cannot be traded
            Nifty = AddIndex("NIFTY50", Resolution.Minute, Market.India).Symbol;

            //Trade Index based ETF
            NiftyETF = AddEquity("JUNIORBEES", Resolution.Minute, Market.India).Symbol;

            //Set Order Prperties as per the requirements for order placement
            DefaultOrderProperties = new IndiaOrderProperties(exchange: Exchange.NSE);

            _emaSlow = EMA(Nifty, 80);
            _emaFast = EMA(Nifty, 200);
        }