Skip to content

Commit

Permalink
fix candles
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfatman committed Oct 26, 2024
1 parent ad22b4d commit a985115
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions polygon/client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package polygon

import (
"os"
"testing"
)

var ApiKey = os.Getenv("POLYGON_API_KEY")

func TestClient_GetLatestCandles(t *testing.T) {
client := NewClient("api.polygon.io", ApiKey)
client.GetLatestCandles("EUR-USD")
}
2 changes: 1 addition & 1 deletion twelve_data/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewClient(host string, apiKey string) *Client {
func (c *Client) GetLatestCandles(symbol string, micCode string) []*data.Candle {
client := resty.New()
url := fmt.Sprintf(
"https://%s/time_series?symbol=%s&interval=1min&apikey=%s&mic_code=%s",
"https://%s/time_series?symbol=%s&interval=1min&apikey=%s&mic_code=%s&outputsize=5000",
c.host, symbol, c.apiKey, micCode,
)
resp, err := client.R().Get(url)
Expand Down
13 changes: 13 additions & 0 deletions twelve_data/client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package twelve_data

import (
"os"
"testing"
)

var ApiKey = os.Getenv("TWELVE_DATA_API_KEY")

func TestClient_GetLatestCandles(t *testing.T) {
client := NewClient("api.twelvedata.com", ApiKey)
client.GetLatestCandles("WTI/USD", "COMMODITY")
}

0 comments on commit a985115

Please sign in to comment.