Compare commits
2 Commits
9742df3a1f
...
1c0058ec3b
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c0058ec3b | |||
| 220e510d5e |
@@ -112,10 +112,16 @@ def run_phase1(
|
|||||||
|
|
||||||
repo = Repository(cfg.db_path)
|
repo = Repository(cfg.db_path)
|
||||||
repo.init_schema()
|
repo.init_schema()
|
||||||
|
# Escludi prompt_library (PromptLibrary dataclass non e' JSON-serializable);
|
||||||
|
# salva solo i nomi degli stili per reproducibility.
|
||||||
config_dict = {
|
config_dict = {
|
||||||
**cfg.__dict__,
|
**{k: v for k, v in cfg.__dict__.items() if k != "prompt_library"},
|
||||||
"db_path": str(cfg.db_path),
|
"db_path": str(cfg.db_path),
|
||||||
"model_tier": cfg.model_tier.value,
|
"model_tier": cfg.model_tier.value,
|
||||||
|
"prompt_library_styles": (
|
||||||
|
list(cfg.prompt_library.cognitive_styles)
|
||||||
|
if cfg.prompt_library is not None else None
|
||||||
|
),
|
||||||
}
|
}
|
||||||
run_id = repo.create_run(name=cfg.run_name, config=config_dict)
|
run_id = repo.create_run(name=cfg.run_name, config=config_dict)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,140 @@
|
|||||||
|
{
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"op": "and",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"op": "gt",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "indicator",
|
||||||
|
"name": "realized_vol",
|
||||||
|
"params": [150]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "literal",
|
||||||
|
"value": 0.01
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"op": "lt",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "indicator",
|
||||||
|
"name": "atr_pct",
|
||||||
|
"params": [150]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "literal",
|
||||||
|
"value": 0.02
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"op": "gt",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "indicator",
|
||||||
|
"name": "sma_pct",
|
||||||
|
"params": [150]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "literal",
|
||||||
|
"value": 0.05
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"action": "entry-long"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"op": "and",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"op": "lt",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "indicator",
|
||||||
|
"name": "realized_vol",
|
||||||
|
"params": [150]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "literal",
|
||||||
|
"value": 0.005
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"op": "gt",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "indicator",
|
||||||
|
"name": "atr_pct",
|
||||||
|
"params": [150]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "literal",
|
||||||
|
"value": 0.03
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"op": "lt",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "indicator",
|
||||||
|
"name": "sma_pct",
|
||||||
|
"params": [150]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "literal",
|
||||||
|
"value": -0.05
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"action": "entry-short"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": {
|
||||||
|
"op": "or",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"op": "eq",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "indicator",
|
||||||
|
"name": "sma_pct",
|
||||||
|
"params": [150]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "literal",
|
||||||
|
"value": 0.0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"op": "lt",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "indicator",
|
||||||
|
"name": "realized_vol",
|
||||||
|
"params": [150]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "literal",
|
||||||
|
"value": 0.001
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"action": "exit"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user