Skip to content
All library documents

VeighNa CTA Strategy State: JSON Loading and Update Timing

Article vn.py community

Summary

This forum exchange clarifies how VeighNa’s CTA strategy state file is used during initialization. A strategy first derives variable values from historical data and indicators, then reads saved JSON data to overwrite corresponding strategy variables. Assigning values from the JSON file updates the in-memory strategy state; it does not itself rewrite the JSON file.

The thread says the state file is written after trades are received and when the strategy stops. This distinction explains why inspecting a variable assignment may show initialization from saved state without a contemporaneous file update. The discussion is a concise explanation of lifecycle behavior, not a full specification: it does not describe serialization fields, failure handling, or how other versions of the framework behave.

Key ideas

  • CTA strategy initialization first calculates indicator-driven variable values from historical data.
  • Saved JSON values then overwrite corresponding in-memory strategy variables during initialization.
  • Reading saved state does not itself update the JSON file.
  • The state file is updated when trades arrive and when the strategy stops.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.