Skip to content

Conversation

@Martin-Molinero
Copy link
Member

@Martin-Molinero Martin-Molinero commented Jan 18, 2019

What does this implement/fix? Explain your changes.

  • Increasing minor version to 14
  • Adding UnsafeDispose() for PyObject which does not require
    acquiring/releasing the lock, for performance
  • Adding check before calling SetArgsAndCause for the ClrObject, the
    call only makes sense when we are an exception and causes an overhead.
    3 seconds out of 43s.

Master Samplig:
imagen

Algorithm:

from clr import AddReference
AddReference("System")
AddReference("QuantConnect.Algorithm")
AddReference("QuantConnect.Common")

from System import *
from QuantConnect import *
from QuantConnect.Algorithm import *
import numpy as np

from datetime import timedelta

class BasicTemplateAlgorithm(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2015,1,1)
        self.SetEndDate(2018,1,1)
        self.SetCash(100000)

        self.symbols = [Symbol.Create(x, SecurityType.Equity, Market.USA)
                        for x in ["SPY", "GOOG", "AAPL", "FB", "AMZN"]]

        self.AddEquity("SPY", Resolution.Minute)
        self.UniverseSettings.Resolution = Resolution.Minute
        self.AddUniverse(self.CoarseSelectionFunction)

    def OnData(self, data):
        pass

    def CoarseSelectionFunction(self, coarse):
        return self.symbols

- Increasing minor version to 14
- Adding `UnsafeDispose()` for `PyObject` which does not require
acquiring/releasing the lock
- Adding check before calling `SetArgsAndCause` for the `ClrObject`, the
call only makes sense when we are an exception and causes an overhead
@jaredbroad jaredbroad merged commit 877e510 into QuantConnect:master Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants