Giter VIP home page Giter VIP logo

mop's People

Contributors

adelina-t avatar alice-margatroid avatar blmhemu avatar brandleesee avatar ccreighton-apptio avatar ceocoder avatar cskoven avatar cuihantao avatar dependabot[bot] avatar gideonwolfe avatar gitter-badger avatar hura avatar imvexed avatar joce avatar joce-unity avatar jordie avatar mendelgusmao avatar mig281 avatar mohit-agarwa1 avatar olegrumiancev avatar sam33r avatar spudone avatar thekrush avatar thierrybegin avatar wiechu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mop's Issues

Version not properly bumped

Several places wtill showing 0.2.0 as the current version in the code. I created PR #94 to address the situation. However, accepting the changes might make the actual the version 1.0.1. Feel free to ignore my PR and fix on your own.

bad filter crashes system in way difficult to recover

If one enters a invalid filter, the program terminates, AFTER writing the bad filter to the config file. Thus, any attempt to restart the program will fail until the config file is manually edited.

More fundamentally, a keyboard user-error shouldn't panic the program to crash.

And an invalid setting should not be save to disk.

I'm not a go programmer and don't have development set up, but eyeballing the code, I wonder if the fix is to alter line 137 in file profile.go from:

panic(err)

to:

profile.SetFilter("")

In other words, recursively call the function with a reset value, similar to what would happen when a user enters 'F'

Terminal Scrollbar

The terminal scrollbar does not work.

.moprc has more tickers than the 'screen' can handle.

Therefore, 36/45 are visible at anytime and cannot scroll the visualise the remaining.

Time zone not consistent (is PST, should be EST)

The correct local time is displayed, but the displayed time zone is different (and does not match the output of "date" on local computer). For instance, it is currently 2:24 EST but the time displayed is 2:24 PST. I looked for a configuration file, but didn't see anything in .moprc.

Error on Mac

Followed the instructions about setting up go workspace etc...

go get github.com/mop-tracker/mop/cmd/mop

results in

go get: module github.com/mop-tracker/mop@upgrade found (v0.2.0), but does not contain package github.com/mop-tracker/mop/cmd/mop

Mop on RPI CPU Issue ?

Hi,
I'm running mop on a raspberry Pi B+.
Don't know if this is a real isssue or not, but mop is using about 100% of the cpu when running on raspberry.

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1071 root 20 0 848888 11256 5496 S 97,1 2,3 32:12.37 mop
Ps : I've added all the PA(PARIS) stock tickets in mop (about +200)

Have someone reproduced this issue ?
Thanks in advance

Filters not working

It seems like the filter only works for the Ticker column, where you can match a string: ticker=="IBM" If you filter on a numerical column, like in the example in the readme (last <= 5), the filter fails and is cleared in the next cycle. An example is below, where I try to filter on the "last" value.

Here is the filter expression being entered:
Screenshot from 2021-11-26 23-46-25

No results are returned. The display goes blank for a cycle, and then the filter is cleared by one of my earlier patches.
Screenshot from 2021-11-26 23-46-31

Note that filtering on a string works, e.g. filtering on ticker=="C":

Screenshot from 2021-11-26 23-45-58

Error fetching market data...

Error fetching market data...                                                                                                                                                                                                    9:18:23pm PDT
runtime error: slice bounds out of range [:-1] d tcp 192.168.1.170:52447-> 151.101.21.67:443: read: can't assign requested address

image

On a Mac OS / Darwin ARM64 system.

Sorting "change" column does not evaluate decimal value correctly

Version: Master as of 4-6-2020

mopscreenshot

Overview of Issue: I was sorting the change column with screen shot attached. As you can see "TSLA" at the time is 29.48 and is greater than "KMX" which is at 3.32. "TSLA" is higher and it appears is being evaluated by the the decimal from left to right and not the whole value.

Loading mop with invalid .moprc will wipe .moprc file

If you modify the .moprc file by and and mistakenly leave a wrong coma somewhere, the whole file will get wiped.
If the .moprc file is malformed, I would expect the program to let me know and leave the .moprc file untouched.

current timezone in top right corner (not time) changes for every quote-refresh

Screenshot 2019-10-16 at 11 29 34

"1" is added to current time for every quote-refresh.
It at least seem to occur every 5s. I couldn't immediately find the cause in the code.

EDIT:
... and, the timezone seems to flip between "PST" (when 1 is added) and "CEST". The actual timestamp does however not seem to flip between CEST and PST timezone.

