Skip to content
New issue

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

Issue on Ubuntu Mate. #172

Closed
Ianfinn1994 opened this issue Feb 4, 2021 · 21 comments
Closed

Issue on Ubuntu Mate. #172

Ianfinn1994 opened this issue Feb 4, 2021 · 21 comments
Labels
enhancement New feature or request

Comments

@Ianfinn1994
Copy link

Want to run it on my Raspberry Pi and have the crontab execute every 10 minutes. Getting this issue when building the image.

standard_init_linux.go:211: exec user process caused "exec format error"
failed to resize tty, using default size.

How could this error be rectified? Everything else is cool on the windows version.

@brndnmtthws
Copy link
Owner

Currently only amd64 is supported, not ARM.

In theory you should be able to get it working on ARM, given it's just a Java app, but I haven't tried.

If you want to try it yourself, you can build the Docker image locally (on your rasppi) and see if it works. Most likely it will fail, because we're currently using the bundled JVM instead of installing OpenJDK 8.

@brndnmtthws brndnmtthws added the enhancement New feature or request label Feb 4, 2021
@brndnmtthws
Copy link
Owner

Digging a little more into it, they do some really weird stuff in the TWS installer. Not only do they try and force a specific version of the JVM, but they also pin it to amd64. I think it can be overridden, but it requires modifying the installer. or bypassing it altogether.

@brndnmtthws
Copy link
Owner

Honestly, this whole installer is a massive dumpster fire. One option is to extract the files and copy the jars out manually from an amd64 machine.

I hope IBKR hires some engineers who know what they're doing some day.

@brndnmtthws
Copy link
Owner

Okay, after a lot of futzing about I think I have something that works with 08e20bd. Assuming the Docker build succeeds, you can try the latest now on your rasppi.

@Ianfinn1994
Copy link
Author

Ianfinn1994 commented Feb 4, 2021

wow thank you so much man
also yea its like they dont want the little people to make money.

@brndnmtthws
Copy link
Owner

also yea its like they dont want the little people to make money.

The name of the game is to get the money out of your pocket and into theirs.

@Ianfinn1994
Copy link
Author

Also boss, can I try this again on Ubuntu mate? I know the error has to do with the pi's processor. The docker build was successful on raspberry picks until the processor error came up. Is there any way to recompile the code using a compiler for the pi? I can figure it out just like I sort of did with this project. Or should I keep trying with pi os?

@brndnmtthws
Copy link
Owner

The image is available for arm now, do a docker pull brndnmtthws/thetagang:latest and it'll work.

@Ianfinn1994
Copy link
Author

Ianfinn1994 commented Feb 4, 2021

pi@delos:~/thetagang $ docker run --rm -i -v ~/thetagang:/etc/thetagang brndnmtthws/theta
gang:latest --config /etc/thetagang/thetagang.toml
Unable to find image 'brndnmtthws/thetagang:latest' locally
latest: Pulling from brndnmtthws/thetagang
docker: no matching manifest for linux/arm/v7 in the manifest list entries.
See 'docker run --help'.

Running on Raspberry Pi OS

@brndnmtthws
Copy link
Owner

brndnmtthws commented Feb 5, 2021

I didn't realize Pi OS was still 32 bit. I had a really tough time getting the armv7 OpenJDK working properly so I dropped it. Let my try something else.

Pi OS does have a aarch64 release, but it says they don't recommend using it for some reason.

@Ianfinn1994
Copy link
Author

It may be on the raspberry pi os? Yea i have an older pie that i put together with a GPIO fan and heat syncs. I want to have it run 247 with my IBKR stuff. You are a boss Brendan. Thank you very much. If you cant get it to work, ill try this raspberry image you suggested.

@brndnmtthws
Copy link
Owner

Here you go:

Screen Shot 2021-02-05 at 2 34 38 PM

Should work on both 32/64 bit arm.

@Ianfinn1994
Copy link
Author

YAAAY!!! thank you!!!

I compiled everything on my pi and it was working. I keep getting this error call in the sync log.

