Ejemplo n.º 1
0
 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)))))))
 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))))
Ejemplo n.º 3
0
 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_())))))
 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_())
Ejemplo n.º 5
0
 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))
 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())
Ejemplo n.º 7
0
 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)
Ejemplo n.º 8
0
    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))
Ejemplo n.º 9
0
 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))
Ejemplo n.º 10
0
 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))))
Ejemplo n.º 11
0
 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)
Ejemplo n.º 12
0
 def __init__(self, price=None, volume=None):
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     from marketsim import deref_opt
     self.price = price if price is not None else deref_opt(
         _constant_Float(100.0))
     self.volume = volume if volume is not None else deref_opt(
         _constant_Float(1.0))
Ejemplo n.º 13
0
 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))))))
Ejemplo n.º 14
0
 def __init__(self, x=None):
     from marketsim.gen._out.math._avg import Avg_mathEW as _math_Avg_mathEW
     from marketsim.gen._out.math._ew import EW_IObservableFloatFloat as _math_EW_IObservableFloatFloat
     from marketsim import deref_opt
     self.x = x if x is not None else deref_opt(
         _math_Avg_mathEW(deref_opt(_math_EW_IObservableFloatFloat())))
     Derivative_Impl.__init__(self)
Ejemplo n.º 15
0
 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)
Ejemplo n.º 16
0
 def getImpl(self):
     from marketsim.gen._out.trader._pendingvolume import PendingVolume_IAccount as _trader_PendingVolume_IAccount
     from marketsim.gen._out.trader._position import Position_IAccount as _trader_Position_IAccount
     from marketsim.gen._out.strategy.position._trader import Trader_strategypositionRSI_linear as _strategy_position_Trader_strategypositionRSI_linear
     from marketsim.gen._out.strategy.position._desiredposition import DesiredPosition_strategypositionRSI_linear as _strategy_position_DesiredPosition_strategypositionRSI_linear
     from marketsim.gen._out.ops._sub import Sub_IObservableFloatIObservableFloat as _ops_Sub_IObservableFloatIObservableFloat
     from marketsim import deref_opt
     return deref_opt(_ops_Sub_IObservableFloatIObservableFloat(deref_opt(_ops_Sub_IObservableFloatIObservableFloat(deref_opt(_strategy_position_DesiredPosition_strategypositionRSI_linear(self.x)),deref_opt(_trader_Position_IAccount(deref_opt(_strategy_position_Trader_strategypositionRSI_linear(self.x)))))),deref_opt(_trader_PendingVolume_IAccount(deref_opt(_strategy_position_Trader_strategypositionRSI_linear(self.x))))))
Ejemplo n.º 17
0
 def __init__(self, orderbook = None, link = None, timeseries = None):
     from marketsim.gen._out.orderbook._local import Local_StringFloatIntListITimeSerie as _orderbook_Local_StringFloatIntListITimeSerie
     from marketsim import deref_opt
     from marketsim.gen._out.orderbook._twowaylink import TwoWayLink_ILinkILink as _orderbook_TwoWayLink_ILinkILink
     self.orderbook = orderbook if orderbook is not None else deref_opt(_orderbook_Local_StringFloatIntListITimeSerie())
     self.link = link if link is not None else deref_opt(_orderbook_TwoWayLink_ILinkILink())
     self.timeseries = timeseries if timeseries is not None else []
     Remote_Impl.__init__(self)
Ejemplo n.º 18
0
 def __init__(self, alpha = None, k = None, timeframe = 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 (1.0/14.0)
     self.k = k if k is not None else deref_opt(_const_Float(-0.04))
     self.timeframe = timeframe if timeframe is not None else 1.0
     self.trader = trader if trader is not None else deref_opt(_trader_SingleProxy_())
Ejemplo n.º 19
0
 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))
Ejemplo n.º 20
0
 def getImpl(self):
     from marketsim.gen._out.ops._div import Div_FloatFloat as _ops_Div_FloatFloat
     from marketsim.gen._out.ops._add import Add_FloatFloat as _ops_Add_FloatFloat
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     from marketsim.gen._out.math._raw import Raw_mathRSI as _math_Raw_mathRSI
     from marketsim.gen._out.ops._sub import Sub_FloatFloat as _ops_Sub_FloatFloat
     from marketsim import deref_opt
     return deref_opt(_ops_Sub_FloatFloat(deref_opt(_constant_Float(100.0)),deref_opt(_ops_Div_FloatFloat(deref_opt(_constant_Float(100.0)),deref_opt(_ops_Add_FloatFloat(deref_opt(_constant_Float(1.0)),deref_opt(_math_Raw_mathRSI(self.x))))))))
Ejemplo n.º 21
0
 def __init__(self, proto=None, maxloss=None):
     from marketsim.gen._out.order._curried._price_limit import price_Limit_SideFloat as _order__curried_price_Limit_SideFloat
     from marketsim import deref_opt
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     self.proto = proto if proto is not None else deref_opt(
         _order__curried_price_Limit_SideFloat())
     self.maxloss = maxloss if maxloss is not None else deref_opt(
         _constant_Float(0.1))
Ejemplo n.º 22
0
 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_())
 def getImpl(self):
     from marketsim.gen._out.math._avg import Avg_mathEW as _math_Avg_mathEW
     from marketsim.gen._out.orderbook._midprice import MidPrice_IOrderBook as _orderbook_MidPrice_IOrderBook
     from marketsim.gen._out.strategy.side._alpha import Alpha_strategysideMeanReversion as _strategy_side_Alpha_strategysideMeanReversion
     from marketsim.gen._out.strategy.side._book import book_strategysideMeanReversion as _strategy_side_book_strategysideMeanReversion
     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(_orderbook_MidPrice_IOrderBook(deref_opt(_strategy_side_book_strategysideMeanReversion(self.x)))),deref_opt(_strategy_side_Alpha_strategysideMeanReversion(self.x))))))
 def getImpl(self):
     from marketsim.gen._out.ops._mul import Mul_IObservableFloatFloat as _ops_Mul_IObservableFloatFloat
     from marketsim.gen._out.orderbook._midprice import MidPrice_IOrderBook as _orderbook_MidPrice_IOrderBook
     from marketsim.gen._out.strategy.side._booktodependon import BookToDependOn_strategysidePairTrading as _strategy_side_BookToDependOn_strategysidePairTrading
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     from marketsim.gen._out.strategy.side._factor import Factor_strategysidePairTrading as _strategy_side_Factor_strategysidePairTrading
     from marketsim import deref_opt
     return deref_opt(_ops_Mul_IObservableFloatFloat(deref_opt(_orderbook_MidPrice_IOrderBook(deref_opt(_strategy_side_BookToDependOn_strategysidePairTrading(self.x)))),deref_opt(_constant_Float(deref_opt(_strategy_side_Factor_strategysidePairTrading(self.x))))))
Ejemplo n.º 25
0
 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))
     Equal_Impl.__init__(self)
Ejemplo n.º 26
0
 def getImpl(self):
     from marketsim.gen._out.ops._condition import Condition_BooleanFloatFloat as _ops_Condition_BooleanFloatFloat
     from marketsim.gen._out.ops._less import Less_FloatFloat as _ops_Less_FloatFloat
     from marketsim import deref_opt
     return deref_opt(
         _ops_Condition_BooleanFloatFloat(
             deref_opt(_ops_Less_FloatFloat(self.x, self.y)), self.x,
             self.y))
Ejemplo n.º 27
0
 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)
Ejemplo n.º 28
0
 def getImpl(self):
     from marketsim.gen._out.ops._div import Div_IObservableFloatIObservableFloat as _ops_Div_IObservableFloatIObservableFloat
     from marketsim.gen._out._constant import constant_Int as _constant_Int
     from marketsim.gen._out.trader._position import Position_IAccount as _trader_Position_IAccount
     from marketsim.gen._out.trader._balance import Balance_IAccount as _trader_Balance_IAccount
     from marketsim.gen._out.ops._sub import Sub_FloatIObservableFloat as _ops_Sub_FloatIObservableFloat
     from marketsim import deref_opt
     return deref_opt(_ops_Sub_FloatIObservableFloat(deref_opt(_constant_Int(0)),deref_opt(_ops_Div_IObservableFloatIObservableFloat(deref_opt(_trader_Balance_IAccount(self.trader)),deref_opt(_trader_Position_IAccount(self.trader))))))