EDIT2:
It seems that it's not the value "1" that is added to the time string - as it's also happening now (at 3 o' clock) with a leading "3". Maybe it's because the string is one character shorter (PST vs CEST) and is written "on top" of the other string - without removing it?

Maybe you have another idea?

After hours and pre hours trading support

Love this program. Just started using it. I always check this program to verify the prices I see online, because sometimes web pages stick and need to be refreshed. Works great for the main trading session of the day, but there are actually three trading session, the pre hours, regular hours and after hours sessions. I know we have the change % -which incidentally would be nice to be able to move that to the left rather then have to set a 13 font size on the terminal which is too small for anyone who's farsighted to see without strain-, we have the change %, but it would be great to see the actual values during all three trading sessions, not just the main session. Maybe I'll give the program a go myself. :)
Thanks! Bill

Error fetching stock quotes... runtime error: index out of range

I'm a complete noob on this, but I followed the install instructions.
When I launch mop, i get
Error fetching stock quotes... runtime error: index out of range
And when I try to type one of the commands listed it doesn't let me type them in.
I failed something in installation or is this an issue?
schermata del 2017-11-17 18-28-25

Unable to parse http://money.cnn.com/data/markets/

Looks like they've updated their HTML. Do the developers have a good engineering estimate for this? I'd be interested in submitting a fix if this is something a relative Go-newbie could figure out.

Change output colors

Is it possible to put up/down color settings in the .moprc profile, so that we can change colors to suit our schemes?

Crashes with open or last filter

version: 2021.05.18-1 (arch current)
filter: open <= 5

panic: Value '20.99' cannot be used with the comparator '<=', it is not a number

goroutine 1 [running]:
github.com/mop-tracker/mop.(*Filter).Apply(0xc0001fa018, {0xc000310a00, 0x1a, 0xc00036dcc0})
github.com/mop-tracker/mop/filter.go:53 +0xbf6
github.com/mop-tracker/mop.(*Layout).prettify(0xc000094000, 0xc000094c40)
github.com/mop-tracker/mop/layout.go:172 +0x132
github.com/mop-tracker/mop.(*Layout).Quotes(0xc000094000, 0xc000094c40)
github.com/mop-tracker/mop/layout.go:106 +0x197
github.com/mop-tracker/mop.(*Screen).Draw(0xc000092000, {0xc0001afdd0, 0x1, 0x0})
github.com/mop-tracker/mop/screen.go:100 +0x314
main.mainLoop(0xc000092000, 0xc0000ce1c0)
github.com/mop-tracker/mop/cmd/mop/main.go:120 +0x39b
main.main()
github.com/mop-tracker/mop/cmd/mop/main.go:145 +0x15a

Quick Visual Reference: Sparklines

I might take this on.

Maybe some candle sticks, RSI/MACD? Is it not possible and that's why nobody has done it yet? I guess I'll soon find out.

Homebrew install error

$ brew install --build-from-source ./mop/homebrew/mop.rb
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from 0546d90e3 to 0d33aba0b.
No changes to formulae.

