Documentation ¶
Index ¶
- Variables
- func ClosePrevFile(fileName string)
- func CreateClient() *luno.Client
- func Ema(oldVal decimal.Decimal, newData decimal.Decimal, period int64) decimal.Decimal
- func Email(action string, yield decimal.Decimal)
- func GetCurrAsk() decimal.Decimal
- func GetRsi(PrevAsk decimal.Decimal, currAsk decimal.Decimal, UpEma decimal.Decimal, ...) (decimal.Decimal, decimal.Decimal, decimal.Decimal)
- func GetTickerRes() luno.GetTickerResponse
- func Hammer(stick Candlestick) bool
- func InitialSma(array []decimal.Decimal, length int64) decimal.Decimal
- func InitialiseKeys()
- func InverseHammer(stick Candlestick) bool
- func LoadScreen()
- func MorningStar(stick1 Candlestick, stick2 Candlestick, stick3 Candlestick) bool
- func PopulateFile(b *RsiBot, ask decimal.Decimal, bid decimal.Decimal, rsi decimal.Decimal)
- func PrintStatus(b *RsiBot, currAsk decimal.Decimal, currBid decimal.Decimal, status string, ...)
- func Rev123(stick1 Candlestick, stick2 Candlestick, stick3 Candlestick) bool
- func SetUpNewFile()
- func Sma(array []decimal.Decimal) decimal.Decimal
- func TradeLive(b *RsiBot)
- func WhiteSlaves(stick1 Candlestick, stick2 Candlestick, stick3 Candlestick) bool
- type Candlestick
- type RsiBot
Constants ¶
This section is empty.
Variables ¶
View Source
var ApiKeys map[string]([]string)
View Source
var Client *luno.Client
Global Variables
View Source
var PairName string
View Source
var User string
Functions ¶
func ClosePrevFile ¶
func ClosePrevFile(fileName string)
func CreateClient ¶
func GetCurrAsk ¶
func GetRsi ¶
func GetRsi(PrevAsk decimal.Decimal, currAsk decimal.Decimal, UpEma decimal.Decimal, DownEma decimal.Decimal, period int64) (decimal.Decimal, decimal.Decimal, decimal.Decimal)
function to calculate the Relative Strength Index
func GetTickerRes ¶
func GetTickerRes() luno.GetTickerResponse
func Hammer ¶
func Hammer(stick Candlestick) bool
func InitialSma ¶
InitialSma function to calculate the simple moving average of a given set of data
func InitialiseKeys ¶
func InitialiseKeys()
Please replace <NAME>, <KEY_ID> and <SECRET> with your respective values
func InverseHammer ¶
func InverseHammer(stick Candlestick) bool
func LoadScreen ¶
func LoadScreen()
func MorningStar ¶
func MorningStar(stick1 Candlestick, stick2 Candlestick, stick3 Candlestick) bool
func PopulateFile ¶
func PrintStatus ¶
func Rev123 ¶
func Rev123(stick1 Candlestick, stick2 Candlestick, stick3 Candlestick) bool
func SetUpNewFile ¶
func SetUpNewFile()
func WhiteSlaves ¶
func WhiteSlaves(stick1 Candlestick, stick2 Candlestick, stick3 Candlestick) bool
Types ¶
type Candlestick ¶
type Candlestick struct { OpenAsk decimal.Decimal CloseAsk decimal.Decimal MaxAsk decimal.Decimal MinAsk decimal.Decimal OpenBid decimal.Decimal CloseBid decimal.Decimal MaxBid decimal.Decimal MinBid decimal.Decimal }
func GetCandleStick ¶
func GetCandleStick(tradinginterval int64) Candlestick
type RsiBot ¶
type RsiBot struct { TradesMade int64 // total number of trades executed NumOfDecisions int64 // number of times the bot calculates StopLoss decimal.Decimal // variable stop loss StopLossMult decimal.Decimal // multiplier for stop loss OverSold decimal.Decimal // bound to tell the bot when to buy ReadyToBuy bool // false means ready to sell BuyPrice decimal.Decimal // stores most recent price we bought at SellPrice decimal.Decimal // stores most recent price we sold at UpEma decimal.Decimal // exponentially smoothed Wilder's MMA for upward change DownEma decimal.Decimal // exponentially smoothed Wilder's MMA for downward change PrevAsk decimal.Decimal // the previous recorded ask price PrevOrder string // stores order ID of most recent order RSITradingPeriod int64 // No of past asks used to calculate RSI MACDTradingPeriodLR int64 // Long term MACD period MACDTradingPeriodSR int64 // Short term MACD period CandleTradingPeriod int64 //candlestick period LongestTradingPeriod int64 // Longest of the trading periods MACDlongperiodavg decimal.Decimal // MACD long period average PastAsks []decimal.Decimal // array of previous ask prices MACDshortperiodavg decimal.Decimal // MACD short period average TimeInterval int64 //time between each test Stack []Candlestick //stack of candlesticks Offset decimal.Decimal //for offset bot OffsetTraingPeriod int64 // trading period for offset bot BotString string //string to determine which bots are being usde }
struct for the rsiBot
Click to show internal directories.
Click to hide internal directories.