### SMMA Usage Example Source: https://github.com/cinar/indicator/blob/master/trend/README.md Example of how to initialize and use the SMMA indicator. ```go smma := trend.NewSmma[float64]() smma.Period = 10 result := smma.Compute(c) ``` -------------------------------- ### STC Usage Example Source: https://github.com/cinar/indicator/blob/master/trend/README.md Example of how to initialize and use the STC indicator. ```go stc := trend.NewStc[float64]() result := stc.Compute(closings) ``` -------------------------------- ### Install Indicator Go Package Source: https://github.com/cinar/indicator/blob/master/README.md Installs the Indicator Go package using the go get command. Ensure you have Go installed and configured correctly. ```bash go get github.com/cinar/indicator/v2 ``` -------------------------------- ### Qstick Configuration Example Source: https://github.com/cinar/indicator/blob/master/momentum/README.md Example showing how to configure the SMA period for the Qstick indicator and compute its values using float64. ```go qstick := momentum.Qstick[float64]() qstick.Sma.Period = 50 values := qstick.Compute(openings, closings) ``` -------------------------------- ### Kama Example Usage Source: https://github.com/cinar/indicator/blob/master/trend/README.md Example of how to initialize and compute the Kama indicator. Requires a channel of numbers as input. ```go kama := trend.NewKama[float64]() result := kama.Compute(c) ``` -------------------------------- ### KDJ Example Usage Source: https://github.com/cinar/indicator/blob/master/trend/README.md Shows an example of initializing a KDJ indicator and computing its values using high, low, and closing price data. Ensure the input channels are properly set up. ```go kdj := NewKdj[float64]() values := kdj.Compute(highs, lows, closings) ``` -------------------------------- ### PVO Calculation Example Source: https://github.com/cinar/indicator/blob/master/momentum/README.md Example demonstrating how to initialize and compute the Percentage Volume Oscillator (PVO) using float64 values. ```go pvo := momentum.Pvo[float64]() p, s, h := pvo.Compute(volumes) ``` -------------------------------- ### Example Usage of WilliamsR Source: https://github.com/cinar/indicator/blob/master/momentum/README.md Example demonstrating how to initialize and compute WilliamsR values using float64 data. ```go wr := momentum.WilliamsR[float64]() values := wr.Compute(highs, lows, closings) ``` -------------------------------- ### Example Usage of Bollinger Band Width Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Shows how to initialize a Bollinger Band Width indicator and compute its values from a channel of data. This example assumes a default configuration for the underlying Bollinger Bands. ```go bbw := NewBollingerBandWidth[float64]() bbw.Compute(c) ``` -------------------------------- ### Example Usage of PPO Source: https://github.com/cinar/indicator/blob/master/momentum/README.md Demonstrates how to initialize and use the PPO indicator to compute PPO, signal, and histogram values. ```go ppo := momentum.Ppo[float64]() p, s, h := ppo.Compute(closings) ``` -------------------------------- ### Example Usage of Ichimoku Cloud Source: https://github.com/cinar/indicator/blob/master/momentum/README.md Demonstrates how to initialize and use the Ichimoku Cloud indicator to compute its various components. ```go ic := momentum.IchimokuCloud[float64]() conversionLine, baseLine, leadingSpanA, leasingSpanB, laggingSpan := ic.Compute(highs, lows, closings) ``` -------------------------------- ### Trix Example Usage Source: https://github.com/cinar/indicator/blob/master/trend/README.md Demonstrates how to create a new Trix instance and compute its values using a channel of numbers. ```go trix := trend.NewTrix[float64]() result := trix.Compute(values) ``` -------------------------------- ### WeightedClose Example Usage Source: https://github.com/cinar/indicator/blob/master/trend/README.md Example of how to use the WeightedClose indicator. ```go weightedClose := trend.NewWeightedClose[float64]() result := weightedClose.Compute(highs, lows, closes) ``` -------------------------------- ### Ulcer Index Calculation Example Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Demonstrates how to initialize and compute the Ulcer Index. This example shows the typical usage pattern for the indicator. ```go ui := volatility.NewUlcerIndex[float64]() ui.Compute(closings) ``` -------------------------------- ### Tsi Example Usage Source: https://github.com/cinar/indicator/blob/master/trend/README.md Demonstrates creating a new Tsi instance and computing its values using a channel of closing prices. ```go tsi := trend.NewTsi[float64]() result := tsi.Compute(closings) ``` -------------------------------- ### CCI Example Usage Source: https://github.com/cinar/indicator/blob/master/trend/README.md Example of initializing and computing the Commodity Channel Index (CCI) with a specified period. ```go cmi := trend.NewCmi() cmi.Period = 20 values = cmi.Compute(highs, lows, closings) ``` -------------------------------- ### DataReport Begin Method Source: https://github.com/cinar/indicator/blob/master/backtest/README.md Called at the very start of the backtesting process, before any assets are processed. ```go func (*DataReport) Begin(_ []string, _ []strategy.Strategy) error ``` -------------------------------- ### Example Usage of McGinley Dynamic Source: https://github.com/cinar/indicator/blob/master/trend/README.md Example of how to create and use the McGinley Dynamic indicator. It initializes the indicator and computes a result. ```go md := trend.NewMcGinleyDynamic[float64]() result := md.Compute(c) ``` -------------------------------- ### CFO Example Usage Source: https://github.com/cinar/indicator/blob/master/trend/README.md Example of initializing and computing the Chande Forecast Oscillator (CFO) using a channel of closing prices. ```go cfo := trend.NewCfo[float64]() result := cfo.Compute(c) ``` -------------------------------- ### Connors RSI Example Usage Source: https://github.com/cinar/indicator/blob/master/momentum/README.md Example of how to initialize and compute Connors RSI. Requires a ConnorsRsi instance and a channel of closing prices. ```go connorsRsi := momentum.NewConnorsRsi[float64]() result := connorsRsi.Compute(closings) ``` -------------------------------- ### Coppock Curve Example Usage Source: https://github.com/cinar/indicator/blob/master/momentum/README.md Example of how to initialize and compute Coppock Curve. Requires a CoppockCurve instance and a channel of closing prices. ```go cc := momentum.NewCoppockCurve[float64]() result := cc.Compute(closings) ``` -------------------------------- ### Run MCP Server Source: https://github.com/cinar/indicator/blob/master/mcp/README.md Starts the MCP server for backtesting functionality. Configures the server with necessary tools and handlers. ```go func RunMCPServer() *server.MCPServer ``` -------------------------------- ### MovingSum Configuration Example Source: https://github.com/cinar/indicator/blob/master/trend/README.md Demonstrates how to initialize and configure a MovingSum indicator. Set the 'Period' field to define the lookback window for summation. ```go sum := trend.NewMovingSum[float64]() sum.Period = 20 ``` ```go type MovingSum[T helper.Number] struct { // Time period. Period int } ``` -------------------------------- ### Example Usage of Moving Linear Regression Source: https://github.com/cinar/indicator/blob/master/trend/README.md Example of how to create and use the Moving Linear Regression indicator. It initializes the indicator with a period and computes results. ```go mlr := trend.NewMlrWithPeriod[float64](14) rs := mlr.Compute(x , y) ``` -------------------------------- ### DataReport AssetBegin Method Source: https://github.com/cinar/indicator/blob/master/backtest/README.md Called at the beginning of backtesting for a specific asset, allowing for any necessary setup. ```go func (d *DataReport) AssetBegin(name string, strategies []strategy.Strategy) error ``` -------------------------------- ### Initialize and Run Backtest in Go Source: https://github.com/cinar/indicator/blob/master/README.md This Go code snippet demonstrates how to set up and run a backtest. It initializes an HTML report, creates a backtest instance with a repository, adds an asset name and a strategy, and then executes the backtest. ```go report := backtest.NewHTMLReport(outputDir) bt := backtest.NewBacktest(repository, report) bt.Names = append(bt.Names, "brk-b") bt.Strategies = append(bt.Strategies, trend.NewApoStrategy()) err = bt.Run() if err != nil { t.Fatal(err) } ``` -------------------------------- ### Initialize and Compute Keltner Channel Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Example of initializing a new KeltnerChannel and computing results using channels for highs, lows, and closings. ```go dc := volatility.NewKeltnerChannel[float64]() result := dc.Compute(highs, lows, closings) ``` -------------------------------- ### In-Memory Repository Test Source: https://github.com/cinar/indicator/blob/master/asset/GEMINI.md Example test for the InMemoryRepository. This setup is useful for quick testing and validation of repository logic without external dependencies. ```go func TestInMemoryRepository(t *testing.T) { repo := asset.NewInMemoryRepository() // test AddSnapshot, GetSnapshots, etc. } ``` -------------------------------- ### HTMLReport Begin Method Source: https://github.com/cinar/indicator/blob/master/backtest/README.md Callback function for HTMLReport at the start of the entire backtest. Used for initializing the overall report structure. ```go func (h *HTMLReport) Begin(assetNames []string, _ []strategy.Strategy) error ``` -------------------------------- ### Get McGinley Dynamic Idle Period Source: https://github.com/cinar/indicator/blob/master/trend/README.md Returns the initial period before the McGinley Dynamic indicator starts yielding results. This indicates the warm-up phase. ```go func (m *McGinleyDynamic[T]) IdlePeriod() int ``` -------------------------------- ### Get MLS Idle Period Source: https://github.com/cinar/indicator/blob/master/trend/README.md Returns the initial period before the Moving Least Square (MLS) indicator starts yielding results. This indicates the warm-up phase. ```go func (m *Mls[T]) IdlePeriod() int ``` -------------------------------- ### Get MLR Idle Period Source: https://github.com/cinar/indicator/blob/master/trend/README.md Returns the initial period before the Moving Linear Regression (MLR) indicator starts yielding results. This indicates the warm-up phase. ```go func (m *Mlr[T]) IdlePeriod() int ``` -------------------------------- ### Initialize AccelerationBands Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Creates a new AccelerationBands instance with default parameters. Use this to start calculating Acceleration Bands. ```go func NewAccelerationBands[T helper.Number]() *AccelerationBands[T] ``` -------------------------------- ### Get CHOP Idle Period Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Returns the initial period before the Choppiness Index (CHOP) starts yielding results. This indicates the necessary data points for calculation. ```go func (c *Chop[T]) IdlePeriod() int ``` -------------------------------- ### Get Chandelier Exit Idle Period Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Returns the initial period before Chandelier Exit starts yielding results. This indicates the necessary data points for calculation. ```go func (c *ChandelierExit[T]) IdlePeriod() int ``` -------------------------------- ### Initialize New WeightedCloseStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Initializes a new instance of the WeightedCloseStrategy. This function provides a default setup for the strategy. ```go func NewWeightedCloseStrategy() *WeightedCloseStrategy ``` -------------------------------- ### Get ATR Idle Period Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Returns the number of periods before the ATR indicator starts producing valid results. This is the warm-up period required for the moving average calculation. ```go func (a *Atr[T]) IdlePeriod() int ``` -------------------------------- ### Initialize and Compute Donchian Channel Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Example of initializing a new DonchianChannel and computing results using a slice of float64 values. ```go dc := volatility.NewDonchianChannel[float64]() result := dc.Compute(values) ``` -------------------------------- ### Calculate Percent B Indicator Example Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Demonstrates how to calculate the %B indicator using closing prices. Includes initialization, computation, and output formatting. ```go package main import ( "fmt" "github.com/cinar/indicator/v2/helper" "github.com/cinar/indicator/v2/volatility" ) func main() { // Closing prices closes := helper.SliceToChan([]float64{ 318.600006, 315.839996, 316.149994, 310.570007, 307.779999, 305.820007, 305.98999, 306.390015, 311.450012, 312.329987, 309.290009, 301.910004, 300, 300.029999, 302, 307.820007, 302.690002, 306.48999, 305.549988, 303.429993, }) // Initialize the %B indicator percentB := volatility.NewPercentB[float64]() // Compute %B result := percentB.Compute(closes) // Round digits result = helper.RoundDigits(result, 2) fmt.Println(helper.ChanToSlice(result)) } ``` -------------------------------- ### Get Bollinger Band Width Idle Period Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Returns the number of periods before the Bollinger Band Width indicator starts producing valid results. This is determined by the lookback period of the underlying Bollinger Bands. ```go func (b *BollingerBandWidth[T]) IdlePeriod() int ``` -------------------------------- ### KST Example Usage Source: https://github.com/cinar/indicator/blob/master/trend/README.md Demonstrates how to initialize and configure a KST indicator with specific periods for ROC, SMA, and signal lines, and then compute the KST and signal results. ```go kst := trend.NewKst[float64]() kst.RocPeriod1 = 10 kst.RocPeriod2 = 15 kst.RocPeriod3 = 20 kst.RocPeriod4 = 30 kst.SmaPeriod1 = 10 kst.SmaPeriod2 = 10 kst.SmaPeriod3 = 10 kst.SmaPeriod4 = 15 kst.SignalPeriod = 9 kstResult, signalResult := kst.Compute(c) ``` -------------------------------- ### Initialize NegativeVolumeIndexStrategy (Default) Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Initializes a new Negative Volume Index strategy instance with default parameters. ```go func NewNegativeVolumeIndexStrategy() *NegativeVolumeIndexStrategy ``` -------------------------------- ### FileSystemRepository Get Method Signature Source: https://github.com/cinar/indicator/blob/master/asset/README.md Signature for the Get method of FileSystemRepository. Fetches snapshots for a given asset name. ```go func (r *FileSystemRepository) Get(name string) (<-chan *Snapshot, error) ``` -------------------------------- ### Compute Actions for PercentBandMFIStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Processes asset snapshots to generate a stream of actionable recommendations. Requires a channel of asset snapshots. ```go func (m *PercentBandMFIStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan strategy.Action ``` -------------------------------- ### NewFileSystemRepository Function Source: https://github.com/cinar/indicator/blob/master/asset/README.md Initializes a file system repository. ```APIDOC ### func [NewFileSystemRepository]() ```go func NewFileSystemRepository(base string, csvOptions ...helper.CsvOption[Snapshot]) *FileSystemRepository ``` NewFileSystemRepository initializes a file system repository with the given base directory and the CSV options. ``` -------------------------------- ### Initialize New PercentBandMFIStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Initializes a new PercentBandMFI strategy instance with default parameters. No arguments are required. ```go func NewPercentBandMFIStrategy() *PercentBandMFIStrategy ``` -------------------------------- ### InMemoryRepository Get Method Signature Source: https://github.com/cinar/indicator/blob/master/asset/README.md Signature for the Get method of InMemoryRepository. Retrieves snapshots from memory for a given asset name. ```go func (r *InMemoryRepository) Get(name string) (<-chan *Snapshot, error) ``` -------------------------------- ### Create New SQL Repository Source: https://github.com/cinar/indicator/blob/master/asset/README.md Connects to a SQL database for the asset repository using the provided driver, URL, and dialect. ```go func NewSQLRepository(dbDriver, dbURL string, dialect SQLRepositoryDialect) (*SQLRepository, error) ``` -------------------------------- ### TiingoRepository Initialization Source: https://github.com/cinar/indicator/blob/master/asset/README.md Initializes a file system repository with the given API key. ```APIDOC ## NewTiingoRepository ### Description Initializes a file system repository with the given API key. ### Signature ```go func NewTiingoRepository(apiKey string) *TiingoRepository ``` ``` -------------------------------- ### Initialize FileSystemRepository in Go Source: https://github.com/cinar/indicator/blob/master/asset/README.md Constructor for FileSystemRepository. It initializes the repository using a base directory and optional CSV parsing options for Snapshot data. ```go func NewFileSystemRepository(base string, csvOptions ...helper.CsvOption[Snapshot]) *FileSystemRepository ``` -------------------------------- ### Example Usage of Moving Least Square Source: https://github.com/cinar/indicator/blob/master/trend/README.md Example of how to create and use the Moving Least Square indicator. It initializes the indicator with a period and computes slope and intercept. ```go mls := trend.NewMlsWithPeriod[float64](14) ms, bs := mls.Compute(x , y) ``` -------------------------------- ### Initialize PercentBandMFIStrategy with Custom Thresholds Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Initializes a new PercentBandMFI strategy instance with custom thresholds for %B and MFI. Requires four float64 parameters. ```go func NewPercentBandMFIStrategyWith(sellPercentBAt, buyPercentBAt, sellMfiAt, buyMfiAt float64) *PercentBandMFIStrategy ``` -------------------------------- ### Initialize NegativeVolumeIndexStrategy (Custom) Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Initializes a new Negative Volume Index strategy instance with a specified EMA period. ```go func NewNegativeVolumeIndexStrategyWith(emaPeriod int) *NegativeVolumeIndexStrategy ``` -------------------------------- ### Get CfoStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Returns the name of the CfoStrategy. ```go func (*CfoStrategy) Name() string ``` -------------------------------- ### Get CciStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Returns the name of the CciStrategy. ```go func (*CciStrategy) Name() string ``` -------------------------------- ### Initialize New BopStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Initializes a new BoP strategy instance with default parameters. ```go func NewBopStrategy() *BopStrategy ``` -------------------------------- ### Compute Actions with BopStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Processes asset snapshots to generate actionable recommendations using the BopStrategy. ```go func (b *BopStrategy) Compute(c <-chan *asset.Snapshot) <-chan strategy.Action ``` -------------------------------- ### Get BopStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Returns the name of the BopStrategy. ```go func (*BopStrategy) Name() string ``` -------------------------------- ### Get StopLossStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/decorator/README.md Returns the name of the StopLossStrategy. ```go func (s *StopLossStrategy) Name() string ``` -------------------------------- ### Initialize ForceIndexStrategy with Default Parameters Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Initializes a new Force Index strategy instance using default settings. ```go func NewForceIndexStrategy() *ForceIndexStrategy ``` -------------------------------- ### Import Valuation Package Source: https://github.com/cinar/indicator/blob/master/valuation/README.md Import the valuation package for financial calculations. ```go import "github.com/cinar/indicator/v2/valuation" ``` -------------------------------- ### Get InverseStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/decorator/README.md Returns the name of the InverseStrategy. ```go func (i *InverseStrategy) Name() string ``` -------------------------------- ### Get Name of MacdRsiStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/compound/README.md Returns the name of the MACD-RSI strategy. ```go func (m *MacdRsiStrategy) Name() string ``` -------------------------------- ### Initialize EaseOfMovementStrategy with Default Parameters Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Initializes a new Ease of Movement strategy instance using default settings. ```go func NewEaseOfMovementStrategy() *EaseOfMovementStrategy ``` -------------------------------- ### Initialize New TrixStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Initializes a new TrixStrategy instance with default parameters. ```go func NewTrixStrategy() *TrixStrategy ``` -------------------------------- ### Get KAMA Strategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Returns the name of the KAMA strategy. ```go func (k *KamaStrategy) Name() string ``` -------------------------------- ### Initialize New ObvStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Initializes a new OBV strategy instance with default parameters. No arguments are required. ```go func NewObvStrategy() *ObvStrategy ``` -------------------------------- ### Get Name of NegativeVolumeIndexStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Returns the name of the Negative Volume Index strategy. ```go func (n *NegativeVolumeIndexStrategy) Name() string ``` -------------------------------- ### Get Name of MoneyFlowIndexStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Returns the name of the Money Flow Index strategy. ```go func (m *MoneyFlowIndexStrategy) Name() string ``` -------------------------------- ### Initialize WilliamsRStrategy with Custom Parameters Source: https://github.com/cinar/indicator/blob/master/strategy/momentum/README.md Initializes a new Williams R strategy instance with custom buy and sell threshold parameters. Use this when default thresholds are not suitable. ```go func NewWilliamsRStrategyWith(buyAt, sellAt float64) *WilliamsRStrategy ``` -------------------------------- ### Get Name of ForceIndexStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Returns the string name of the Force Index strategy. ```go func (f *ForceIndexStrategy) Name() string ``` -------------------------------- ### Initialize New DEMA Instance Source: https://github.com/cinar/indicator/blob/master/trend/README.md Initializes a new DEMA instance with default parameters. Use this when you need a DEMA calculation with standard settings. ```go func NewDema[T helper.Number]() *Dema[T] ``` -------------------------------- ### Initialize New Ichimoku Cloud Strategy Source: https://github.com/cinar/indicator/blob/master/strategy/momentum/README.md Initializes a new Ichimoku Cloud strategy with default parameters. Use this when no custom configuration is needed. ```go func NewIchimokuCloudStrategy() *IchimokuCloudStrategy ``` -------------------------------- ### Get Name of EaseOfMovementStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Returns the string name of the Ease of Movement strategy. ```go func (e *EaseOfMovementStrategy) Name() string ``` -------------------------------- ### TiingoRepository Get Source: https://github.com/cinar/indicator/blob/master/asset/README.md Attempts to return a channel of snapshots for the asset with the given name. ```APIDOC ## (*TiingoRepository) Get ### Description Attempts to return a channel of snapshots for the asset with the given name. ### Signature ```go func (r *TiingoRepository) Get(name string) (<-chan *Snapshot, error) ``` ``` -------------------------------- ### Initialize New Sync Instance Source: https://github.com/cinar/indicator/blob/master/asset/README.md NewSync function initializes a new sync instance with the default parameters. Use this to create a Sync object. ```go func NewSync() *Sync ``` -------------------------------- ### Compute Actions for ObvStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Processes asset snapshots to generate a stream of actionable recommendations. Requires a channel of asset snapshots. ```go func (s *ObvStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan strategy.Action ``` -------------------------------- ### Get Golden Cross Strategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Returns the name of the Golden Cross strategy. ```go func (*GoldenCrossStrategy) Name() string ``` -------------------------------- ### Get String Representation of Percent B Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Returns the string representation of the %B indicator. ```go func (p *PercentB[T]) String() string ``` -------------------------------- ### Example Usage of ATR Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Demonstrates how to create a new ATR instance and compute the indicator using provided price data. Ensure that the input channels (highs, lows, closings) are populated before calling Compute. ```go atr := NewAtr() atr.Compute(highs, lows, closings) ``` -------------------------------- ### Get PercentBandMFIStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Returns the name of the PercentBandMFI strategy. This is a simple getter function. ```go func (m *PercentBandMFIStrategy) Name() string ``` -------------------------------- ### Get ObvStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Returns the name of the OBV strategy. This is a simple getter function. ```go func (s *ObvStrategy) Name() string ``` -------------------------------- ### Compute Actions with CfoStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Processes asset snapshots and generates a stream of actionable recommendations using the CfoStrategy. ```go func (c *CfoStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan strategy.Action ``` -------------------------------- ### Get ChaikinMoneyFlowStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Returns the string name of the Chaikin Money Flow strategy. ```go func (c *ChaikinMoneyFlowStrategy) Name() string ``` -------------------------------- ### Calculate EMV Source: https://github.com/cinar/indicator/blob/master/volume/README.md Initializes a new EMV instance with default parameters. Use this for standard EMV calculations. ```go emv := volume.NewEmv[float64]() result := emv.Compute(highs, lows, volumes) ``` -------------------------------- ### Get All Compound Strategies Source: https://github.com/cinar/indicator/blob/master/strategy/compound/README.md Returns a slice containing references to all available compound strategies. ```go func AllStrategies() []strategy.Strategy ``` -------------------------------- ### Initialize MoneyFlowIndexStrategy (Default) Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Initializes a new Money Flow Index strategy instance with default parameters. ```go func NewMoneyFlowIndexStrategy() *MoneyFlowIndexStrategy ``` -------------------------------- ### Get WeightedCloseStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Returns the name of the WeightedCloseStrategy. This is useful for identifying the strategy in logs or reports. ```go func (w *WeightedCloseStrategy) Name() string ``` -------------------------------- ### Get MACD Strategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Returns the name of the MACD strategy. Useful for identification and logging. ```go func (m *MacdStrategy) Name() string ``` -------------------------------- ### Get KDJ Strategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Returns the name of the KDJ strategy. Useful for identification and logging. ```go func (*KdjStrategy) Name() string ``` -------------------------------- ### NewEnvelopeStrategyWith Initialization Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Initializes a new Envelope strategy with a provided Envelope instance. ```go func NewEnvelopeStrategyWith(envelope *trend.Envelope[float64]) *EnvelopeStrategy ``` -------------------------------- ### Get String Representation of Ultimate Oscillator Source: https://github.com/cinar/indicator/blob/master/momentum/README.md String returns the string representation of the Ultimate Oscillator. ```go func (u *UltimateOscillator[T]) String() string ``` -------------------------------- ### Get Strategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/momentum/README.md Returns the name of the Williams R strategy. This is a simple getter method. ```go func (r *WilliamsRStrategy) Name() string ``` -------------------------------- ### Hma IdlePeriod Method Source: https://github.com/cinar/indicator/blob/master/trend/README.md Returns the initial period before the HMA indicator starts yielding results. ```go func (h *Hma[T]) IdlePeriod() int ``` -------------------------------- ### Initialize PPO Indicator Source: https://github.com/cinar/indicator/blob/master/momentum/README.md Creates and initializes a new instance of the Percentage Price Oscillator (PPO) indicator. ```go func NewPpo[T helper.Number]() *Ppo[T] ``` -------------------------------- ### Envelope IdlePeriod Method Source: https://github.com/cinar/indicator/blob/master/trend/README.md Returns the initial period before the Envelope indicator starts yielding results. ```go func (e *Envelope[T]) IdlePeriod() int ``` -------------------------------- ### Initialize New CfoStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Initializes a new CFO strategy instance with default parameters. ```go func NewCfoStrategy() *CfoStrategy ``` -------------------------------- ### TsiStrategy IdlePeriod Function Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Returns the initial period before the TSI strategy starts yielding results. ```go func (t *TsiStrategy) IdlePeriod() int ``` -------------------------------- ### Initialize MoneyFlowIndexStrategy (Custom) Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Initializes a new Money Flow Index strategy instance with custom buy and sell thresholds. ```go func NewMoneyFlowIndexStrategyWith(sellAt, buyAt float64) *MoneyFlowIndexStrategy ``` -------------------------------- ### NewEnvelopeStrategy Initialization Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Initializes a new Envelope strategy with default parameters. ```go func NewEnvelopeStrategy() *EnvelopeStrategy ``` -------------------------------- ### Get KST String Representation Source: https://github.com/cinar/indicator/blob/master/trend/README.md Provides a string representation of the KST indicator. This is helpful for debugging or logging. ```go func (k *Kst[T]) String() string ``` -------------------------------- ### Initialize New ChaikinMoneyFlowStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/volume/README.md Creates a new instance of the Chaikin Money Flow strategy with default parameters. No arguments are needed. ```go func NewChaikinMoneyFlowStrategy() *ChaikinMoneyFlowStrategy ``` -------------------------------- ### Get Asset Names from SQL Repository Source: https://github.com/cinar/indicator/blob/master/asset/README.md Retrieves the names of all assets currently stored in the SQL repository. ```go func (s *SQLRepository) Assets() ([]string, error) ``` -------------------------------- ### Get RsiStrategy Name Source: https://github.com/cinar/indicator/blob/master/strategy/momentum/README.md Returns the name of the RSI strategy. This is useful for identifying the strategy in logs or configurations. ```go func (r *RsiStrategy) Name() string ``` -------------------------------- ### Create New Repository Source: https://github.com/cinar/indicator/blob/master/asset/README.md Function to build a new repository by the given name type and the configuration. ```go func NewRepository(name, config string) (Repository, error) ``` -------------------------------- ### Run MCP Server Source: https://context7.com/cinar/indicator/llms.txt Starts the Model Context Protocol (MCP) server, which exposes backtesting functionality. The server can be used to integrate with AI assistants and automated systems. ```go import "github.com/cinar/indicator/mcp" // Start the MCP server server := mcp.RunMCPServer() // The server exposes backtest tools that accept: // - Strategy type (e.g., "rsi", "macd", "golden_cross") // - OHLCV data arrays // And returns action recommendations (Buy, Sell, Hold) // Available strategy types strategies := mcp.GetAllStrategyTypes() // Returns: ["buy_and_hold", "rsi", "macd", "golden_cross", "aroon", ...] ``` -------------------------------- ### Compute Trading Actions from Snapshots Source: https://github.com/cinar/indicator/blob/master/strategy/momentum/README.md Processes asset snapshots to generate a stream of actionable trading recommendations. Requires a channel of asset snapshots as input. ```go func (r *WilliamsRStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan strategy.Action ``` -------------------------------- ### Initialize Default ChandelierExit Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Initializes a new Chandelier Exit instance with default parameters. Use this for standard trailing stop-loss calculations. ```go func NewChandelierExit[T helper.Number]() *ChandelierExit[T] ``` -------------------------------- ### Get WMA String Representation Source: https://github.com/cinar/indicator/blob/master/trend/README.md Provides a string representation of the WMA instance. This is helpful for debugging and logging purposes. ```go func (w *Wma[T]) String() string ``` -------------------------------- ### Initialize New CciStrategy Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Initializes a new CCI strategy instance. ```go func NewCciStrategy() *CciStrategy ``` -------------------------------- ### Get Streak Idle Period in Go Source: https://github.com/cinar/indicator/blob/master/momentum/README.md IdlePeriod returns the initial period during which the Streak calculation will not yield any results. ```go func (s *Streak[T]) IdlePeriod() int ``` -------------------------------- ### Get Percent B Indicator Idle Period Source: https://github.com/cinar/indicator/blob/master/volatility/README.md Returns the initial period during which the %B indicator will not yield any results. ```go func (p *PercentB[T]) IdlePeriod() int ``` -------------------------------- ### Initialize WilliamsRStrategy with Default Parameters Source: https://github.com/cinar/indicator/blob/master/strategy/momentum/README.md Initializes a new Williams R strategy instance with default parameters. No specific setup is required beyond calling this function. ```go func NewWilliamsRStrategy() *WilliamsRStrategy ``` -------------------------------- ### Get Idle Period for VPT Indicator Source: https://github.com/cinar/indicator/blob/master/volume/README.md IdlePeriod returns the idle period for the Volume-Price Trend (VPT) indicator. ```go func (*Vpt[T]) IdlePeriod() int ``` -------------------------------- ### Get Idle Period for OBV Indicator Source: https://github.com/cinar/indicator/blob/master/volume/README.md IdlePeriod returns the idle period for the On-Balance Volume (OBV) indicator. ```go func (*Obv[T]) IdlePeriod() int ``` -------------------------------- ### Initialize New MACD Strategy Source: https://github.com/cinar/indicator/blob/master/strategy/trend/README.md Initializes a new MACD strategy instance with default parameters. Use this for a standard MACD calculation. ```go func NewMacdStrategy() *MacdStrategy ``` -------------------------------- ### Get Idle Period for FI Indicator Source: https://github.com/cinar/indicator/blob/master/volume/README.md IdlePeriod returns the idle period for the Force Index (FI) indicator. ```go func (f *Fi[T]) IdlePeriod() int ``` -------------------------------- ### Initialize New MacdRsiStrategy with Custom Parameters Source: https://github.com/cinar/indicator/blob/master/strategy/compound/README.md Initializes a new MACD-RSI strategy instance with user-specified buy and sell thresholds. ```go func NewMacdRsiStrategyWith(buyAt, sellAt float64) *MacdRsiStrategy ```