mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-13 07:46:53 +08:00
Pylint issue
This commit is contained in:
@@ -284,7 +284,7 @@ class Alpha158(DataHandlerLP):
|
|||||||
fields += ["Rsquare($close, %d)" % d for d in windows]
|
fields += ["Rsquare($close, %d)" % d for d in windows]
|
||||||
names += ["RSQR%d" % d for d in windows]
|
names += ["RSQR%d" % d for d in windows]
|
||||||
if use("RESI"):
|
if use("RESI"):
|
||||||
# The redisdual for linear regression for the past d days, represent the trend linearity for past d days.
|
# The redisdual for linear regression for the past d days, represent the trend linearity for past d days.
|
||||||
fields += ["Resi($close, %d)/$close" % d for d in windows]
|
fields += ["Resi($close, %d)/$close" % d for d in windows]
|
||||||
names += ["RESI%d" % d for d in windows]
|
names += ["RESI%d" % d for d in windows]
|
||||||
if use("MAX"):
|
if use("MAX"):
|
||||||
@@ -297,7 +297,7 @@ class Alpha158(DataHandlerLP):
|
|||||||
names += ["MIN%d" % d for d in windows]
|
names += ["MIN%d" % d for d in windows]
|
||||||
if use("QTLU"):
|
if use("QTLU"):
|
||||||
# The 80% quantile of past d day's close price, divided by latest close price to remove unit
|
# The 80% quantile of past d day's close price, divided by latest close price to remove unit
|
||||||
# Used with MIN and MAX
|
# Used with MIN and MAX
|
||||||
fields += ["Quantile($close, %d, 0.8)/$close" % d for d in windows]
|
fields += ["Quantile($close, %d, 0.8)/$close" % d for d in windows]
|
||||||
names += ["QTLU%d" % d for d in windows]
|
names += ["QTLU%d" % d for d in windows]
|
||||||
if use("QTLD"):
|
if use("QTLD"):
|
||||||
@@ -305,7 +305,7 @@ class Alpha158(DataHandlerLP):
|
|||||||
fields += ["Quantile($close, %d, 0.2)/$close" % d for d in windows]
|
fields += ["Quantile($close, %d, 0.2)/$close" % d for d in windows]
|
||||||
names += ["QTLD%d" % d for d in windows]
|
names += ["QTLD%d" % d for d in windows]
|
||||||
if use("RANK"):
|
if use("RANK"):
|
||||||
# Get the percentile of current close price in past d day's close price.
|
# Get the percentile of current close price in past d day's close price.
|
||||||
# Represent the current price level comparing to past N days, add additional information to moving average.
|
# Represent the current price level comparing to past N days, add additional information to moving average.
|
||||||
fields += ["Rank($close, %d)" % d for d in windows]
|
fields += ["Rank($close, %d)" % d for d in windows]
|
||||||
names += ["RANK%d" % d for d in windows]
|
names += ["RANK%d" % d for d in windows]
|
||||||
@@ -316,14 +316,14 @@ class Alpha158(DataHandlerLP):
|
|||||||
if use("IMAX"):
|
if use("IMAX"):
|
||||||
# The number of days between current date and previous highest price date.
|
# The number of days between current date and previous highest price date.
|
||||||
# Part of Aroon Indicator https://www.investopedia.com/terms/a/aroon.asp
|
# Part of Aroon Indicator https://www.investopedia.com/terms/a/aroon.asp
|
||||||
# The indicator measures the time between highs and the time between lows over a time period.
|
# The indicator measures the time between highs and the time between lows over a time period.
|
||||||
# The idea is that strong uptrends will regularly see new highs, and strong downtrends will regularly see new lows.
|
# The idea is that strong uptrends will regularly see new highs, and strong downtrends will regularly see new lows.
|
||||||
fields += ["IdxMax($high, %d)/%d" % (d, d) for d in windows]
|
fields += ["IdxMax($high, %d)/%d" % (d, d) for d in windows]
|
||||||
names += ["IMAX%d" % d for d in windows]
|
names += ["IMAX%d" % d for d in windows]
|
||||||
if use("IMIN"):
|
if use("IMIN"):
|
||||||
# The number of days between current date and previous lowest price date.
|
# The number of days between current date and previous lowest price date.
|
||||||
# Part of Aroon Indicator https://www.investopedia.com/terms/a/aroon.asp
|
# Part of Aroon Indicator https://www.investopedia.com/terms/a/aroon.asp
|
||||||
# The indicator measures the time between highs and the time between lows over a time period.
|
# The indicator measures the time between highs and the time between lows over a time period.
|
||||||
# The idea is that strong uptrends will regularly see new highs, and strong downtrends will regularly see new lows.
|
# The idea is that strong uptrends will regularly see new highs, and strong downtrends will regularly see new lows.
|
||||||
fields += ["IdxMin($low, %d)/%d" % (d, d) for d in windows]
|
fields += ["IdxMin($low, %d)/%d" % (d, d) for d in windows]
|
||||||
names += ["IMIN%d" % d for d in windows]
|
names += ["IMIN%d" % d for d in windows]
|
||||||
|
|||||||
@@ -88,9 +88,6 @@ def _read_pickle(filename_without_suffix: Path) -> pd.DataFrame:
|
|||||||
|
|
||||||
|
|
||||||
class IntradayBacktestData:
|
class IntradayBacktestData:
|
||||||
def __init__(self) -> None:
|
|
||||||
super(IntradayBacktestData, self).__init__()
|
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
from .data_queue import DataQueue
|
from .data_queue import DataQueue
|
||||||
from .env_wrapper import EnvWrapper, EnvWrapperStatus
|
from .env_wrapper import EnvWrapper, EnvWrapperStatus
|
||||||
from .finite_env import FiniteEnvType, vectorize_env
|
from .finite_env import FiniteEnvType, vectorize_env
|
||||||
from .log import ConsoleWriter, CsvWriter, LogCollector, LogLevel, LogWriter
|
from .log import ConsoleWriter, CsvWriter, LogBuffer, LogCollector, LogLevel, LogWriter
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"LogLevel",
|
"LogLevel",
|
||||||
@@ -17,4 +17,5 @@ __all__ = [
|
|||||||
"ConsoleWriter",
|
"ConsoleWriter",
|
||||||
"CsvWriter",
|
"CsvWriter",
|
||||||
"EnvWrapperStatus",
|
"EnvWrapperStatus",
|
||||||
|
"LogBuffer",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
from typing import Any, Generator, Optional, TYPE_CHECKING
|
from typing import Any, Generator, Optional, TYPE_CHECKING, Union
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from qlib.backtest.exchange import Exchange
|
from qlib.backtest.exchange import Exchange
|
||||||
|
|||||||
Reference in New Issue
Block a user