Skip to content

Commit

Permalink
v1.1.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
artlevitan committed Jan 11, 2023
1 parent fa63c35 commit 139a041
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
# go-tradingview-ta [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
An unofficial Go API simple wrapper to retrieve technical analysis from TradingView.

## Example
```go
package main

import (
"fmt"

tradingview "github.com/artlevitan/go-tradingview-ta"
)

func main() {
var tv tradingview.TVData
err := tv.Get("BINANCE:BTCUSDT", tradingview.Interval4hour)
if err != nil {
fmt.Println(err)
}
fmt.Printf("%#v\n", tv) // Full Data

// Get the value by key
recSummary := tv.Recommend.Summary // Summary
fmt.Println(recSummary)

recOsc := tv.Recommend.Oscillators // Oscillators
fmt.Println(recOsc)

recMA := tv.Recommend.MA // Moving Averages
fmt.Println(recMA)

// Text recommendation
switch recSummary {
case tradingview.SignalStrongSell:
fmt.Println("STRONG_SELL")
case tradingview.SignalSell:
fmt.Println("SELL")
case tradingview.SignalNeutral:
fmt.Println("NEUTRAL")
case tradingview.SignalBuy:
fmt.Println("BUY")
case tradingview.SignalStrongBuy:
fmt.Println("STRONG_BUY")
default:
fmt.Println("An error has occurred")
}
}

```

## License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
3 changes: 1 addition & 2 deletions tradingview.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2022-2023. All rights reserved.
// https://github.com/artlevitan/go-tradingview-ta
// 1.1.0
// License: MIT
// v1.1.0-beta.1

package tradingview

Expand Down

0 comments on commit 139a041

Please sign in to comment.