mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-27 21:21:30 +08:00
MAINT: process_order is a method
and call super's __init__ to set up base state
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
from __future__ import division
|
||||
|
||||
from abc import ABCMeta, abstractmethod, abstractproperty
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import math
|
||||
from six import with_metaclass, iteritems
|
||||
from toolz import merge
|
||||
@@ -91,7 +91,7 @@ class SlippageModel(with_metaclass(ABCMeta)):
|
||||
def volume_for_bar(self):
|
||||
return self._volume_for_bar
|
||||
|
||||
@abstractproperty
|
||||
@abstractmethod
|
||||
def process_order(self, data, order):
|
||||
"""Process how orders get filled.
|
||||
|
||||
@@ -198,11 +198,11 @@ class VolumeShareSlippage(SlippageModel):
|
||||
def __init__(self, volume_limit=DEFAULT_EQUITY_VOLUME_SLIPPAGE_BAR_LIMIT,
|
||||
price_impact=0.1):
|
||||
|
||||
super(VolumeShareSlippage, self).__init__()
|
||||
|
||||
self.volume_limit = volume_limit
|
||||
self.price_impact = price_impact
|
||||
|
||||
super(VolumeShareSlippage, self).__init__()
|
||||
|
||||
def __repr__(self):
|
||||
return """
|
||||
{class_name}(
|
||||
@@ -274,6 +274,7 @@ class FixedSlippage(SlippageModel):
|
||||
allowed_asset_types = (Equity, Future)
|
||||
|
||||
def __init__(self, spread=0.0):
|
||||
super(FixedSlippage, self).__init__()
|
||||
self.spread = spread
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
@@ -23,6 +23,7 @@ class TestingSlippage(SlippageModel):
|
||||
allowed_asset_types = (Equity,)
|
||||
|
||||
def __init__(self, filled_per_tick):
|
||||
super(TestingSlippage, self).__init__()
|
||||
self.filled_per_tick = filled_per_tick
|
||||
|
||||
def process_order(self, data, order):
|
||||
|
||||
Reference in New Issue
Block a user