Botspot / pi-apps

Raspberry Pi App Store for Open Source Projects
GNU General Public License v3.0
1.98k stars 204 forks source link

Interactive Brokers App #298

Closed missesSing closed 3 years ago

missesSing commented 3 years ago

Hi, I think there are a few trades who WFH who uses Interactive Brokers program on Linux or Windows but it is a pain to install on RPi. There was someone who did it before but it seems that his method of doing so now doesnt work. I think it will help extend the usefulness of the RPi if this program can be installed. Thank you.

techcoder20 commented 3 years ago

Is interactive brokers a bot or a app ? I am confused

missesSing commented 3 years ago

Hi,

Sorry if I uploaded into the wrong chat room. Just wanted to request if you can make a script that can install/run Interactive Brokers (app)

https://www.interactivebrokers.com.hk/en/index.php?f=45310#tws-software

It has a native Linux 32-bit installation but for x86 chipset only. From a blogger who was able to make it work said that the problem was tweaking the Java installation required during the setup process. I'm sorry if I cannot give more detail as I am not a coder myself. Thank you.

Kind regards,

On Fri, Jan 29, 2021 at 2:58 PM RPICoder notifications@github.com wrote:

Is interactive brokers a bot or a app ? I am confused

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-769619035, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDJYL5WL34ZWNROZM6TS4JMC5ANCNFSM4WYIO4AA .

Botspot commented 3 years ago

Okay I've done my best to get this working. But unfortunately it's now out of my league.

Here's the procedure I got:

sudo apt install openjdk-8-jdk
wget https://download2.interactivebrokers.com/installers/tws/stable/tws-stable-linux-x86.sh

#edit the file to specify custom jvm folder
sed -i 's+# INSTALL4J_JAVA_HOME_OVERRIDE=+INSTALL4J_JAVA_HOME_OVERRIDE=/usr/lib/jvm/java-8-openjdk-armhf/+g' ~/tws-stable-linux-x86.sh

#edit the file to skip jvm detection function
sed -i 's+test_dir=$1+test_dir=$1 ; app_java_home=$test_dir ; return+g' ~/tws-stable-linux-x86.sh

#make executable
chmod u+x ~/tws-stable-linux-x86.sh

Error output:

pi@raspberrypi:~ $ ~/tws-stable-linux-x86.sh
Starting Installer ...
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0xf5f17828, pid=1338, tid=0xf5bc2460
#
# JRE version:  (8.0_212-b01) (build )
# Java VM: OpenJDK Client VM (25.212-b01 mixed mode linux-aarch32 )
# Problematic frame:
# V  [libjvm.so+0x15e828]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/pi/tws-stable-linux-x86.sh.1314.dir/hs_err_pid1338.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Aborted

At this point, IDK what the issue is. Hopefully the above information may help someone else.

missesSing commented 3 years ago

wow thank you so much. I didnt expect this. I hope that someone can figure this one out.

Kind regards,

On Mon, Mar 8, 2021 at 10:22 AM Botspot notifications@github.com wrote:

Okay I've done my best to get this working. But unfortunately it's now out of my league.

Here's the procedure I got:

sudo apt install openjdk-8-jdk wget https://download2.interactivebrokers.com/installers/tws/stable/tws-stable-linux-x86.sh

specify custom jvm folder

sed -i 's+# INSTALL4J_JAVA_HOME_OVERRIDE=+INSTALL4J_JAVA_HOME_OVERRIDE=/usr/lib/jvm/java-8-openjdk-armhf/+g' ~/tws-stable-linux-x86.sh

disable jvm detection, skip the test function

sed -i 's+test_dir=$1+test_dir=$1 ; app_java_home=$test_dir ; return+g' ~/tws-stable-linux-x86.sh

Error output:

pi@raspberrypi:~ $ /home/pi/tws-stable-linux-x86.sh Starting Installer ... #

A fatal error has been detected by the Java Runtime Environment:

