Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers.
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:
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
What does this implement/fix? Explain your changes.
UnsafeDispose()
forPyObject
which does not require acquiring/releasing the lock, for performanceSetArgsAndCause
for theClrObject
, the call only makes sense when we are an exception and causes an overhead. 3 seconds out of 43s.Master Samplig:
Algorithm: