Commit 904b7f15 authored by Dr.李's avatar Dr.李

added map frequency

parent 7f11b195
...@@ -36,6 +36,23 @@ from alphamind.execution.pipeline import ExecutionPipeline ...@@ -36,6 +36,23 @@ from alphamind.execution.pipeline import ExecutionPipeline
from alphamind.utilities import alpha_logger from alphamind.utilities import alpha_logger
def map_freq(freq):
if freq == '1m':
horizon = 21
elif freq == '1w':
horizon = 4
elif freq == '2w':
horizon = 8
elif freq == '3w':
horizon = 12
elif freq == '1d':
horizon = 0
else:
raise ValueError("Unrecognized freq: {0}".format(freq))
return horizon
__all__ = [ __all__ = [
'SqlEngine', 'SqlEngine',
'factor_analysis', 'factor_analysis',
...@@ -61,5 +78,6 @@ __all__ = [ ...@@ -61,5 +78,6 @@ __all__ = [
'ThresholdExecutor', 'ThresholdExecutor',
'TargetVolExecutor', 'TargetVolExecutor',
'ExecutionPipeline', 'ExecutionPipeline',
'alpha_logger' 'alpha_logger',
'map_freq'
] ]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment