MCPcopy
hub / github.com/microsoft/qlib / test_setting

Method test_setting

tests/ops/test_special_ops.py:10–21  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8
9class TestOperatorDataSetting(TestOperatorData):
10 def test_setting(self):
11 # All the query below passes
12 df = D.features(["SH600519"], ["ChangeInstrument('SH000300', $close)"])
13
14 # get market return for "SH600519"
15 df = D.features(["SH600519"], ["ChangeInstrument('SH000300', Feature('close')/Ref(Feature('close'),1) -1)"])
16 df = D.features(["SH600519"], ["ChangeInstrument('SH000300', $close/Ref($close,1) -1)"])
17 # excess return
18 df = D.features(
19 ["SH600519"], ["($close/Ref($close,1) -1) - ChangeInstrument('SH000300', $close/Ref($close,1) -1)"]
20 )
21 print(df)
22
23 def test_case2(self):
24 def test_case(instruments, queries, note=None):

Callers

nothing calls this directly

Calls 1

featuresMethod · 0.80

Tested by

no test coverage detected