Ejemplo n.º 29
0
 def __init__(self, orderFactory = None, initialSize = None, side = None):
     from marketsim.gen._out.order._curried._sideprice_limit import sideprice_Limit_Float as _order__curried_sideprice_Limit_Float
     from marketsim import deref_opt
     from marketsim.gen._out.side._sell import Sell_ as _side_Sell_
     self.orderFactory = orderFactory if orderFactory is not None else deref_opt(_order__curried_sideprice_Limit_Float())
     self.initialSize = initialSize if initialSize is not None else 10
     self.side = side if side is not None else deref_opt(_side_Sell_())
     OneSide_Impl.__init__(self)
Ejemplo n.º 30
0
 def __init__(self, proto = None, floatingPrice = None):
     from marketsim.gen._intrinsic.order.meta.floating_price import Factory_Impl
     from marketsim.gen._out.order._curried._price_limit import price_Limit_SideFloat as _order__curried_price_Limit_SideFloat
     from marketsim import deref_opt
     from marketsim.gen._out._const import const_Float as _const_Float
     Factory_Impl.__init__(self)
     self.proto = proto if proto is not None else deref_opt(_order__curried_price_Limit_SideFloat())
     self.floatingPrice = floatingPrice if floatingPrice is not None else deref_opt(_const_Float(10.0))
Ejemplo n.º 31
0
 def __init__(self, proto=None, lotSize=None):
     from marketsim.gen._out.order._curried._side_price_limit import side_price_Limit_Float as _order__curried_side_price_Limit_Float
     from marketsim import deref_opt
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     self.proto = proto if proto is not None else deref_opt(
         _order__curried_side_price_Limit_Float())
     self.lotSize = lotSize if lotSize is not None else deref_opt(
         _constant_Float(10.0))
Ejemplo n.º 32
0
 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)
Ejemplo n.º 33
0
 def __init__(self, proto=None, expiry=None):
     from marketsim.gen._out.order._curried._side_limit import side_Limit_FloatFloat as _order__curried_side_Limit_FloatFloat
     from marketsim import deref_opt
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     self.proto = proto if proto is not None else deref_opt(
         _order__curried_side_Limit_FloatFloat())
     self.expiry = expiry if expiry is not None else deref_opt(
         _constant_Float(10.0))
Ejemplo n.º 34
0
 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)
Ejemplo n.º 35
0
 def getImpl(self):
     from marketsim.gen._out.math._stddev import StdDev_mathCumulative as _math_StdDev_mathCumulative
     from marketsim.gen._out.ops._sub import Sub_IObservableFloatFloat as _ops_Sub_IObservableFloatFloat
     from marketsim.gen._out.math._source import Source_mathCumulative as _math_Source_mathCumulative
     from marketsim.gen._out.ops._div import Div_IObservableFloatFloat as _ops_Div_IObservableFloatFloat
     from marketsim.gen._out.math._avg import Avg_mathCumulative as _math_Avg_mathCumulative
     from marketsim import deref_opt
     return deref_opt(_ops_Div_IObservableFloatFloat(deref_opt(_ops_Sub_IObservableFloatFloat(deref_opt(_math_Source_mathCumulative(self.x)),deref_opt(_math_Avg_mathCumulative(self.x)))),deref_opt(_math_StdDev_mathCumulative(self.x))))
Ejemplo n.º 36
0
 def __init__(self, x=None, y=None):
     from marketsim.gen._out._observable._observablebool import Observablebool
     from marketsim.gen._out._true import true_ as _true_
     from marketsim import deref_opt
     Observablebool.__init__(self)
     self.x = x if x is not None else deref_opt(_true_())
     self.y = y if y is not None else deref_opt(_true_())
     And_Impl.__init__(self)
