We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I noticed when I'm asking for chart with Interval: datetime.OneDay I always got only 1 candle which is strange... :(
I tried this: params := &chart.Params{ Symbol: "AAPL", Interval: datetime.OneDay, } iter := chart.Get(params) for iter.Next() { b := iter.Bar() fmt.Printf("%+v %s\n", b, datetime.FromUnix(b.Timestamp).Time().Format("02.01.2006 15:04:05")) }
What I do wrong, please?
Regards, Max
The text was updated successfully, but these errors were encountered:
Interval is the bar frequency, one day will give you one bar per day.
package main import ( "fmt" "github.com/piquette/finance-go/chart" "github.com/piquette/finance-go/datetime" ) func main() { params := &chart.Params{ Symbol: "AAPL", Interval: datetime.OneMin, } iter := chart.Get(params) for iter.Next() { b := iter.Bar() fmt.Printf("%+v %s\n", b, datetime.FromUnix(b.Timestamp).Time().Format("02.01.2006 15:04:05")) } }
will give you one bar per minute, over the last day. You can adjust the start/stop times with the Start and End chart parameters respectively.
Start
End
Sorry, something went wrong.
No branches or pull requests
Hello,
I noticed when I'm asking for chart with Interval: datetime.OneDay I always got only 1 candle which is strange... :(
I tried this:
params := &chart.Params{
Symbol: "AAPL",
Interval: datetime.OneDay,
}
iter := chart.Get(params)
for iter.Next() {
b := iter.Bar()
fmt.Printf("%+v %s\n", b, datetime.FromUnix(b.Timestamp).Time().Format("02.01.2006 15:04:05"))
}
What I do wrong, please?
Regards,
Max
The text was updated successfully, but these errors were encountered: