Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
artlevitan committed Jan 11, 2023
1 parent c6ad6e6 commit fa63c35
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 173 deletions.
46 changes: 0 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,6 @@
# 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() {
tvData, err := tradingview.TradingViewData("BINANCE:BTCUSDT", tradingview.Interval4hour)
if err != nil {
fmt.Println(err)
}
fmt.Printf("%#v\n", tvData) // Full Data

// Get the value by key
recSummary := tvData["recommend_summary"] // Summary
fmt.Println(recSummary)

recOsc := tvData["recommend_summary"] // Oscillators
fmt.Println(recOsc)

recMA := tvData["recommend_moving_averages"] // 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
Loading

0 comments on commit fa63c35

Please sign in to comment.