Modified the Position handling to use long/short instead of buy/sell for side/position_type. Also modified the unit tests for both Portfolio and Position to reflect these changes. Added a basic historical backtesting capability via backtest.py and using CSV tick data for currency pairs.

This commit is contained in:
Michael Halls-Moore
2015-04-17 12:34:31 +01:00
parent d9a7444fc2
commit e74777802b
12 changed files with 519 additions and 192 deletions
+7 -1
View File
@@ -1,3 +1,4 @@
from decimal import Decimal
import os
@@ -14,8 +15,13 @@ ENVIRONMENTS = {
}
}
CSV_DATA_DIR = os.environ.get('QSFOREX_CSV_DATA_DIR', None)
DOMAIN = "practice"
STREAM_DOMAIN = ENVIRONMENTS["streaming"][DOMAIN]
API_DOMAIN = ENVIRONMENTS["api"][DOMAIN]
ACCESS_TOKEN = os.environ.get('OANDA_API_ACCESS_TOKEN', None)
ACCOUNT_ID = os.environ.get('OANDA_API_ACCOUNT_ID', None)
ACCOUNT_ID = os.environ.get('OANDA_API_ACCOUNT_ID', None)
BASE_CURRENCY = "GBP"
EQUITY = Decimal("100000.00")