• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python warninghelpers.deprecation_warning函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyalgotrade.warninghelpers.deprecation_warning函数的典型用法代码示例。如果您正苦于以下问题:Python deprecation_warning函数的具体用法?Python deprecation_warning怎么用?Python deprecation_warning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了deprecation_warning函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setUseAdjustedValues

 def setUseAdjustedValues(self, useAdjusted, deprecationCheck=None):
     # Deprecated since v0.15
     if not self.__barFeed.barsHaveAdjClose():
         raise Exception("The barfeed doesn't support adjusted close values")
     if deprecationCheck is None:
         warninghelpers.deprecation_warning("setUseAdjustedValues will be deprecated in the next version. Please use setUseAdjustedValues on the strategy instead.", stacklevel=2)
     self.__useAdjustedValues = useAdjusted
开发者ID:arippbbc,项目名称:pyalgotrade,代码行数:7,代码来源:backtesting.py


示例2: __init__

 def __init__(self, *args, **kwargs):
     # Deprecated since v0.13
     warninghelpers.deprecation_warning(
         "Strategy class will be deprecated in the next version. Please use BaseStrategy or BacktestingStrategy instead.",
         stacklevel=2,
     )
     BacktestingStrategy.__init__(self, *args, **kwargs)
开发者ID:rexkimj,项目名称:pyalgotrade,代码行数:7,代码来源:__init__.py


示例3: order

 def order(self, instrument, quantity, onClose=False, goodTillCanceled=False, allOrNone=False):
     # Deprecated since v0.15
     warninghelpers.deprecation_warning(
         "The order method will be deprecated in the next version. Please use the marketOrder method instead.",
         stacklevel=2,
     )
     return self.marketOrder(instrument, quantity, onClose, goodTillCanceled, allOrNone)
开发者ID:rexkimj,项目名称:pyalgotrade,代码行数:7,代码来源:__init__.py


示例4: exitPosition

 def exitPosition(self, position, stopPrice=None, limitPrice=None, goodTillCanceled=None):
     # Deprecated since v0.13
     warninghelpers.deprecation_warning(
         "exitPosition will be deprecated in the next version. Please use the exit method in the position class instead.",
         stacklevel=2,
     )
     position.exit(limitPrice, stopPrice, goodTillCanceled)
开发者ID:rexkimj,项目名称:pyalgotrade,代码行数:7,代码来源:__init__.py


示例5: getAdjLow

 def getAdjLow(self):
     # Deprecated in 0.15
     warninghelpers.deprecation_warning(
         "The getAdjLow method will be deprecated in the next version. Please use the getLow(True) instead.",
         stacklevel=2,
     )
     return self.getLow(True)
开发者ID:heber,项目名称:pyalgotrade,代码行数:7,代码来源:bar.py


示例6: getQuantity

 def getQuantity(self):
     # Deprecated in v0.15.
     warninghelpers.deprecation_warning(
         "getQuantity will be deprecated in the next version. Please use abs(self.getShares()) instead.",
         stacklevel=2,
     )
     return abs(self.getShares())
开发者ID:nooperpudd,项目名称:pyalgotrade,代码行数:7,代码来源:position.py


示例7: __init__

 def __init__(self, skipWarning=False):
     if not skipWarning:
         warninghelpers.deprecation_warning(
             "pyalgotrade.barfeed.csvfeed.YahooFeed will be deprecated in the next version. Please use pyalgotrade.barfeed.yahoofeed.Feed instead.",
             stacklevel=2,
         )
     BarFeed.__init__(self)
开发者ID:AlexColson,项目名称:pyalgotrade,代码行数:7,代码来源:csvfeed.py


示例8: getValue

    def getValue(self, deprecated=None):
        if deprecated != None:
            warninghelpers.deprecation_warning(
                "The bars parameter is no longer used and will be removed in the next version.", stacklevel=2
            )

        return self.getEquityWithBars(self.__barFeed.getCurrentBars())
开发者ID:jasonwzz,项目名称:pyalgotrade,代码行数:7,代码来源:backtesting.py


示例9: getValue

	def getValue(self, valuesAgo = 0):
		# Deprecated since 0.12
		warninghelpers.deprecation_warning("getValue will be deprecated in the next version. Please use [] instead.", stacklevel=2)
		ret = None
		absolutePos = self.__mapRelativeToAbsolute(valuesAgo)
		if absolutePos != None:
			ret = self.getValueAbsolute(absolutePos)
		return ret
开发者ID:imoran21,项目名称:Pyalgo-Django,代码行数:8,代码来源:__init__.py


示例10: getUnrealizedNetProfit

 def getUnrealizedNetProfit(self, price=None):
     # Deprecated in v0.15.
     warninghelpers.deprecation_warning(
         "getUnrealizedNetProfit will be deprecated in the next version. Please use getPnL instead.", stacklevel=2
     )
     if price is not None:
         raise Exception("Setting the price to getUnrealizedNetProfit is no longer supported")
     return self.getPnL(False)
开发者ID:nooperpudd,项目名称:pyalgotrade,代码行数:8,代码来源:position.py


示例11: __init__

	def __init__(self, timezone = None, skipWarning=False):
		if type(timezone) == types.IntType:
			raise Exception("timezone as an int parameter is not supported anymore. Please use a pytz timezone instead.")

		if not skipWarning:
			warninghelpers.deprecation_warning("pyalgotrade.barfeed.csvfeed.YahooFeed will be deprecated in the next version. Please use pyalgotrade.barfeed.yahoofeed.Feed instead.", stacklevel=2)

		BarFeed.__init__(self, barfeed.Frequency.DAY)
		self.__timezone = timezone
开发者ID:doudoukiss,项目名称:pyalgotrade,代码行数:9,代码来源:csvfeed.py


示例12: getValuesAbsolute

	def getValuesAbsolute(self, firstPos, lastPos, includeNone = False):
		# Deprecated since 0.13
		warninghelpers.deprecation_warning("getValuesAbsolute will be deprecated in the next version. Please use [] instead.", stacklevel=2)
		ret = []
		for i in xrange(firstPos, lastPos+1):
			value = self.getValueAbsolute(i)
			if value is None and not includeNone:
				return None
			ret.append(value)
		return ret
开发者ID:imoran21,项目名称:Pyalgo-Django,代码行数:10,代码来源:__init__.py


示例13: getPnL

    def getPnL(self, includeCommissions=True):
        """
        Calculates PnL up to this point.
        If the position is not closed, these will be unrealized PnL.
        """

        # Deprecated in v0.18.
        if includeCommissions is False:
            warninghelpers.deprecation_warning("includeCommissions will be deprecated in the next version.", stacklevel=2)

        ret = 0
        price = self.getLastPrice()
        if price is not None:
            ret = self.__posTracker.getPnL(price=price, includeCommissions=includeCommissions)
        return ret
开发者ID:gansaihua,项目名称:pyalgotrade,代码行数:15,代码来源:position.py


示例14: getValues

	def getValues(self, count, valuesAgo = 0, includeNone = False):
		# Deprecated since 0.12
		warninghelpers.deprecation_warning("getValues will be deprecated in the next version. Please use [] instead.", stacklevel=2)
		if count <= 0:
			return None

		absolutePos = self.__mapRelativeToAbsolute(valuesAgo + (count - 1))
		if absolutePos == None:
			return None

		ret = []
		for i in xrange(count):
			value = self.getValueAbsolute(absolutePos + i)
			if value is None and not includeNone:
				return None
			ret.append(value)
		return ret
开发者ID:imoran21,项目名称:Pyalgo-Django,代码行数:17,代码来源:__init__.py


示例15: exit

    def exit(self, stopPrice=None, limitPrice=None, goodTillCanceled=None):
        # Deprecated in v0.15.
        if stopPrice is None and limitPrice is None:
            warninghelpers.deprecation_warning("exit will be deprecated in the next version. Please use exitMarket instead.", stacklevel=2)
        elif stopPrice is None and limitPrice is not None:
            warninghelpers.deprecation_warning("exit will be deprecated in the next version. Please use exitLimit instead.", stacklevel=2)
        elif stopPrice is not None and limitPrice is None:
            warninghelpers.deprecation_warning("exit will be deprecated in the next version. Please use exitStop instead.", stacklevel=2)
        elif stopPrice is not None and limitPrice is not None:
            warninghelpers.deprecation_warning("exit will be deprecated in the next version. Please use exitStopLimit instead.", stacklevel=2)

        self._state.exit(self, stopPrice, limitPrice, goodTillCanceled)
开发者ID:dailypips,项目名称:pyalgotrade,代码行数:12,代码来源:position.py


示例16: getNetProfit

 def getNetProfit(self, includeCommissions=True):
     # Deprecated in v0.15.
     warninghelpers.deprecation_warning("getNetProfit will be deprecated in the next version. Please use getPnL instead.", stacklevel=2)
     return self.getPnL(includeCommissions)
开发者ID:dailypips,项目名称:pyalgotrade,代码行数:4,代码来源:position.py


示例17: __init__

 def __init__(self, *args, **kwargs):
     # Deprecated since v0.15
     warninghelpers.deprecation_warning("Slope was moved in the pyalgotrade.technical.linreg package", stacklevel=2)
     linreg.Slope.__init__(self, *args, **kwargs)
开发者ID:harsha550,项目名称:pyalgotrade,代码行数:4,代码来源:trend.py


示例18: getPendingOrders

 def getPendingOrders(self):
     warninghelpers.deprecation_warning(
         "getPendingOrders will be deprecated in the next version. Please use getActiveOrders instead.",
         stacklevel=2
     )
     return self.getActiveOrders()
开发者ID:revivalfx,项目名称:pyalgotrade,代码行数:6,代码来源:backtesting.py


示例19: getLastBars

	def getLastBars(self):
		warninghelpers.deprecation_warning("getLastBars will be deprecated in the next version. Please use getCurrentBars instead.", stacklevel=2)
		return self.getCurrentBars()
开发者ID:imoran21,项目名称:Pyalgo-Django,代码行数:3,代码来源:__init__.py


示例20: setExitOnSessionClose

 def setExitOnSessionClose(self, exitOnSessionClose):
     # Deprecated since v0.15
     warninghelpers.deprecation_warning("Auto exit on session close will be deprecated in the next version.", stacklevel=2)
     self.__exitOnSessionClose = exitOnSessionClose
开发者ID:jjman889,项目名称:pyalgotrade,代码行数:4,代码来源:position.py



注:本文中的pyalgotrade.warninghelpers.deprecation_warning函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pyamf.add_type函数代码示例发布时间:2022-05-25
下一篇:
Python dt.localize函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap