Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about 'get_feature_config' function in class HighFreqGeneralHandler #1786

Open
caozhenxiang-kouji opened this issue May 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@caozhenxiang-kouji
Copy link

When I run the follwing code
python scripts/gen_pickle_data_hsm.py -c scripts/pickle_data_config.yml
, I print out the generated results of self.get_feature_config() in class HighFreqGeneralHandler. The results are as follows:
['Cut(FFillNan(If(IsNull($open), $close, $open)/DayLast(Ref(FFillNan($close), 480))), 480, None)',
'Cut(FFillNan(If(IsNull($high), $close, $high)/DayLast(Ref(FFillNan($close), 480))), 480, None)',
'Cut(FFillNan(If(IsNull($low), $close, $low)/DayLast(Ref(FFillNan($close), 480))), 480, None)',
'Cut(FFillNan(If(IsNull($close), $close, $close)/DayLast(Ref(FFillNan($close), 480))), 480, None)',
'Cut(FFillNan(Ref(If(IsNull($open), $close, $open), 240)/DayLast(Ref(FFillNan($close), 240))), 480, None)',
'Cut(FFillNan(Ref(If(IsNull($high), $close, $high), 240)/DayLast(Ref(FFillNan($close), 240))), 480, None)',
'Cut(FFillNan(Ref(If(IsNull($low), $close, $low), 240)/DayLast(Ref(FFillNan($close), 240))), 480, None)',
'Cut(FFillNan(Ref(If(IsNull($close), $close, $close), 240)/DayLast(Ref(FFillNan($close), 240))), 480, None)',
'Cut(If(IsNull($volume/Ref(DayLast(Mean($volume, 7200)), 240)), 0, $volume/Ref(DayLast(Mean($volume, 7200)), 240)), 480, None)',
'Cut(If(IsNull(Ref($volume, 240)/Ref(DayLast(Mean($volume, 7200)), 240)), 0, Ref($volume, 240)/Ref(DayLast(Mean($volume, 7200)), 240)), 480, None)'
], ['$open', '$high', '$low', '$close', '$open_1', '$high_1', '$low_1', '$close_1', '$volume', '$volume_1']

I has 2 questions here:
First, I believe the variable 'day length' in class HighFreqGeneralHandler should be divided by freq. In my case, the freq is 5 min, so a day only has a length of 48. The Ref($close, 480) here just indicates the close price 10 days ago.
Second, the actual usage of function 'get_normalized_price_feature' is inconsistent with the annotations here. However, it seems that the open,close,high,low of today will be divided by the close price 2 days ago, and the those of yesterday will be divided by the close price of yesterday(and then Ref again? I don't know why). I 'm a little confused here and is looking forward for a more detailed explanation.

@caozhenxiang-kouji caozhenxiang-kouji added the bug Something isn't working label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant