Skip to content

Commit

Permalink
MAINT: process_order is a method
Browse files Browse the repository at this point in the history
and call super's __init__ to set up base state
  • Loading branch information
richafrank committed May 5, 2017
1 parent 611f170 commit ca2e3a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions zipline/finance/slippage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -91,7 +91,7 @@ def __init__(self):
def volume_for_bar(self):
return self._volume_for_bar

@abstractproperty
@abstractmethod
def process_order(self, data, order):
"""Process how orders get filled.
Expand Down Expand Up @@ -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}(
Expand Down Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions zipline/testing/slippage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ca2e3a0

Please sign in to comment.