本文整理汇总了Python中marketsim.deref_opt函数的典型用法代码示例。如果您正苦于以下问题:Python deref_opt函数的具体用法?Python deref_opt怎么用?Python deref_opt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deref_opt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getImpl
def getImpl(self):
from marketsim.gen._out.orderbook._lastprice import LastPrice_IOrderQueue as _orderbook_LastPrice_IOrderQueue
from marketsim.gen._out.orderbook._bestprice import BestPrice_IOrderQueue as _orderbook_BestPrice_IOrderQueue
from marketsim.gen._out._ifdefined import IfDefined_IObservableFloatFloat as _IfDefined_IObservableFloatFloat
from marketsim.gen._out._ifdefined import IfDefined_IObservableFloatIObservableFloat as _IfDefined_IObservableFloatIObservableFloat
from marketsim import deref_opt
return deref_opt(_IfDefined_IObservableFloatIObservableFloat(deref_opt(_orderbook_BestPrice_IOrderQueue(self.queue)),deref_opt(_IfDefined_IObservableFloatFloat(deref_opt(_orderbook_LastPrice_IOrderQueue(self.queue)),self.defaultValue))))
示例2: __init__
def __init__(self, orderFactory = None, eventGen = None):
from marketsim.gen._out.order._limit import Limit_SideFloatFloat as _order_Limit_SideFloatFloat
from marketsim import deref_opt
from marketsim.gen._out.event._every import Every_Float as _event_Every_Float
self.orderFactory = orderFactory if orderFactory is not None else deref_opt(_order_Limit_SideFloatFloat())
self.eventGen = eventGen if eventGen is not None else deref_opt(_event_Every_Float())
Generic_Impl.__init__(self)
示例3: __init__
def __init__(self, alpha = None, k = None, trader = None):
from marketsim.gen._out._const import const_Float as _const_Float
from marketsim import deref_opt
from marketsim.gen._out.trader._singleproxy import SingleProxy_ as _trader_SingleProxy_
self.alpha = alpha if alpha is not None else 0.15
self.k = k if k is not None else deref_opt(_const_Float(0.5))
self.trader = trader if trader is not None else deref_opt(_trader_SingleProxy_())
示例4: __init__
def __init__(self, initialValue = None, priceDistr = None, book = None):
from marketsim.gen._out.math.random._lognormvariate import lognormvariate_FloatFloat as _math_random_lognormvariate_FloatFloat
from marketsim import deref_opt
from marketsim.gen._out.orderbook._oftrader import OfTrader_IAccount as _orderbook_OfTrader_IAccount
self.initialValue = initialValue if initialValue is not None else 100.0
self.priceDistr = priceDistr if priceDistr is not None else deref_opt(_math_random_lognormvariate_FloatFloat(0.0,0.1))
self.book = book if book is not None else deref_opt(_orderbook_OfTrader_IAccount())
示例5: __init__
def __init__(self, book = None, side = None):
from marketsim.gen._out.orderbook._oftrader import OfTrader_IAccount as _orderbook_OfTrader_IAccount
from marketsim import deref_opt
from marketsim.gen._out.side._sell import Sell_ as _side_Sell_
self.book = book if book is not None else deref_opt(_orderbook_OfTrader_IAccount())
self.side = side if side is not None else deref_opt(_side_Sell_())
Queue_Impl.__init__(self)
示例6: __init__
def __init__(self, side=None, volume=None):
from marketsim.gen._out.side._sell import Sell_ as _side_Sell_
from marketsim import deref_opt
from marketsim.gen._out._constant import constant_Float as _constant_Float
self.side = side if side is not None else deref_opt(_side_Sell_())
self.volume = volume if volume is not None else deref_opt(_constant_Float(1.0))
示例7: getImpl
def getImpl(self):
from marketsim.gen._out.math._value import Value_mathmacd as _math_Value_mathmacd
from marketsim.gen._out.math._avg import Avg_mathEW as _math_Avg_mathEW
from marketsim.gen._out.observable._oneverydt import OnEveryDt_FloatFloat as _observable_OnEveryDt_FloatFloat
from marketsim.gen._out.math._ew import EW_IObservableFloatFloat as _math_EW_IObservableFloatFloat
from marketsim import deref_opt
return deref_opt(_math_Avg_mathEW(deref_opt(_math_EW_IObservableFloatFloat(deref_opt(_observable_OnEveryDt_FloatFloat(deref_opt(_math_Value_mathmacd(self.x)),self.step)),(2/((self.timeframe+1)))))))
示例8: __init__
def __init__(self, base = None, power = None):
from marketsim.gen._out._observable._observablefloat import Observablefloat
from marketsim.gen._out._constant import constant_Float as _constant_Float
from marketsim import deref_opt
Observablefloat.__init__(self)
self.base = base if base is not None else deref_opt(_constant_Float(1.0))
self.power = power if power is not None else deref_opt(_constant_Float(1.0))
示例9: getImpl
def getImpl(self):
from marketsim.gen._out.math._max import Max_FloatIObservableFloat as _math_Max_FloatIObservableFloat
from marketsim.gen._out._constant import constant_Float as _constant_Float
from marketsim.gen._out.ops._sub import Sub_IObservableFloatIObservableFloat as _ops_Sub_IObservableFloatIObservableFloat
from marketsim.gen._out.math._lagged import Lagged_IObservableFloatFloat as _math_Lagged_IObservableFloatFloat
from marketsim import deref_opt
return deref_opt(_math_Max_FloatIObservableFloat(deref_opt(_constant_Float(0.0)),deref_opt(_ops_Sub_IObservableFloatIObservableFloat(self.source,deref_opt(_math_Lagged_IObservableFloatFloat(self.source,self.timeframe))))))
示例10: getImpl
def getImpl(self):
from marketsim.gen._out.side._sell import Sell_ as _side_Sell_
from marketsim.gen._out.strategy._combine import Combine_ISingleAssetStrategyISingleAssetStrategy as _strategy_Combine_ISingleAssetStrategyISingleAssetStrategy
from marketsim.gen._out.side._buy import Buy_ as _side_Buy_
from marketsim.gen._out.strategy.price._onesidestrategy import OneSideStrategy_strategypriceLiquidityProviderIEventSideFloatIObservableIOrderSide as _strategy_price_OneSideStrategy_strategypriceLiquidityProviderIEventSideFloatIObservableIOrderSide
from marketsim import deref_opt
return deref_opt(_strategy_Combine_ISingleAssetStrategyISingleAssetStrategy(deref_opt(_strategy_price_OneSideStrategy_strategypriceLiquidityProviderIEventSideFloatIObservableIOrderSide(self.x,self.eventGen,self.orderFactory,deref_opt(_side_Sell_()))),deref_opt(_strategy_price_OneSideStrategy_strategypriceLiquidityProviderIEventSideFloatIObservableIOrderSide(self.x,self.eventGen,self.orderFactory,deref_opt(_side_Buy_())))))
示例11: __init__
def __init__(self, inner = None, predicate = None):
from marketsim.gen._out.strategy.price._laddermm import LadderMM_SideFloatIObservableIOrderInt as _strategy_price_LadderMM_SideFloatIObservableIOrderInt
from marketsim import deref_opt
from marketsim.gen._out._false import false_ as _false_
self.inner = inner if inner is not None else deref_opt(_strategy_price_LadderMM_SideFloatIObservableIOrderInt())
self.predicate = predicate if predicate is not None else deref_opt(_false_())
Clearable_Impl.__init__(self)
示例12: getImpl
def getImpl(self):
from marketsim.gen._out.strategy.price._oneside import OneSide_strategypriceMarketMakerSideFloat as _strategy_price_OneSide_strategypriceMarketMakerSideFloat
from marketsim.gen._out.side._sell import Sell_ as _side_Sell_
from marketsim.gen._out.strategy._combine import Combine_ISingleAssetStrategyISingleAssetStrategy as _strategy_Combine_ISingleAssetStrategyISingleAssetStrategy
from marketsim.gen._out.side._buy import Buy_ as _side_Buy_
from marketsim import deref_opt
return deref_opt(_strategy_Combine_ISingleAssetStrategyISingleAssetStrategy(deref_opt(_strategy_price_OneSide_strategypriceMarketMakerSideFloat(self.x,deref_opt(_side_Sell_()),1.0)),deref_opt(_strategy_price_OneSide_strategypriceMarketMakerSideFloat(self.x,deref_opt(_side_Buy_()),-1.0))))
示例13: __init__
def __init__(self, x = None, y = None):
from marketsim.gen._out._observable._observablebool import Observablebool
from marketsim.gen._out._const import const_Float as _const_Float
from marketsim import deref_opt
Observablebool.__init__(self)
self.x = x if x is not None else deref_opt(_const_Float(1.0))
self.y = y if y is not None else deref_opt(_const_Float(1.0))
Greater_Impl.__init__(self)
示例14: __init__
def __init__(self, x = None, y = None):
from marketsim.gen._out._observable._observablebool import Observablebool
from marketsim.gen._out._observabletrue import observableTrue_ as _observableTrue_
from marketsim import deref_opt
Observablebool.__init__(self)
self.x = x if x is not None else deref_opt(_observableTrue_())
self.y = y if y is not None else deref_opt(_observableTrue_())
Or_Impl.__init__(self)
示例15: __init__
def __init__(self, signedVolume = None, price = None):
from marketsim.gen._out._iorder import IOrder
from marketsim.gen._out._observable._observableiorder import ObservableIOrder
from marketsim.gen._out._constant import constant_Float as _constant_Float
from marketsim import deref_opt
ObservableIOrder.__init__(self)
self.signedVolume = signedVolume if signedVolume is not None else deref_opt(_constant_Float(1.0))
self.price = price if price is not None else deref_opt(_constant_Float(100.0))