signal

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 5 Imported by: 0

README

GoCryptoTrader Backtester: Signal package

Build Status Software License GoDoc Coverage Status Go Report Card

This signal package is part of the GoCryptoTrader codebase.

This is still in active development

You can track ideas, planned features and what's in progress on this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.

Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack

Signal package overview

The signal event is created as a result of a data event being analysed via a strategy. Typically, there are three types of signal that should be expected buy, sell and donothing. An example of this is demonstrated in the RSI strategy. However, other signals can be raised such as MissingData. The signal event will contain data such as price, the direction as well as the reasoning for the signal decision with the GetWhy() function

Please click GoDocs chevron above to view current GoDoc information for this package

Contribution

Please feel free to submit any pull requests or suggest any desired features to be added.

When submitting a PR, please abide by our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Code must adhere to our coding style.
  • Pull requests need to be based on and opened against the master branch.

Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:

bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	common.EventHandler
	common.Directioner

	GetPrice() decimal.Decimal
	IsSignal() bool
	GetSellLimit() decimal.Decimal
	GetBuyLimit() decimal.Decimal
}

Event handler is used for getting trade signal details Example Amount and Price of current candle tick

type Signal

type Signal struct {
	event.Base
	OpenPrice  decimal.Decimal
	HighPrice  decimal.Decimal
	LowPrice   decimal.Decimal
	ClosePrice decimal.Decimal
	Volume     decimal.Decimal
	BuyLimit   decimal.Decimal
	SellLimit  decimal.Decimal
	Direction  order.Side
}

Signal contains everything needed for a strategy to raise a signal event

func (*Signal) GetBuyLimit

func (s *Signal) GetBuyLimit() decimal.Decimal

GetBuyLimit returns the buy limit

func (*Signal) GetDirection

func (s *Signal) GetDirection() order.Side

GetDirection returns the direction

func (*Signal) GetPrice

func (s *Signal) GetPrice() decimal.Decimal

GetPrice returns the price

func (*Signal) GetSellLimit

func (s *Signal) GetSellLimit() decimal.Decimal

GetSellLimit returns the sell limit

func (*Signal) IsSignal

func (s *Signal) IsSignal() bool

IsSignal returns whether the event is a signal type

func (*Signal) Pair

func (s *Signal) Pair() currency.Pair

Pair returns the currency pair

func (*Signal) SetBuyLimit

func (s *Signal) SetBuyLimit(f decimal.Decimal)

SetBuyLimit sets the buy limit

func (*Signal) SetDirection

func (s *Signal) SetDirection(st order.Side)

SetDirection sets the direction

func (*Signal) SetPrice

func (s *Signal) SetPrice(f decimal.Decimal)

SetPrice sets the price

func (*Signal) SetSellLimit

func (s *Signal) SetSellLimit(f decimal.Decimal)

SetSellLimit sets the sell limit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL