Ref($close, -2)/Ref($close, -1)-1
(also used in Alpha158 and Alpha360), which is inconsistent with "the label is formulated as Ref($close, -1)/$close - 1" in the note. Thanks.
Ref($close, -1)/$close - 1
was used a lot in https://qlib.readthedocs.io/en/latest/reference/api.html . May I know the purpose of the difference?
Ref($close, -1)/$close - 1
means the change from T to T+1, which can be used in backtest.Ref($close, -2)/Ref($close, -1)-1
that means the change from T+1 to T+2 rather than Ref($close, -1)/$close - 1
, of which the reason is that when you get T day close price of a china stock, you can buy it in T+1 day and sell it in T+2 day.
@BigW
The expression engine of Qlib provides similar problem like https://twopirllc.github.io/pandas-ta/#indicators-by-category
Users are encouraged to implement technical indicators with it.
But Qlib doesn't force users to use it. If you prefer pandas-ta, you can implement your technical indicates in the datahandler after retrieving the raw data.