#

SIGBUS (0x7) at pc=0xf5f17828, pid=1338, tid=0xf5bc2460

#

JRE version: (8.0_212-b01) (build )

Java VM: OpenJDK Client VM (25.212-b01 mixed mode linux-aarch32 )

Problematic frame:

V [libjvm.so+0x15e828]

#

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

#

An error report file with more information is saved as:

/home/pi/tws-stable-linux-x86.sh.1314.dir/hs_err_pid1338.log

#

If you would like to submit a bug report, please visit:

http://bugreport.java.com/bugreport/crash.jsp

# Aborted

At this point, IDK what the issue is. Hopefully the above information may help someone else.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-792415203, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDLJJNSHSSH3NTACPALTCQYFPANCNFSM4WYIO4AA .

Botspot commented 3 years ago

wow thank you so much. I didnt expect this. I hope that someone can figure this one out. Kind regards,

You're welcome! I had some free time today, and it looked like a fun challenge.

Botspot commented 3 years ago

My guess is that this would work flawlessly on Raspbian Stretch (old and outdated OS), because that supported oracle-java8-installer required by the tutorial.

Botspot commented 3 years ago

Okay, using my vdesktop virtual machine, I was able to boot up Raspbian Stretch, and then locate a mirror for the oracle-java8-installer deb file. (As the ppa:webupd8team/java repository is down)

wget https://debian.opennms.org/dists/opennms-25/main/binary-all/oracle-java8-installer_8u131-1~webupd8~2_all.deb
sudo apt install -yf ~/oracle-java8-installer_8u131-1~webupd8~2_all.deb
wget https://debian.opennms.org/dists/opennms-25/main/binary-all/oracle-java8-set-default_8u131-1~webupd8~2_all.deb
sudo apt install -yf ~/oracle-java8-set-default_8u131-1~webupd8~2_all.deb
Botspot commented 3 years ago

Oops, I was using an aarch64 kernel in the host machine.

And so that caused the aarch64 version of the deb to install within the virtual machine, instead of the armhf version. Sigh...

missesSing commented 3 years ago

Regardless, still very grateful that youre putting in the effort. More than what I expected.

On Mon, Mar 8, 2021 at 11:05 AM Botspot notifications@github.com wrote:

Oops, I was using an aarch64 kernel in the host machine.

And so that caused the aarch64 version of the deb to install, instead of the armhf version. Sigh...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-792427457, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDNBLS3L5PV5XPV364DTCQ5HDANCNFSM4WYIO4AA .

Botspot commented 3 years ago

IT'S WORKING!!

2021-03-07-211834_1920x1080_scrot

Botspot commented 3 years ago

Setup succeeded. Before TWS launched though, I had to patch the tws bash script first:

sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' /home/pi/Jts/tws
missesSing commented 3 years ago

Wow amazing! unbelievable. So to be clear I need an old version of the OS right? I'll try my best to follow.

On Mon, Mar 8, 2021 at 11:23 AM Botspot notifications@github.com wrote:

Setup succeeded. Before TWS launched though, I had to patch the tws bash script first:

sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' /home/pi/Jts/tws

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-792434034, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDN3QRBPVXBKGYU5VQLTCQ7MZANCNFSM4WYIO4AA .

missesSing commented 3 years ago

Also how do I make a small contribution to you? I want to show my appreciation. I understand that you're doing this full time. Thank you.

Kind regards,

On Mon, Mar 8, 2021 at 11:30 AM Benson Tan hanstan@gmail.com wrote:

Wow amazing! unbelievable. So to be clear I need an old version of the OS right? I'll try my best to follow.

On Mon, Mar 8, 2021 at 11:23 AM Botspot notifications@github.com wrote:

Setup succeeded. Before TWS launched though, I had to patch the tws bash script first:

sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' /home/pi/Jts/tws

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-792434034, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDN3QRBPVXBKGYU5VQLTCQ7MZANCNFSM4WYIO4AA .

Botspot commented 3 years ago

After installing vdesktop and booting a Raspbian Stretch image, here's all commands necessary to repeat what I did: (in a terminal inside the Raspbian stretch VM)

#download and install java
wget https://debian.opennms.org/dists/opennms-25/main/binary-all/oracle-java8-installer_8u131-1~webupd8~2_all.deb
sudo apt install -yf ~/oracle-java8-installer_8u131-1~webupd8~2_all.deb

#tws setup script
wget https://download2.interactivebrokers.com/installers/tws/stable/tws-stable-linux-x86.sh
sed -i 's+# INSTALL4J_JAVA_HOME_OVERRIDE=+INSTALL4J_JAVA_HOME_OVERRIDE=/usr/lib/jvm/java-8-oracle/+g' ~/tws-stable-linux-x86.sh
sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/tws-stable-linux-x86.sh
chmod u+x ~/tws-stable-linux-x86.sh
~/tws-stable-linux-x86.sh

#after that finished, patch the tws scripts as well:
sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/tws
sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/uninstall
sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/.install4j/restarter
sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/.install4j/updater
Botspot commented 3 years ago

Wow amazing! unbelievable. So to be clear I need an old version of the OS right?

I'm not sure. I used Raspbian Stretch, because I thought that would allow the java repository to be added. But it did not. Instead, I finally found direct downloads for the necessary apt packages.

Who knows, maybe the latest & greatest Raspberry Pi OS would support it too!

But before I do that, first I thought I'd check to see if there are any more files that needed patching. Sure enough:

pi@raspberrypi:~ $ grep -r 'test_dir=$1' / 2>/dev/null
Binary file /proc/1694/task/1694/cmdline matches
Binary file /proc/1694/cmdline matches
/home/pi/Jts/.install4j/updater:  test_dir=$1
/home/pi/Jts/.install4j/restarter:  test_dir=$1
/home/pi/Jts/uninstall:  test_dir=$1
Binary file /home/pi/tws-stable-linux-x86.sh matches

This ought to fix those:

sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/uninstall
sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/.install4j/restarter
sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/.install4j/updater
Botspot commented 3 years ago

Also how do I make a small contribution to you? I want to show my appreciation. I understand that you're doing this full time.

If you feel inclined to contribute a little something, you're more than welcome to.
First and foremost, a kind word about Pi-Apps to other RPi users is always a welcome contribution! :)
Also I accept donations via PayPal: https://paypal.me/josephmarchand

Botspot commented 3 years ago

Okay, I just tried it on my everyday Raspberry Pi OS Buster, and it installed fine. No need for vdesktop or Stretch images it seems.

missesSing commented 3 years ago

Wow. This is awesome! Thank you so much. I will try this one out later when I get home from work.

On Mon, Mar 8, 2021 at 11:43 AM Botspot notifications@github.com wrote:

Okay, I just tried it on my everyday Raspberry Pi OS Buster, and it installed fine. No need for vdesktop or Stretch images it seems.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-792441054, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDLQL6L5F2HDHCIZKFDTCRBVTANCNFSM4WYIO4AA .

missesSing commented 3 years ago

Sent USD 9.85 to you. I cant believe there were so many fees. Thank you very much for the effort. I hope you can make it simpler and have this one part of the launcher. Have a great day.

Kind regards,

On Mon, Mar 8, 2021 at 12:04 PM Benson Tan hanstan@gmail.com wrote:

Wow. This is awesome! Thank you so much. I will try this one out later when I get home from work.

On Mon, Mar 8, 2021 at 11:43 AM Botspot notifications@github.com wrote:

Okay, I just tried it on my everyday Raspberry Pi OS Buster, and it installed fine. No need for vdesktop or Stretch images it seems.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-792441054, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDLQL6L5F2HDHCIZKFDTCRBVTANCNFSM4WYIO4AA .

Botspot commented 3 years ago

