|
WU Trading Library 0.2.0
A backtesting and trading strategy library
|
Go to the source code of this file.
Data Structures | |
| struct | WU_SMA |
| MovingAverage is a simple moving average indicator that calculates the average of the last N values, where N is the window size. More... | |
| struct | WU_EMA |
| The exponential moving average (WU_EMA) is a type of moving average that gives more weight to recent values, making it more responsive to recent value changes. More... | |
| struct | WU_MVar |
| The WU_MVar (Moving Variance) is an indicator that calculates the variance of the last N values, where N is the window size. More... | |
| struct | WU_MStDev |
| The WU_MStDev (Moving Standard Deviation) is an indicator that calculates the standard deviation of the last N values, where N is the window size. More... | |
| struct | WU_RSI |
| The WU_RSI (Relative Strength Index) is a momentum oscillator that measures the speed and change of price movements. More... | |
| struct | WU_MACDResult |
| The WU_MACDResult structure holds the current values of the MACD line, signal line, and histogram. More... | |
| struct | WU_MACD |
| The WU_MACD (Moving Average Convergence Divergence) is a trend-following momentum indicator that shows the relationship between two moving averages of a security's price. More... | |
| struct | WU_MaxDrawdown |
| Maximum Drawdown - tracks the largest peak-to-trough decline. More... | |
| struct | WU_PerformanceUpdate |
| Performance Update - value and timestamp for performance metric calculations. More... | |
| struct | WU_Downside |
| Tracks the average downside, calculate as the square root of the average of the squared negative values. More... | |
| struct | WU_Mean |
| A global mean calculator that updates with new values and maintains the current mean. More... | |
| struct | WU_Var |
| A glabal variance calculator. More... | |
| struct | WU_StDev |
| A global standard deviation calcular. More... | |
Macros | |
| #define | wu_indicator_update(indicator, value) |
| Header file for technical indicators. | |
| #define | wu_indicator_get(indicator) |
| Get the current value of the indicator. | |
| #define | wu_indicator_delete(indicator) |
| Delete the indicator and free any resources allocated by it. | |
Functions | |
| WU_SMA | wu_sma_new (int window_size) |
| Creates a new WU_SMA (Simple Moving Average) indicator with the specified window size. | |
| WU_EMA | wu_ema_new (int window_size, double smoothing) |
| Creates a new WU_EMA (Exponential Moving Average) indicator with the specified period and smoothing factor. | |
| WU_MVar | wu_mvar_new (int window_size, int dof) |
| Creates a new WU_MVar (Moving Variance) indicator with the specified window size and degree of freedom. | |
| WU_MStDev | wu_mstdev_new (int window_size, int dof) |
| Creates a new WU_MStDev (Moving Standard Deviation) indicator with the specified window size and degree of freedom. | |
| WU_RSI | wu_rsi_new (int window_size) |
| Creates a new WU_RSI (Relative Strength Index) indicator with the specified window size. | |
| WU_MACD | wu_macd_new (int short_window, int long_window, int signal_window, double smoothing) |
| Creates a new WU_MACD (Moving Average Convergence Divergence) indicator with the specified short and long window sizes, and signal line window size. | |
| WU_MaxDrawdown | wu_max_drawdown_new (void) |
| Creates a new WU_MaxDrawdown indicator. | |
| WU_Downside | wu_downside_new (void) |
| Creates a new WU_Downside indicator. | |
| WU_Mean | wu_mean_new (void) |
| Creates a new WU_Mean indicator. | |
| WU_Var | wu_var_new (int dof) |
| Createas a new variance indicator. | |
| WU_StDev | wu_stdev_new (int dof) |
| Creates a new standard deviation indicator. | |
| #define wu_indicator_delete | ( | indicator | ) |
Delete the indicator and free any resources allocated by it.
This macro assumes that the indicator has a delete function that takes the indicator itself and frees any resources allocated by it.
Definition at line 56 of file indicators.h.
| #define wu_indicator_get | ( | indicator | ) |
Get the current value of the indicator.
This macro assume that the indicator has a value field that holds the current state of the indicator.
Definition at line 49 of file indicators.h.
| #define wu_indicator_update | ( | indicator, | |
| value ) |
Header file for technical indicators.
Defines the structures and function prototypes for various indicators. All the indicator should follow the same interface:
Once the indicator has been created, it should only be accessed using the provided macros:
This design allows for a consistent interface across different types of indicators, making it easier to use them interchangeably in trading strategies. Update the indicator state with a new value a return the updated indicator state. This macro assumes that the indicator has an update function that takes the indicator itself and a new value, and returns the updated indicator value.
Definition at line 41 of file indicators.h.
| WU_Downside wu_downside_new | ( | void | ) |
Creates a new WU_Downside indicator.
Definition at line 23 of file mean_downside.c.
| WU_EMA wu_ema_new | ( | int | window_size, |
| double | smoothing ) |
| WU_MACD wu_macd_new | ( | int | short_window, |
| int | long_window, | ||
| int | signal_window, | ||
| double | smoothing ) |
| WU_MaxDrawdown wu_max_drawdown_new | ( | void | ) |
Creates a new WU_MaxDrawdown indicator.
The initial value is set to 0 and the initial peak is set to the first portfolio value observed.
Definition at line 20 of file maxdrawdown.c.
| WU_MStDev wu_mstdev_new | ( | int | window_size, |
| int | dof ) |
| WU_MVar wu_mvar_new | ( | int | window_size, |
| int | dof ) |
| WU_RSI wu_rsi_new | ( | int | window_size | ) |
| WU_SMA wu_sma_new | ( | int | window_size | ) |
| WU_StDev wu_stdev_new | ( | int | dof | ) |