Error: undefined method `sha1' for Formulary::FormulaNamespace52726188351773fc098e4d5f1fa11500::Mop:Class
Please report this bug:
  https://docs.brew.sh/Troubleshooting
/Users/keshi/Documents/Projects/GO/mop/homebrew/mop.rb:7:in `<class:Mop>'
/Users/keshi/Documents/Projects/GO/mop/homebrew/mop.rb:3:in `load_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:26:in `module_eval'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:26:in `load_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:46:in `load_formula_from_path'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:101:in `load_file'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:92:in `klass'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:88:in `get_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:281:in `factory'
/usr/local/Homebrew/Library/Homebrew/extend/ARGV.rb:46:in `block in formulae'
/usr/local/Homebrew/Library/Homebrew/extend/ARGV.rb:44:in `map'
/usr/local/Homebrew/Library/Homebrew/extend/ARGV.rb:44:in `formulae'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:118:in `install'
/usr/local/Homebrew/Library/Homebrew/brew.rb:100:in `<main>'

Mop "breaks" once in a while - likely when there is a problem with fetching from yahoo??

Quite often (as in, several times a day) I get the following (or similar?!) error:

"Get https://query1.finance.yahoo.com/v7/finance/quote\?symbols\=DANSKE.CO,ERIC-B.ST,FPKPEN.CO,SSO.OL,VWS.CO\&range\=1d\&interval\=5m\&indicators\=close\&includeTimestamps\=false\&includePrePost\=false\&corsDomain\=finance.yahoo.com\&.tsrc\=finance: read tcp 172.21.140.214:61687->87.248.1"

It seems like the ending of the error has been cropped off. But it was as much as I could retrieve.

The top left corner says: "Error fetching market data..."

Just below, it says:
"Get https://money.cnn.com/data/markets/: read tcp 172.21.140.214:62979->199.232.41.67:443: read: network is downt"

Screenshot
Screenshot 2020-01-23 at 14 27 37

It overlays/replaces the first line of the stocks in my portfolio.

Mop doesn't update the quotes/info when this error is present.

The clock in top right corner of mop still runs (as far as I remember).

It can be "circumvented" by just closing mop, and starting it again. It immediately works when restarted.

Could one add a "try: / except:" (or whatever that would be in the go-language) statement around the retrieval of information from yahoo, so the program doesn't break when there is an error?

Feature Request: Tracking Portfolio

Let me thank you for MOP. It is awesome that I can track the stock market form the command line. Superb. 🍻

I am wondering if you are planning to add some portfolio tracker to it? Let's say I buy X mount of stock at certain price and I want to track how much I am loosing or winning.

Make issues on Mac

Issue Description:

I downloaded mop by cloning this git repository. Then I issued the make command from the root folder of this repo. I see the following error after trying to make:

go run ./cmd/mop/main.go
cmd/mop/main.go:9:2: cannot find package "github.com/michaeldv/termbox-go" in any of:
	/usr/local/Cellar/go/1.11.4/libexec/src/github.com/michaeldv/termbox-go (from $GOROOT)
	/Users/og-dab/go/src/github.com/michaeldv/termbox-go (from $GOPATH)
cmd/mop/main.go:8:2: cannot find package "github.com/mop-tracker/mop" in any of:
	/usr/local/Cellar/go/1.11.4/libexec/src/github.com/mop-tracker/mop (from $GOROOT)
	/Users/og-dab/go/src/github.com/mop-tracker/mop (from $GOPATH)
make: *** [run] Error 1

I installed go from the homebrew package manager so all my symlinks are in /usr/local/Cellar/go/1.11.4/bin.

My path environment variable is:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin.

What can I do to remedy this error? Thank you.

Homebrew for Mac

Homebrew thread

This shall be the home for revamping the homebrew code to install on Mac. All other old and new issues relating to this subject will be closed and referenced here. Their conversation will also be continued here.

BREW
Error when installing using brew:
#47
Date of issue: 27.07.2018

MAKE
Error after cloning and installing through make:
#48
Date of issue: 21.01.2019

Error fetching market data...

data is not updating realtime -
above the tickers it says:

Error fetching market data...
runtime error: slice bounds out of range [:-1]

time is updating normally

This is on Arch Linux (KDE/Plasma)

image

read in multiple .moprc files

First, hats off to you for providing such a great lightweight program!

Just wondering if it's easy to provide a feature to read in multiple .moprc files? For example, if I create a one .moprc file for high-tech stocks, and create another .moprc for finance stocks, then if I just want to check all the financial stocks, I just need to open the corresponding .moprc file.

Thanks!!

New source for ticker data needed

http://download.finance.yahoo.com/d/quotes.csv?s=%s&f=sl1c1p2oghjkva2r2rdyj3j1 is no longer serving quote data. The following message is displayed:

It has come to our attention that this service is being used in violation of the Yahoo Terms of Service. As such, the service is being discontinued. For all future markets and equities data research, please refer to finance.yahoo.com.

In short, a new source for ticker data is needed to replace yahoo. There will likely be additional changes required to support any new data source.

Cannot make on Ubuntu 16.04

I would like to use mop as it looks really good.
I installed the go language and added export GOPATH="$HOME/workspace" to my .bashrc
I then ran source ~/.bashrc

I followed the instructions on the mop-tracker github page and get as far as:
cd $GOPATH/src/github.com/michaeldv/mop

When I run make make build or make install I get a couple of error messages:

~/workspace/src/github.com/michaeldv/mop $ make make: *** No targets specified and no makefile found. Stop.

~/workspace/src/github.com/michaeldv/mop $ make build make: *** No rule to make target 'build'. Stop.

~/workspace/src/github.com/michaeldv/mop $ make install make: *** No rule to make target 'install'. Stop.

Any idea what is wrong or how I can fix it?

Thank you
`

default colors are bad for the colorblind

The two hues used in the default colors are difficult to distinguish by people with red/green colorblindness (1 in 12 males). I love this terminal app concept, but consider defaulting to magenta and green or something more accessible for people with color vision deficiencies.

typical vision red/green colorblindness
image image

References

Won't build

$ sudo go get github.com/michaeldv/mop