Thank you very much for the effort. I hope you can make it simpler and have this one part of the launcher.

What even is Interactive Brokers Trader Workstation?

To be honest, I had no clue what it was, but decided it would be a fun challenge to get it running.

Botspot commented 3 years ago

Hello @missesSing?

Thank you very much for the effort. I hope you can make it simpler and have this one part of the launcher.

I'd like to add it to Pi-Apps, but before then, it needs a good description. I am not capable of writing a good description, because I have no idea what "Interactive Brokers" even is. You will have to help me in that effort.

missesSing commented 3 years ago

Hi,

Sorry I must have forgotten about this one. This application is an all around stock trading platform similar to Robinhood that financial institutions and other more mainstream stock traders use. It has a lot of function and can employ more sophisticated strategies that's why I think people who are working from home might deploy this on their Rapsberry pi. It's perfect to place on a standalone pi.

On Wed, Mar 10, 2021 at 11:19 PM Botspot notifications@github.com wrote:

Hello @missesSing https://github.com/missesSing?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-795592206, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDLNFVPEMNH6SETR5BTTC55YRANCNFSM4WYIO4AA .

missesSing commented 3 years ago

Hi,

I'm sorry I must have overlooked and forgotten to reply to this one. Am sorry. The interactive brokers trader workstation is a stock trading program similar to Robinhood but it is mostly used by professional investors because there are a lot of functionalities and features. I have seen quite a fair bit of people, with the WFH, using the raspberry pi as an extra PC to conduct trading. I hope this can help. But I really appreciate the time and effort you have but into this. Thank you.

On Mon, Mar 8, 2021 at 10:49 PM Botspot @.***> wrote:

Thank you very much for the effort. I hope you can make it simpler and have this one part of the launcher.

What even is Interactive Brokers Trader Workstation?

To be honest, I have no clue what it is, but thought it looked like a fun challenge to get running.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-792805370, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDPPCCLXJ3EMMEQQY5DTCTPWLANCNFSM4WYIO4AA .

Botspot commented 3 years ago

I hope this can help.

Yes, thank you.

But I really appreciate the time and effort you have but into this.

Did you ever get it working?

missesSing commented 3 years ago

Hi,

Sorry I havent been able to find the time to work on this yet. My wife had a medical emergency last week and will be bed ridden for the forseeable future so I haven't had a lot of spare time currently.

Thank you for following up. I will try and get this up and running as soon as I can. Thank you.

On Tue, Mar 16, 2021 at 11:33 AM Botspot @.***> wrote:

I hope this can help.

Yes, thank you.

But I really appreciate the time and effort you have but into this.

Did you ever get it working?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-799917924, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDOKQUCRTBZ3KI67PRLTD3GQPANCNFSM4WYIO4AA .

missesSing commented 3 years ago

Thank you for you time and attention. I got to install the application by following your code. I was able to start it and even log in with my user name and password. But while loading the necessary screens, the program just hang up. The loading screen just disappeared. I dont know what happened. Thank you.

On Tue, Mar 16, 2021 at 11:41 AM Benson Tan @.***> wrote:

Hi,

Sorry I havent been able to find the time to work on this yet. My wife had a medical emergency last week and will be bed ridden for the forseeable future so I haven't had a lot of spare time currently.

Thank you for following up. I will try and get this up and running as soon as I can. Thank you.

On Tue, Mar 16, 2021 at 11:33 AM Botspot @.***> wrote:

I hope this can help.

Yes, thank you.

But I really appreciate the time and effort you have but into this.

Did you ever get it working?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-799917924, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDOKQUCRTBZ3KI67PRLTD3GQPANCNFSM4WYIO4AA .

Botspot commented 3 years ago

Thank you for you time and attention. I got to install the application by following your code. I was able to start it and even log in with my user name and password. But while loading the necessary screens, the program just hang up. The loading screen just disappeared. I dont know what happened. Thank you.