Ejemplo n.º 37
0
 def __init__(self, proto=None, floatingPrice=None):
     from marketsim.gen._out.order._curried._price_limit import price_Limit_SideFloat as _order__curried_price_Limit_SideFloat
     from marketsim import deref_opt
     from marketsim.gen._out._const import const_Float as _const_Float
     self.proto = proto if proto is not None else deref_opt(
         _order__curried_price_Limit_SideFloat())
     self.floatingPrice = floatingPrice if floatingPrice is not None else deref_opt(
         _const_Float(10.0))
Ejemplo n.º 38
0
 def __init__(self, inner=None, predicate=None):
     from marketsim.gen._out.strategy._empty import Empty_ as _strategy_Empty_
     from marketsim import deref_opt
     from marketsim.gen._out._true import true_ as _true_
     self.inner = inner if inner is not None else deref_opt(
         _strategy_Empty_())
     self.predicate = predicate if predicate is not None else deref_opt(
         _true_())
     Suspendable_Impl.__init__(self)
Ejemplo n.º 39
0
 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)
Ejemplo n.º 40
0
 def __init__(self, alpha=None, k=None, timeframe=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 (1.0 / 14.0)
     self.k = k if k is not None else deref_opt(_const_Float(-0.04))
     self.timeframe = timeframe if timeframe is not None else 1.0
     self.trader = trader if trader is not None else deref_opt(
         _trader_SingleProxy_())
Ejemplo n.º 41
0
 def __init__(self, proto = None, lotSize = None):
     from marketsim.gen._out._iorder import IOrder
     from marketsim.gen._out.order._limit import Limit_SideFloatFloat as _order_Limit_SideFloatFloat
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     from marketsim.gen._out._observable._observableiorder import ObservableIOrder
     from marketsim import deref_opt
     ObservableIOrder.__init__(self)
     self.proto = proto if proto is not None else deref_opt(_order_Limit_SideFloatFloat())
     self.lotSize = lotSize if lotSize is not None else deref_opt(_constant_Float(10.0))
Ejemplo n.º 42
0
 def getImpl(self):
     from marketsim.gen._out.side._sell import Sell_ as _side_Sell_
     from marketsim.gen._out.ops._condition import Condition_BooleanSideSide as _ops_Condition_BooleanSideSide
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     from marketsim.gen._out.strategy.side._side_distribution import Side_distribution_strategysideNoise as _strategy_side_Side_distribution_strategysideNoise
     from marketsim.gen._out.side._buy import Buy_ as _side_Buy_
     from marketsim.gen._out.ops._greater import Greater_FloatFloat as _ops_Greater_FloatFloat
     from marketsim import deref_opt
     return deref_opt(_ops_Condition_BooleanSideSide(deref_opt(_ops_Greater_FloatFloat(deref_opt(_strategy_side_Side_distribution_strategysideNoise(self.x)),deref_opt(_constant_Float(0.5)))),deref_opt(_side_Buy_()),deref_opt(_side_Sell_())))
Ejemplo n.º 43
0
 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())
Ejemplo n.º 44
0
 def __init__(self, proto = None, expiry = None):
     from marketsim.gen._out._iorder import IOrder
     from marketsim.gen._out.order._limit import Limit_SideFloatFloat as _order_Limit_SideFloatFloat
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     from marketsim.gen._out._observable._observableiorder import ObservableIOrder
     from marketsim import deref_opt
     ObservableIOrder.__init__(self)
     self.proto = proto if proto is not None else deref_opt(_order_Limit_SideFloatFloat())
     self.expiry = expiry if expiry is not None else deref_opt(_constant_Float(10.0))
 def __call__(self, side = None,price = 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
     from marketsim.gen._out.order._limit import Limit
     side = side if side is not None else deref_opt(_side_Sell_())
     price = price if price is not None else deref_opt(_constant_Float(100.0))
     volume = self.volume
     return Limit(side, price, volume)
Ejemplo n.º 46
0
 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)
    def __init__(self, proto=None, expiry=None):
        from marketsim.gen._out.order._curried._side_price_limit import (
            side_price_Limit_Float as _order__curried_side_price_Limit_Float,
        )
        from marketsim import deref_opt
        from marketsim.gen._out._constant import constant_Float as _constant_Float

        self.proto = proto if proto is not None else deref_opt(_order__curried_side_price_Limit_Float())
        self.expiry = expiry if expiry is not None else deref_opt(_constant_Float(10.0))
