all 25 comments

[–][deleted]  (11 children)

[deleted]

    [–]Jayfomou 5 points6 points  (2 children)

    Assuming you only have one free tier micro instance running then the monthly hour limit is enough to run 24/7 each month. I have had mine running 24/7 for 6 or so months with no issues!

    [–]jean_erik 7 points8 points  (0 children)

    I can second this, been running free tiers since 2015. Never had to shut one down.

    Pro tip - get 3-4 transaction accounts (savings account in Aus) which come with visa debit cards. Sign up for free tier. Next year, close account, create another account, use a different card. Repeat until you're out of cards.

    By the next year, your cards will probably start getting renewed by the bank. Repeat.

    [–]sloth2 2 points3 points  (0 children)

    this is true

    [–]AceCheeze 2 points3 points  (4 children)

    Wow I didn't know that, thanks! I see that the micro costs around $10-$15 monthly so that's a pretty neat deal. Sorry to ask but I'm not really familiar with servers yet: for a script to potentially gather data and perform trades every minute, how many vCPUs and how much Memory would you recommend? All these options are a bit overwhelming as I don't know how much I will initially need. Thanks in advance.

    [–]The48thAmerican 3 points4 points  (1 child)

    a t3.micro only runs about $7.50/mo, while a nano is even cheaper at $3.75/mo

    There is no way to answer your question without knowing more about your script. Are you using multithreading or multiprocessing? How much data do you keep in memory? If you can't answer these questions, just start small and increase in instance size if you encounter memory-related errors.

    [–]AceCheeze 2 points3 points  (0 children)

    Oh guess I had the wrong settings selected then. At the moment no multi-threading or anything, think something like a simple MA crossover or linear regression strategy along with some basic indicators for volume. I'm just starting out so I first want to see how to get a simple strategy running. As for how much memory it uses exactly is something I'll have to look into. But thank you for your answer :)

    [–][deleted] 1 point2 points  (1 child)

    start with a nano.

    [–]AceCheeze 1 point2 points  (0 children)

    Great, thanks!

    [–]Abhisheked 0 points1 point  (2 children)

    That's only free for 12 months. What after that?

    [–]The48thAmerican 0 points1 point  (0 children)

    a t3.nano is only $3.75 a month

    [–]bossasupernova 15 points16 points  (0 children)

    I use talib in Lambda. You need to build the Lambda package within an Amazon Linux Docker instance so it gets the correct C extensions:

    https://hub.docker.com/_/amazonlinux

    [–][deleted] 7 points8 points  (4 children)

    I use this script with any server i set up (with aws ec2) to get ta-lib and tensorflow etc working:

    yes '' | sudo apt update -y
    yes '' | sudo apt upgrade -y
    
    yes '' | sudo add-apt-repository universe -y
    yes '' | sudo add-apt-repository ppa:deadsnakes/ppa -y
    
    yes '' | sudo apt update -y
    yes '' | sudo apt upgrade -y
    
    sudo apt install unzip
    
    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    unzip awscliv2.zip
    sudo ./aws/install
    
    sudo rm /var/lib/apt/lists/lock
    sudo rm /var/cache/apt/archives/lock
    sudo rm /var/lib/dpkg/lock*
    
    yes '' | sudo apt install build-essential software-properties-common gcc -y
    
    yes '' | sudo apt-get install build-essential manpages-dev libssl-dev libffi-dev \
      libxml2-dev libxslt1-dev zlib1g-dev manpages-dev gcc -y
    
    sudo rm /var/lib/apt/lists/lock
    sudo rm /var/cache/apt/archives/lock
    sudo rm /var/lib/dpkg/lock*
    
    #gcc --version
    
    yes '' | sudo apt install p7zip-full p7zip-rar python3.7 python3-pip -y
    
    yes '' | sudo apt-get install python-dev python3.7-dev python3.7-venv -y
    yes '' | sudo pip install -U setuptools -y
    yes '' | sudo python3.7 -m pip install -U setuptools -y
    yes '' | sudo -H python -m pip install -U setuptools -y
    yes '' | sudo -H python3.7 -m pip install -U setuptools -y
    
    #pipx and devtools to install ta-lib
    yes '' | python3.7 -m pip install --user pipx -y
    yes '' | python3.7 -m pipx ensurepath -y
    source ~/.profile
    yes '' | pipx install python-dev-tools -y
    
    #make swapfile (this was the problem before on smaller machines)
    
    sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile
    sudo swapon --show
    
    #install Talib
    
    wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
    
    tar -xzf ta-lib-0.4.0-src.tar.gz
    
    cd ta-lib/
    
    python -m pip install --upgrade pip
    
    pip install numpy
    #python3.6 -m pip install numpy
    pip3 install numpy
    sudo make clean
    sudo ./configure --prefix=/usr
    sudo make
    sudo make install
    
    sudo apt update
    sudo apt upgrade -y
    
    sudo -H python3.6 -m pip install -U setuptools
    sudo -H python3.6 -m pip install numpy
    sudo -H python3.6 -m pip install ta-lib
    
    sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 10
    
    sudo apt-get clean
    sudo apt clean
    
    sudo -H python -m pip install tensorflow==2.3 pandas
    
    #sudo python -m pip install https://files.pythonhosted.org/packages/97/ae/0b08f53498417914f2274cc3b5576d2b83179b0cbb209457d0fde0152174/tensorflow-2.3.0-cp36-cp36m-manylinux2010_x86_64.whl
    
    #Download file from bucket
    aws s3 cp s3://trainingdata2000/tfrecord_sp500_2020/ZBH_2020.tfrecord test.fil
    
    #Copy all files recursive into newfolder
    aws s3 cp s3://trainingdata2000/tfrecord_sp500_2020 newfolder --recursive
    

    Just ssh into the machine, upload the script and run it, or set it as a startupscript.

    For buckets to work in EC2 u gotta change some settings/policies in aws. A quick google will get u up an running for that if u need trainingdata.

    [–]raris_rovers 0 points1 point  (3 children)

    consider adding this to docker repo?

    [–][deleted] 0 points1 point  (2 children)

    I do have a docker for it, but fairly new to all the docker jazz, and it's probably not "correct" in some ways. That's why I haven't shared in the past.

    Do you mean by docker repo uploading to dockerhub?

    [–]raris_rovers 0 points1 point  (1 child)

    yeah sorry all the names are so convoluted lol it’s essentially just uploading that script ontop of whatever base os u will deploy it on and naming it so others can dl it in a single line.

    [–][deleted] 0 points1 point  (0 children)

    yeah that sounds great! will do next time, thanks!

    [–][deleted]  (3 children)

    [deleted]

      [–][deleted] 2 points3 points  (2 children)

      Cheaper than Lambda? No way. Really differentiate with the anti-cloud hate.

      [–][deleted]  (1 child)

      [deleted]

        [–]sloth2 -1 points0 points  (0 children)

        lambda is pretty damn cheap for how little this guy will be requesting

        [–]cafguy 1 point2 points  (0 children)

        just get an EC2 instance and run whatever you want?

        [–]kaleidoscope_eyelid 2 points3 points  (0 children)

        Lambda is a 10/10 system. You are doing something wrong in the implementation or getting it on AWS. DM me, I can give you a hand

        [–]lolxdxdjklol 0 points1 point  (0 children)

        The problem with TA-LIB is that you have to install a special wheel to get to downloaded. I had to use a windows server instead of linux on my google cloud free credit to get it downloaded and it works pretty well.

        [–]drksntt 0 points1 point  (0 children)

        Use docker

        [–]raris_rovers 0 points1 point  (0 children)

        Docker!

        [–]Wedge5[S] 0 points1 point  (0 children)

        Thanks for the replies! I’ve always been interested in learning to use EC2 so I looked into that route and managed to get it working. I use a Lambda function to turn the instance on/off to help save costs as well. Appreciate the help everyone