Could you try running it in a terminal and report back any errors you see?

No rush - I'm going to bed now.

missesSing commented 3 years ago

[image: image.png]

The program tried to download some updates and then basically disappeared. In the terminal this was displayed.

Kind regards,

On Tue, Mar 16, 2021 at 12:04 PM Botspot @.***> wrote:

Thank you for you time and attention. I got to install the application by following your code. I was able to start it and even log in with my user name and password. But while loading the necessary screens, the program just hang up. The loading screen just disappeared. I dont know what happened. Thank you.

Could you try running it in a terminal and report back any errors you see?

No rush - I'm going to bed now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-799929216, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDOR3237TVEO5D27Y2LTD3KFNANCNFSM4WYIO4AA .

Botspot commented 3 years ago

[image: image.png] The program tried to download some updates and then basically disappeared. In the terminal this was displayed. Kind regards,

I don't see any image. :(

missesSing commented 3 years ago

I will type what is displayed in the terminal @.: ~/Jts $ tws Java Hotspot(TM) Server VM warning: G1 GC is disabled in this release. @.: ~/Jts $

That's it.

On Thu, Mar 18, 2021 at 6:51 AM Botspot @.***> wrote:

[image: image.png] The program tried to download some updates and then basically disappeared. In the terminal this was displayed. Kind regards,

I don't see any image. :(

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-801492690, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDJYASAQL74QRSSNT3TTEEW77ANCNFSM4WYIO4AA .

missesSing commented 3 years ago

Hi, I just would like to thank you for spending so much time on this but I have decided to stop figuring this one out. I have been asked to go back to the office and I don't want to waste your precious time if I won't be able to do my part. Thank you very much.

Kind regards, Benson

On Thu, Mar 18, 2021 at 7:01 AM Benson Tan @.***> wrote:

I will type what is displayed in the terminal @.: ~/Jts $ tws Java Hotspot(TM) Server VM warning: G1 GC is disabled in this release. @.: ~/Jts $

That's it.

On Thu, Mar 18, 2021 at 6:51 AM Botspot @.***> wrote:

[image: image.png] The program tried to download some updates and then basically disappeared. In the terminal this was displayed. Kind regards,

I don't see any image. :(

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Botspot/pi-apps/issues/298#issuecomment-801492690, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUSIDJYASAQL74QRSSNT3TTEEW77ANCNFSM4WYIO4AA .

Botspot commented 3 years ago

Hi, I just would like to thank you for spending so much time on this but I have decided to stop figuring this one out. I have been asked to go back to the office and I don't want to waste your precious time if I won't be able to do my part. Thank you very much. Kind regards, Benson

I haven't given up yet.
Nor are you wasting my time.

Could you try taking a recording of your screen that shows the crash?
And when you send it, please don't attach it to the email. That doesn't work. Instead, click "View it on GitHub", and upload the image directly to there.

Botspot commented 3 years ago

To anyone who is interested, I wrote up a Raspberry Pi Forum post on the progress I made, and asked for someone with an IB account to test out my installation approach.

The test results there matched what @missesSing reported - a crash.

I attribute this to the fact that we're using the wrong java microversion. Unfortunately there's nothing we can do about that unless somebody can find an armhf release for java 1.8.0_151.

Botspot commented 3 years ago

Just in case this ever gets working, here's the pi-app I made for it months ago. By uploading here, I can delete the app off my local pi-apps install and not lose any work. Interactive Brokers TW.zip

kenho85 commented 3 years ago

Hi there, I just read ur post and I have searched for everything that I can run my IB TWS under my raspberry pi 4. Information: Raspberry PI 4 8GB Ubuntu Mate 20.04 (32bit/hf) JAVA Version java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) Server VM (build 25.65-b01, mixed mode) IB TWS 981 version

I have everything installed, but when I run the IB TWS app, I got this. Can anyone solve my problem?