Ejemplo n.º 48
0
 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))
Ejemplo n.º 49
0
 def getImpl(self):
     from marketsim.gen._out.orderbook._bestprice import BestPrice_IOrderQueue as _orderbook_BestPrice_IOrderQueue
     from marketsim.gen._out.orderbook._bids import Bids_IOrderBook as _orderbook_Bids_IOrderBook
     from marketsim.gen._out.ops._add import Add_IObservableFloatIObservableFloat as _ops_Add_IObservableFloatIObservableFloat
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     from marketsim.gen._out.ops._div import Div_IObservableFloatFloat as _ops_Div_IObservableFloatFloat
     from marketsim.gen._out.orderbook._asks import Asks_IOrderBook as _orderbook_Asks_IOrderBook
     from marketsim import deref_opt
     return deref_opt(_ops_Div_IObservableFloatFloat(deref_opt(_ops_Add_IObservableFloatIObservableFloat(deref_opt(_orderbook_BestPrice_IOrderQueue(deref_opt(_orderbook_Asks_IOrderBook(self.book)))),deref_opt(_orderbook_BestPrice_IOrderQueue(deref_opt(_orderbook_Bids_IOrderBook(self.book)))))),deref_opt(_constant_Float(2.0))))
Ejemplo n.º 50
0
 def __init__(self, orderFactory=None, initialSize=None, side=None):
     from marketsim.gen._out.order._curried._sideprice_limit import sideprice_Limit_Float as _order__curried_sideprice_Limit_Float
     from marketsim import deref_opt
     from marketsim.gen._out.side._sell import Sell_ as _side_Sell_
     self.orderFactory = orderFactory if orderFactory is not None else deref_opt(
         _order__curried_sideprice_Limit_Float())
     self.initialSize = initialSize if initialSize is not None else 10
     self.side = side if side is not None else deref_opt(_side_Sell_())
     OneSide_Impl.__init__(self)
Ejemplo n.º 51
0
 def getImpl(self):
     from marketsim.gen._out.math._avg import Avg_mathEW as _math_Avg_mathEW
     from marketsim.gen._out.orderbook._midprice import MidPrice_IOrderBook as _orderbook_MidPrice_IOrderBook
     from marketsim.gen._out.strategy.side._alpha import Alpha_strategysideTrendFollower as _strategy_side_Alpha_strategysideTrendFollower
     from marketsim.gen._out.strategy.side._book import Book_strategysideTrendFollower as _strategy_side_Book_strategysideTrendFollower
     from marketsim.gen._out.math._ew import EW_IObservableFloatFloat as _math_EW_IObservableFloatFloat
     from marketsim.gen._out.math._derivative import Derivative_IDifferentiable as _math_Derivative_IDifferentiable
     from marketsim import deref_opt
     return deref_opt(_math_Derivative_IDifferentiable(deref_opt(_math_Avg_mathEW(deref_opt(_math_EW_IObservableFloatFloat(deref_opt(_orderbook_MidPrice_IOrderBook(deref_opt(_strategy_side_Book_strategysideTrendFollower(self.x)))),deref_opt(_strategy_side_Alpha_strategysideTrendFollower(self.x))))))))
Ejemplo n.º 52
0
 def __init__(self, proto = None, maxloss = None):
     from marketsim.gen._out._iorder import IOrder
     from marketsim.gen._out.order._limit import Limit_SideFloatFloat as _order_Limit_SideFloatFloat
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     from marketsim.gen._out._observable._observableiorder import ObservableIOrder
     from marketsim import deref_opt
     ObservableIOrder.__init__(self)
     self.proto = proto if proto is not None else deref_opt(_order_Limit_SideFloatFloat())
     self.maxloss = maxloss if maxloss is not None else deref_opt(_constant_Float(0.1))
