#include "types.h"
#include "data.h"
#include "indicators.h"
Go to the source code of this file.
|
| struct | WU_Strategy |
| struct | WU_CrossOverStrat |
| | WU_CrossOverStrat is a simple crossover strategy that generates buy and sell signals based on the crossover of two moving averages. More...
|
| struct | WU_PairsTradingStrat |
| | WU_PairsTradingStrat implements a classic pairs trading strategy that trades the spread between two correlated assets (statistical arbitrage). More...
|
◆ WU_STRATEGY
| #define WU_STRATEGY |
( |
| strategy | ) |
|
Value:((WU_Strategy)(strategy))
Definition at line 19 of file strategies.h.
◆ wu_strategy_delete
| #define wu_strategy_delete |
( |
| strategy | ) |
|
Value: do { \
if ((strategy)->delete) \
(strategy)->delete((WU_Strategy)(strategy)); \
} while(0)
Definition at line 24 of file strategies.h.
◆ wu_strategy_input_type
| #define wu_strategy_input_type |
( |
| strategy, |
|
|
| idx ) |
Value:((strategy)->input_types[idx])
Definition at line 30 of file strategies.h.
◆ wu_strategy_num_inputs
| #define wu_strategy_num_inputs |
( |
| strategy | ) |
|
◆ wu_strategy_num_outputs
| #define wu_strategy_num_outputs |
( |
| strategy | ) |
|
Value:((strategy)->num_outputs)
Definition at line 31 of file strategies.h.
◆ wu_strategy_output_symbol
| #define wu_strategy_output_symbol |
( |
| strategy, |
|
|
| idx ) |
Value:((strategy)->output_symbols[idx])
Definition at line 32 of file strategies.h.
◆ wu_strategy_update
| #define wu_strategy_update |
( |
| strategy, |
|
|
| inputs ) |
Value:((strategy)->update((strategy), (inputs)))
Definition at line 21 of file strategies.h.
◆ wu_crossover_strat_new()
| WU_CrossOverStrat wu_crossover_strat_new |
( |
int | short_window, |
|
|
int | long_window, |
|
|
double | threshold ) |
◆ wu_pairs_trading_strat_new()
| WU_PairsTradingStrat wu_pairs_trading_strat_new |
( |
int | window, |
|
|
double | threshold, |
|
|
double | ratio ) |
Creates a new pairs trading strategy.
- Parameters
-
| window | Lookback period for spread statistics |
| threshold | Number of standard deviations for entry (e.g., 2.0) |
| ratio | Hedge ratio between assets |
- Returns
- New pairs trading strategy instance
Definition at line 106 of file pairs_trading.c.