gotasty / tastypl

Track P/L, portfolio performance, net credit after rolls, for tastytraders
GNU General Public License v3.0
65 stars 21 forks source link

go build error #4

Open jasonnator opened 6 years ago

jasonnator commented 6 years ago

Once all packages were installed, I tried running per the README and received the error below. I removed and redownloaded the package, then tried > go build which results in the same error

....\tastypl.go:1259:12: undefined: chart.MarketHoursRange

freeurmind commented 6 years ago

Same problem here

$ go run tastypl.go -input ../tastyworks_transactions.csv -printpl -positions
# command-line-arguments
./tastypl.go:1259:12: undefined: chart.MarketHoursRange
timnovinger commented 5 years ago

I just tried this out today and am also stuck with the same problem. @gotasty, can you please help?

timnovinger commented 5 years ago

@jasonnator @freeurmind I got it figured out. The issue is that @gotasty forked the go-chart project (https://github.com/gotasty/go-chart) and code within this repo references changes made in that go-chart fork.

The reason for the fork was to define market hours, NYSE holidays, etc. which tastypl then needs in order to analyze the data.

To get it working you have to update dependency references in various places.

1.) run go get -u github.com/gotasty/go-chart to go fetch the forked dependency.

2.) change the following lines to refer to "gotasty" instead of "wcharczuk" in the following files

REPO: tastypl

REPO: gotasty/go-chart

3.) use the project like normal as described in the readme

jasonnator commented 5 years ago

@timnovinger great, thanks for the follow up!

Graeme22 commented 4 years ago

To anyone still having this issue or something similar: Since the original creator appears to be out of commission, my fork https://github.com/Graeme22/tastypl should be working and has step by step install instructions. Hope this helps!

fourjacks commented 3 years ago

I've followed all the installation instructions but keep getting this message:

tastypl.go:30:2: no required module provides package github.com/Graeme22/go-chart: working directory is not part of a module tastypl.go:31:2: no required module provides package github.com/Graeme22/go-chart/util: working directory is not part of a module tastypl.go:28:2: no required module provides package github.com/golang/glog: working directory is not part of a module tastypl.go:29:2: no required module provides package github.com/shopspring/decimal: working directory is not part of a module

Any help would be greatly appreciated. Thanks.

Graeme22 commented 3 years ago

I've followed all the installation instructions but keep getting this message:

tastypl.go:30:2: no required module provides package github.com/Graeme22/go-chart: working directory is not part of a module tastypl.go:31:2: no required module provides package github.com/Graeme22/go-chart/util: working directory is not part of a module tastypl.go:28:2: no required module provides package github.com/golang/glog: working directory is not part of a module tastypl.go:29:2: no required module provides package github.com/shopspring/decimal: working directory is not part of a module

Any help would be greatly appreciated. Thanks.

Hi @fourjacks,

I ran into the same issue. Looks like Go updated the language specification and modules are now on by default. I have added a new command to the readme which should fix the problem. Let me know if that works for you! (By the way, you should have to reinstall the libraries.)

fourjacks commented 3 years ago

Thanks very much for the quick response and help.

I ran through all the steps from the start and now I am getting a different error message:

"F0303 21:56:15.164828 27868 tastypl.go:331] can't convert -- to decimal goroutine 1 [running]: github.com/golang/glog.stacks(0xc000070800, 0xc00024ca00, 0x4a, 0x9b)"

That is followed by a long string of more lines like that and a bunch of links to destinations on the C: drive. Then it ends with:

"exit status 255"

Graeme22 commented 3 years ago

Thanks very much for the quick response and help.

I ran through all the steps from the start and now I am getting a different error message:

"F0303 21:56:15.164828 27868 tastypl.go:331] can't convert -- to decimal goroutine 1 [running]: github.com/golang/glog.stacks(0xc000070800, 0xc00024ca00, 0x4a, 0x9b)"

That is followed by a long string of more lines like that and a bunch of links to destinations on the C: drive. Then it ends with:

"exit status 255"

My guess is it's struggling with the money movement entries. A quick fix would be just remove those lines from the csv. I won't be updating the code base as it's kind of a mess, but I am looking at potentially rewriting everything in python down the road, should be a lot slimmer but less buggy.

fourjacks commented 3 years ago

Weird, still can't get this to work. I removed all the row entries from the CSV that are not options trades, and I'm still getting a string of errors.

Similar to before but now starts with:

F0304 16:17:38.416678 5144 tastypl.go:659] record #0, bad transaction date: parsing time "2/19/2021": extra text: "21" goroutine 1 [running]:

Graeme22 commented 3 years ago

Weird, still can't get this to work. I removed all the row entries from the CSV that are not options trades, and I'm still getting a string of errors.

Similar to before but now starts with:

F0304 16:17:38.416678 5144 tastypl.go:659] record #0, bad transaction date: parsing time "2/19/2021": extra text: "21" goroutine 1 [running]:

You're using the wrong CSV file. Try following the instructions again but with the CSV from the transactions tab.

fourjacks commented 3 years ago

I retraced my steps and re-read the directions. Went to the "History" tab then "Transactions." Did the custom date range, scrolled to the bottom as instructed, and exported to CSV. Still getting errors.

But seems you are on to something on the CSV, as now it is saying this:

F0304 22:41:51.352941 9360 tastypl.go:1575] CSV seems malformed goroutine 1 [running]: github.com/golang/glog.stacks(0xc000070700, 0xc000246d20, 0x43, 0x93)...

Graeme22 commented 3 years ago

I retraced my steps and re-read the directions. Went to the "History" tab then "Transactions." Did the custom date range, scrolled to the bottom as instructed, and exported to CSV. Still getting errors.

But seems you are on to something on the CSV, as now it is saying this:

F0304 22:41:51.352941 9360 tastypl.go:1575] CSV seems malformed goroutine 1 [running]: github.com/golang/glog.stacks(0xc000070700, 0xc000246d20, 0x43, 0x93)...

Gotcha. Could you open an issue on my fork please, and provide more details? Thanks.

fourjacks commented 3 years ago

Realized that I just opened an issue on the original. I don't see an option to open an issue on your fork?

Graeme22 commented 3 years ago

Realized that I just opened an issue on the original. I don't see an option to open an issue on your fork?

My apologies, for some reason they were disabled.