2021-02-05 18:48:31,034 ib_insync.client ERROR API connection failed: ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 4002)")
2021-02-05 18:48:31,034 ib_insync.client ERROR Make sure API port on TWS/IBG is open

Ill try updating my systems copy to the image you just published. See if that corrects the error. Thank you so much again boss, this has been such a huge eye opener. Ive learned a decent amount about coding thanks to this project.

@brndnmtthws
Copy link
Owner

2021-02-05 18:48:31,034 ib_insync.client ERROR API connection failed: ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 4002)")
2021-02-05 18:48:31,034 ib_insync.client ERROR Make sure API port on TWS/IBG is open

There could be a lot of things causing this. Most likely, for some reason, TWS is not launching properly. I've tested on aarch64, and it does work, but I don't have an armhf machine to test with right now.

@Ianfinn1994
Copy link
Author

Ianfinn1994 commented Feb 5, 2021

I used raspberry pi os.
Maybe try with Ubuntu mate?

@Ianfinn1994
Copy link
Author

Ianfinn1994 commented Feb 5, 2021

I installed the new docker image and tried to run it. Noticed you added a minimum pnl variable. How do i set it to 50%? 0.5?

New error

Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/schema.py", line 394, in validate
nvalue = Schema(svalue, error=e, ignore_extra_keys=i).validate(value)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/schema.py", line 415, in validate
raise SchemaWrongKeyError(message, e)
schema.SchemaWrongKeyError: Wrong key 'min_pnl' in {'pnl': 0.9, 'dte': 15, 'min_pnl': 50, 'calls': {'itm': True}, 'puts': {'itm': False}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/src/thetagang/main.py", line 35, in cli
start(config)
File "/src/thetagang/thetagang.py", line 33, in start
validate_config(config)
File "/src/thetagang/config.py", line 98, in validate_config
schema.validate(config)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/schema.py", line 398, in validate
raise SchemaError([message] + x.autos, [e] + x.errors)
schema.SchemaError: Key 'roll_when' error:
Wrong key 'min_pnl' in {'pnl': 0.9, 'dte': 15, 'min_pnl': 50, 'calls': {'itm': True}, 'puts': {'itm': False}}

@brndnmtthws
Copy link
Owner

It should be a float. 1.0 is 100%, 0 is 0%, 0.5 is 50%. I meant to make that value optional, that was a mistake.

I might change the behaviour of that too. I'm worried about the case where you sell covered calls, and they end up deep ITM. Currently my preference is to roll them, but that may result in margin getting eaten up if they're grossly mispriced. If the P&L is something like -100%, you'd have to set that value to -1 for them to be rolled.

@Ianfinn1994
Copy link
Author

I had tried to put 1.0 in and its still returning errors.

Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/schema.py", line 394, in validate
nvalue = Schema(svalue, error=e, ignore_extra_keys=i).validate(value)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/schema.py", line 415, in validate
raise SchemaWrongKeyError(message, e)
schema.SchemaWrongKeyError: Wrong key 'min_pnl' in {'pnl': 0.9, 'dte': 15, 'min_pnl': -1.0, 'calls': {'itm': True}, 'puts': {'itm': False}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/src/thetagang/main.py", line 35, in cli
start(config)
File "/src/thetagang/thetagang.py", line 33, in start
validate_config(config)
File "/src/thetagang/config.py", line 98, in validate_config
schema.validate(config)
File "/root/.cache/pypoetry/virtualenvs/thetagang-VsnhxLU2-py3.8/lib/python3.8/site-packages/schema.py", line 398, in validate
raise SchemaError([message] + x.autos, [e] + x.errors)
schema.SchemaError: Key 'roll_when' error:
Wrong key 'min_pnl' in {'pnl': 0.9, 'dte': 15, 'min_pnl': -1.0, 'calls': {'itm': True}, 'puts': {'itm': False}}

@brndnmtthws
Copy link
Owner

The newest image hasn't been published yet, you'll have to wait a while for it to finish.

@Ianfinn1994
Copy link
Author

How goes the new image, boss?

@brndnmtthws
Copy link
Owner

The image is available, and it should work on both armv7 and aarch64/armv8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants