Input/Output

Detect optimal optima and minima.

param X

Data such as stock prices in a 1D vector.

type X

array-like : 1D array.

param verbose

0: None, 1: ERROR, 2: WARN, 3: INFO (default), 4: DEBUG, 5 : TRACE

type verbose

Int, [0..5]. The higher the number, the more information is printed.

raises Exception

1D array should be of type 1D numpy array or list.

returns
  • Object.

  • X (array-like : 1D array.) – Input 1D vector.

  • simmat (np.array) – Simmilarity matrix

  • loc_start (list of int) – list of indexes containing start positions

  • loc_stop (list of int) – list of indexes containing stop positions

  • loc_start_best (list of int) – list of indexes containing the best starting positions

  • loc_stop_best (list of int) – list of indexes containing the best stopping positions

  • agg (1D array-like) – Aggregated 1D array

  • df (pd.DataFrame) – Results in the form of a dataframe.

  • verbose (Int, [0..5]. Default : 3) – The higher the number, the more information is printed. 0: None, 1: ERROR, 2: WARN, 3: INFO, 4: DEBUG, 5 : TRACE

Plot

Plot results.

param threshold

Required to optimize for the maximum depth of the local-minima. At the ith location, k windows (eg 50) are overlaid and the percentages are determined.

type threshold

float [0,..,1], default : 0.25

param figsize

Figure size. The default is (25,15).

type figsize

tuple, optional

rtype

None.

Gridsearch

Gridsearch to find best fit.

param X

Input 1D vector.

type X

array-like : 1D array.

param verbose

The higher the number, the more information is printed. 0: None, 1: ERROR, 2: WARN, 3: INFO, 4: DEBUG, 5 : TRACE

type verbose

Int, [0..5]. Default : 3

returns
  • Object containing dict with key [‘gridsearch’] such as cs.gridsearch

  • balances (np-array) – results of balances across various levels of: window x minperc

  • trades (np-array) – results of trades across various levels of: window x minperc