Ejemplo n.º 53
0
 def getImpl(self):
     from marketsim.gen._out.math._atan import Atan_Float as _math_Atan_Float
     from marketsim.gen._out.math._pow import Pow_FloatFloat as _math_Pow_FloatFloat
     from marketsim.gen._out._const import const_Float as _const_Float
     from marketsim import deref_opt
     return deref_opt(
         _math_Atan_Float(
             deref_opt(
                 _math_Pow_FloatFloat(deref_opt(_const_Float(self.base)),
                                      self.f))))
Ejemplo n.º 54
0
 def getImpl(self):
     from marketsim.gen._out.ops._add import Add_FloatFloat as _ops_Add_FloatFloat
     from marketsim.gen._out.math._max import Max_FloatFloat as _math_Max_FloatFloat
     from marketsim.gen._out._constant import constant_Int as _constant_Int
     from marketsim import deref_opt
     return deref_opt(
         _ops_Add_FloatFloat(
             deref_opt(
                 _math_Max_FloatFloat(deref_opt(_constant_Int(0)), self.f)),
             deref_opt(_constant_Int(1))))
Ejemplo n.º 55
0
 def __init__(self, side = None, price = None, volume = None):
     from marketsim.gen._out.side._sell import Sell_ as _side_Sell_
     from marketsim.gen._out._iorder import IOrder
     from marketsim.gen._out._constant import constant_Float as _constant_Float
     from marketsim.gen._out._observable._observableiorder import ObservableIOrder
     from marketsim import deref_opt
     ObservableIOrder.__init__(self)
     self.side = side if side is not None else deref_opt(_side_Sell_())
     self.price = price if price is not None else deref_opt(_constant_Float(100.0))
     self.volume = volume if volume is not None else deref_opt(_constant_Float(1.0))
Ejemplo n.º 56
0
 def getImpl(self):
     from marketsim.gen._out.ops._condition import Condition_BooleanFloatFloat as _ops_Condition_BooleanFloatFloat
     from marketsim.gen._out.ops._notequal import NotEqual_FloatFloat as _ops_NotEqual_FloatFloat
     from marketsim.gen._out._null import null_ as _null_
     from marketsim import deref_opt
     return deref_opt(
         _ops_Condition_BooleanFloatFloat(
             deref_opt(_ops_NotEqual_FloatFloat(self.x,
                                                deref_opt(_null_()))),
             self.x, self.elsePart))
Ejemplo n.º 57
0
 def __call__(self, side = None,price = 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
     from marketsim.gen._out.order._withexpiry import WithExpiry
     side = side if side is not None else deref_opt(_side_Sell_())
     price = price if price is not None else deref_opt(_constant_Float(100.0))
     proto = self.proto
     expiry = self.expiry
     return WithExpiry(proto(side,price), expiry)
Ejemplo n.º 58
0
 def __init__(self, orderbook=None, link=None, timeseries=None):
     from marketsim.gen._out.orderbook._local import Local_StringFloatIntListITimeSerie as _orderbook_Local_StringFloatIntListITimeSerie
     from marketsim import deref_opt
     from marketsim.gen._out.orderbook._twowaylink import TwoWayLink_ILinkILink as _orderbook_TwoWayLink_ILinkILink
     self.orderbook = orderbook if orderbook is not None else deref_opt(
         _orderbook_Local_StringFloatIntListITimeSerie())
     self.link = link if link is not None else deref_opt(
         _orderbook_TwoWayLink_ILinkILink())
     self.timeseries = timeseries if timeseries is not None else []
     Remote_Impl.__init__(self)
Ejemplo n.º 59
0
 def __call__(self, side=None, price=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
     from marketsim.gen._out.order._immediateorcancel import ImmediateOrCancel
     side = side if side is not None else deref_opt(_side_Sell_())
     price = price if price is not None else deref_opt(
         _constant_Float(100.0))
     proto = self.proto
     return ImmediateOrCancel(proto(side, price))
Ejemplo n.º 60
0
 def __call__(self, side = None,price = 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
     from marketsim.gen._out.order._stoploss import StopLoss
     side = side if side is not None else deref_opt(_side_Sell_())
     price = price if price is not None else deref_opt(_constant_Float(100.0))
     proto = self.proto
     maxloss = self.maxloss
     return StopLoss(proto(side,price), maxloss)