github.com/michaeldv/termbox-go

/usr/lib/go/src/pkg/github.com/michaeldv/termbox-go/api.go:271: function ends without a return statement

filter value does not appear accurate

Here is my default view, snipped to two columns for clarity:

↑Ticker         Last
AMZN        $2736.12
FFIV         $139.11
GOOG        $1397.52
ORCL          $54.95
ZM           $255.19
IBM          $119.47

When I apply a filter such as last < 150

Amazon and Google are filtered out, but I still see Zoom ($255.19):

↑Ticker         Last
FFIV         $139.14
ORCL          $54.92
IBM          $119.41
ORCL          $54.92
ZM           $255.08
IBM          $119.41

Am I misunderstanding the usage of filter, and the value that is represented?

EDIT: After applying a filter, if I quit from mop-tracker and reopen, then the filter appears to be applied correctly. My first thought was some sort of refresh issue, but I waited for a few minutes before stopping mop-tracker.

Here is my .moprc:

{
  "Tickers": [
    "AMZN",
    "FFIV",
    "GOOG",
    "IBM",
    "ORCL",
    "RHT",
    "ZM"
  ],
  "MarketRefresh": 0,
  "QuotesRefresh": 0,
  "SortColumn": 0,
  "Ascending": true,
  "Grouped": true,
  "Filter": "last < 150"
}

Error Changing Sort Column - Index Out of Range

Tried to change the sort column to the PreMktChg% column. Program quit with this error:

panic: runtime error: index out of range [15] with length 15

goroutine 1 [running]:
github.com/mop-tracker/mop.(*Sorter).SortByCurrentColumn(0xc00015e030, 0xc0004bec00, 0x1d, 0x1d, 0xd)
	src/github.com/mop-tracker/mop/sorter.go:195 +0x929
github.com/mop-tracker/mop.(*Layout).prettify(0xc000064600, 0xc000198980, 0xc000166e40, 0xc0, 0xd)
	src/github.com/mop-tracker/mop/layout.go:177 +0x20f
github.com/mop-tracker/mop.(*Layout).Quotes(0xc000064600, 0xc000198980, 0xb162e0, 0xc00018ef2b)
	src/github.com/mop-tracker/mop/layout.go:105 +0x218
github.com/mop-tracker/mop.(*Screen).Draw(0xc000023140, 0xc000145c60, 0x1, 0x1, 0x0)
	src/github.com/mop-tracker/mop/screen.go:100 +0x1f3
github.com/mop-tracker/mop.(*ColumnEditor).execute(0xc0004123e0, 0x0)
	src/github.com/mop-tracker/mop/column_editor.go:84 +0xad
github.com/mop-tracker/mop.(*ColumnEditor).Handle(0xc0004123e0, 0xd0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xc000145d00)
	src/github.com/mop-tracker/mop/column_editor.go:44 +0xc7
main.mainLoop(0xc000023140, 0xc0001b9dc0)
	src/github.com/mop-tracker/mop/cmd/mop/main.go:97 +0x43a
main.main()
	src/github.com/mop-tracker/mop/cmd/mop/main.go:145 +0x1b5

Program wouldn't start again with the .moprc SortColumn set to 15. Set it back to 1 and program started up OK again.

Currency symbol

When adding tickers from non-US exchanges, the stock price is incorrectly shown as $

For example, AZN.L (listed on the FTSE) should be shown with a price in £ not $.

error: editor.regex.Split undefined

Tried installing mop this morning:

$ go get github.com/michaeldv/mop
# github.com/michaeldv/mop
go/src/github.com/michaeldv/mop/line_editor.go:204: editor.regex.Split undefined (type *regexp.Regexp has no field or method Split)

Should this variable be type *regexp instead of *regexp.Regexp?

Custom column sort order

I was wondering whether a custom option can be in implemented maybe by using an external textfile with the stocks displaced chronologically as one would wish to view them in terminal.

Would this be possible?

Thank you.

Cannot build

After the changes in go.sum introduced in bb3c408, cannot build:

go: github.com/mattn/go-runewidth@v0.0.3: missing go.sum entry; to add it:
	go mod download github.com/mattn/go-runewidth
go: downloading github.com/nsf/termbox-go v0.0.0-20201124104050-ed494de23a00
go: downloading github.com/Knetic/govaluate v3.0.0+incompatible
go: github.com/mattn/go-runewidth@v0.0.3: missing go.sum entry; to add it:
	go mod download github.com/mattn/go-runewidth

To fix it you can run:

rm go.sum
go get -u # <-- This can be ommited
go mod tidy

And push the changes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.