Investment Time Horizon Indicator
Source: Notion | Last edited: 2023-10-30 | ID: 2b8276da-173...
I’m trying to re-factor the logics from bottom up into a dataframe structure and writing a pseudocode that explain the relationship of the underlaying parameters. Help me find logical fallacies or redundancies and propose solution to resolve them:
The purpose is to create a set of novel event-driven performance matrices of equity curve that track the Net Asset Value (NAV) of a trading account as new data point of NAV is coming in one at a time.
Initialization of the following pandas dataframe that consist of the following columns:
ith_epoch, which means Investment Time Horizon Epoch (ITHE), which value is zero by default but filled with NAV value whenever an ITHE upon validation.
ith_ordinal records the ordinal of ITHE of the current data point. For example, the ith_ordinal of the first data point of NAV is 1 and the 2nd data point of NAV is 1, too unless a new ith_epoch is validated.
ith_ordinal is vital because it prevent over-peeking into the past data when we need to retrospective analysis of data of certain ith_ordinal only.
candidate_crest keeps tracks of crest in the current ITHC, which value doesn’t change unless a new ith_cycle begins or higher NAV value within the current ith_cycle is detected.
candidate_nadir keeps tracks of nadir in the current ITHC, which value doesn’t change unless a new ith_cycle begins or lower NAV value within the current ith_cycle is detected.
endorsing_crest persists prior value unless condition met.
endorsing_nadir persists prior value unless condition met.
paramount_crest keeps track of higher high that goes beyond the
At the start of the NAV, which NAV stands for Net Asset Value, the following is assumed:
-
Crowning crest keep track of the confirmed crest, which cannot be confirmed until If the 2nd data point of the equity curve is < than that of the first (the start of the NAV), these are assumed:
-
the first NAV is the crowning crest
-
the 2nd data point update the value of candidate nadir If the 2nd data point of the equity curve is > than that of the first (the start of the NAV), these are assumed:
-
the first NAV is the endorsed crown crest
-
the 2nd data point is the candidate nadir