Changed Quanld source to correctly retrieve csv data, along with simple cleanup of import statements and use of Decimal

This commit is contained in:
Jack Simonson
2019-03-04 09:47:33 -08:00
parent cf1b6c363b
commit 0d963ccdd5
12 changed files with 30 additions and 42 deletions
+2 -3
View File
@@ -24,7 +24,6 @@ from QuantConnect.Orders.Fees import *
from QuantConnect.Securities import *
from QuantConnect.Orders.Fills import *
import numpy as np
import decimal as d
import random
### <summary>
@@ -102,7 +101,7 @@ class CustomFeeModel(FeeModel):
# custom fee math
fee = max(1, parameters.Security.Price
* parameters.Order.AbsoluteQuantity
* d.Decimal(0.00001))
* 0.00001)
self.algorithm.Log("CustomFeeModel: " + str(fee))
return OrderFee(CashAmount(fee, "USD"))
@@ -112,6 +111,6 @@ class CustomSlippageModel:
def GetSlippageApproximation(self, asset, order):
# custom slippage math
slippage = asset.Price * d.Decimal(0.0001 * np.log10(2*float(order.AbsoluteQuantity)))
slippage = asset.Price * 0.0001 * np.log10(2*float(order.AbsoluteQuantity))
self.algorithm.Log("CustomSlippageModel: " + str(slippage))
return slippage