Screenshot 2021-10-13 at 6 21 19 PM Screenshot 2021-10-13 at 6 21 27 PM
Botspot commented 3 years ago

Hi there, I just read ur post and I have searched for everything that I can run my IB TWS under my raspberry pi 4. Information: Raspberry PI 4 8GB Ubuntu Mate 20.04 (32bit/hf) JAVA Version java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) Server VM (build 25.65-b01, mixed mode) IB TWS 981 version

I have everything installed, but when I run the IB TWS app, I got this. Can anyone solve my problem?

I never got it working successfully. :( The folks on the Raspberry Pi Forums think it's due to not running the exact required version of Java, but it's anyone's guess. My hope is that my efforts above will benefit some future Linux tinkerer with the knowledge and patience to solve this.

agibsonccc commented 2 years ago

@Botspot JFYI I found this thread by googling around a bit and wanted to give some hope to other people doing this. It's not TWS but you can run the smaller IB Gateway (the embedded API server) which should be enough for many people looking to run automated traded with something like IBC

(an interactive brokers automation companion tool that is also open source)

Simple steps:

  1. Download jdk 18 full from bellsoft: https://bell-sw.com/pages/downloads/#/java-18-current - this is important as java 11 LTS seems to give a login error.
  2. Download the interactive brokers gateway: https://www.interactivebrokers.com/en/trading/ib-gateway-download.php
  3. Run the installer with jdk 8 for the appropriate 32 or 64 bit arm architecture (mainly errors out if you don't)
  4. Set app_java_home to the install directory of jdk 18 from bellsoft before starting up
  5. Login with your credentials and a simple screen comes up that displays the status of the API server

This will be enough to allow people to run automated trades. Note to people using IBC ensure you download the standalone version only.

Botspot commented 2 years ago

Simple steps:

  1. Download jdk 18 full from bellsoft: https://bell-sw.com/pages/downloads/#/java-18-current - this is important as java 11 LTS seems to give a login error.

The JDK you linked seems to only be available for ARM64. There does not appear to be an armhf version. 2022-08-24-225735_1920x1080_scrot I just wanted to point that out, as anyone following @agibsonccc's instructions will need to make sure they are running the 64-bit version of Raspberry Pi OS.

Of course, if there is an armhf JDK lurking elsewhere, feel free to correct me, @agibsonccc.

gitchrix commented 1 year ago

@Botspot JFYI I found this thread by googling around a bit and wanted to give some hope to other people doing this. It's not TWS but you can run the smaller IB Gateway (the embedded API server) which should be enough for many people looking to run automated traded with something like IBC

(an interactive brokers automation companion tool that is also open source)

Simple steps:

  1. Download jdk 18 full from bellsoft: https://bell-sw.com/pages/downloads/#/java-18-current - this is important as java 11 LTS seems to give a login error.
  2. Download the interactive brokers gateway: https://www.interactivebrokers.com/en/trading/ib-gateway-download.php
  3. Run the installer with jdk 8 for the appropriate 32 or 64 bit arm architecture (mainly errors out if you don't)
  4. Set app_java_home to the install directory of jdk 18 from bellsoft before starting up
  5. Login with your credentials and a simple screen comes up that displays the status of the API server

This will be enough to allow people to run automated trades. Note to people using IBC ensure you download the standalone version only.

Great feedback! do we still need to do this?

after that finished, patch the tws scripts as well:

sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/tws sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/uninstall sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/.install4j/restarter sed -i 's+test_dir=$1+app_java_home=/usr/lib/jvm/java-8-oracle/ ; return+g' ~/Jts/.install4j/updater

If so, what would need to be changed/discarded?

Thanks again for sharing

gitchrix commented 1 year ago

I should point out that after replacing /usr/lib/jvm/java-8-oracle/ with /usr/lib/jvm/bellsoft-java19-full-aarch64/ I got it to work but for some reason I can't open the Configure menu, and the login window remains open (if I close it IBGW turns off).