From 4b023a852acf5a4a03f6bd343f22797347244703 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Fri, 1 Nov 2013 16:26:48 -0400 Subject: [PATCH] MAINT: Use 1 as the first bitmask value instead of 0. To prevent a possible future bug where values like SELL | STOP | LIMIT would accidentally match STOP | LIMIT. --- zipline/finance/slippage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zipline/finance/slippage.py b/zipline/finance/slippage.py index ae77ce29..2fab4e97 100644 --- a/zipline/finance/slippage.py +++ b/zipline/finance/slippage.py @@ -23,10 +23,10 @@ from functools import partial from zipline.protocol import DATASOURCE_TYPE import zipline.utils.math_utils as zp_math -SELL = 0 -BUY = 1 -STOP = 1 << 1 -LIMIT = 1 << 2 +SELL = 1 << 0 +BUY = 1 << 1 +STOP = 1 << 2 +LIMIT = 1 << 3 def check_order_triggers(order, event):