How to deploy your Jesse project into the production server for live trading — Transcript
Full transcript
- 0:00usually people think it's okay to run
- 0:02your algo trading sessions locally or
- 0:04that it's even safer this way but over
- 0:06the years i faced a lot of problems
- 0:08which i could have avoided if instead i
- 0:10used a remote server so in this video i
- 0:12will show you why do you need the setup
- 0:14where to get high quality and affordable
- 0:16servers how to set it up for jesse and
- 0:19how to make it secure so that only you
- 0:21can access it let's get started
- 0:23[Music]
- 0:27there are many reasons but i'll give it
- 0:29three number one servers have fast and
- 0:31reliable internet connections for
- 0:34example my headset servers usually have
- 0:36a gigabit connection which is way faster
- 0:38than my local one number two you don't
- 0:40wanna worry about how to use your
- 0:42computer while your algo is running
- 0:44maybe you want to restart or shut down
- 0:46your computer and if you're running a
- 0:48live sessions then you can't do that
- 0:50number three linux is the best os for
- 0:52production but most of the development
- 0:54machines are either windows or mac os so
- 0:57by using a server you can still develop
- 0:59on your operating system of choice but
- 1:02run your production code on linux
- 1:04[Music]
- 1:08when it comes to choosing a cloud server
- 1:10provider what we're looking for is a
- 1:12good balance of the quality and the
- 1:14price if you are living in the us i
- 1:16highly recommend using digitalocean
- 1:18there is starting server which is more
- 1:20than enough for our use case it starts
- 1:22from 5 bucks a month but if you use my
- 1:24link you can get started for free the
- 1:27other cloud provider that i personally
- 1:28recommend and use is hessner their
- 1:31starting plan offers more resources for
- 1:33the same price and if you use my link
- 1:35you will get 20 euros free credits
- 1:38[Music]
- 1:42i already have a history account so i'm
- 1:44going to log in
- 1:51projects on your hesnar account are like
- 1:53folders on your machine they're used for
- 1:55organizing your servers you can create a
- 1:57new one or choose an existing one i'm
- 2:00going to choose the tutorial project and
- 2:03click on add server
- 2:05i will change the location to germany
- 2:08ubon 2204 is exactly the image that i
- 2:11want
- 2:13the first server plan is more than
- 2:14enough for my use case so i will leave
- 2:16that b
- 2:18next i have to choose the ssh keys of my
- 2:20computer so that the server can
- 2:22recognize me in your case if your
- 2:24account is new you probably have to
- 2:27generate ssh keys and add it here
- 2:30and at the end i will change the name of
- 2:32this server to something that i can
- 2:34remember such as tutorial 1.
- 2:37the server is going to be ready in just
- 2:39a few seconds all right now let's copy
- 2:41the ip address of my server
- 2:43open the terminal app and enter
- 2:46ssh
- 2:48root add sign and then paste the ip
- 2:51address
- 2:52because this is the first time we are
- 2:53connecting to this server it's going to
- 2:55ask us about whether or not we trust
- 2:58this fingerprint just go ahead and enter
- 3:00yes
- 3:04[Music]
- 3:07there are a couple of ways for setting
- 3:09up jesse on a server i use docker
- 3:11because it's easier to set up run and
- 3:14also install future updates of jesse so
- 3:17i'll start by installing docker itself
- 3:19on my server this is a fresh vps so if i
- 3:22run the docker compose command i should
- 3:24see the command not found error which is
- 3:26expected because we haven't installed
- 3:28docker yet once again i will open the
- 3:30documentation website and head over to
- 3:32the docker section here there are two
- 3:34commands for installing docker and
- 3:36docker compose so let's copy the first
- 3:39one
- 3:41and paste it here
- 3:43this should take a few seconds
- 3:45now let's copy the second command which
- 3:47is for installing docker compose
- 3:53now if i run the docker compose command
- 3:55one more time it should work
- 3:59[Music]
- 4:02if you're watching this i'm guessing you
- 4:04already have a jesse project but for the
- 4:06sake of this tutorial i will be creating
- 4:08a new one to create a new jesse project
- 4:10inside my local machine first i have to
- 4:12make sure that i am inside the correct
- 4:14directory
- 4:16next from the documentation website i
- 4:18will copy the command for creating a new
- 4:20jesse project what this command is doing
- 4:22is cloning a git repository from github
- 4:25and specifying a custom name so i'll go
- 4:28ahead and change the name to
- 4:30tutorial
- 4:31deploy
- 4:33this command creates a new project so i
- 4:35will see the into tutorial deploy
- 4:38next as it is mentioned by the
- 4:40documentation i will create my dot and v
- 4:42file notice that the dot and v file is
- 4:45ignored by git which means it doesn't
- 4:47get pushed into github and that's
- 4:49because the whole point of the data mv
- 4:51file is to be unique to the environment
- 4:53you're running it in in this case being
- 4:55our production server because this
- 4:57project was pulled from another github
- 4:59repository by default it assumes that we
- 5:01are the owners of the repository which
- 5:03we are not so i'm just going to remove
- 5:05git entirely from this code base so that
- 5:08i can later push it into my own github
- 5:11repository i can do that by typing rm
- 5:14python rf.get
- 5:18[Music]
- 5:22it's always a good practice to keep your
- 5:23code in a repository because it's easier
- 5:26to track changes keep your backup and
- 5:28maybe even share your code with others
- 5:30if you need to so instead of uploading
- 5:32my code directly into the server i'm
- 5:34going to push my code into a github
- 5:35repository and then pull it into the
- 5:38server before i move on i'm going to
- 5:39quickly create a new private depository
- 5:42on my github account i'm already logged
- 5:44in so i'm just going to click on the
- 5:46plus button here and choose new
- 5:48repository my repository name is going
- 5:51to be tutorial
- 5:52deploy and next make sure to set the
- 5:55privacy settings into private otherwise
- 5:57everyone can see your code and finally
- 6:00click on create repository
- 6:02all right now let's move back to the
- 6:04terminal app to push our code repository
- 6:07here are the commands for initiating a
- 6:09git repository and pushing it into
- 6:11github git init
- 6:13which is for initiating git inside our
- 6:15source code next i will run git add dot
- 6:19what this will do is prepare all the
- 6:21files for being pushed into github now
- 6:24that all the files are added i'm going
- 6:25to create my first commit
- 6:27get commit python m and then i will pass
- 6:31a message typically the first message is
- 6:34always initial commit recently github
- 6:36changed their primary branch name from
- 6:38master into main so we need to tell our
- 6:41local git to use main as the primary
- 6:44branch instead of master we can do that
- 6:46by typing git
- 6:48branch
- 6:50python
- 6:51capital m main
- 6:53next i will set my remote origin address
- 6:56into what github just gave me by typing
- 6:58git remote
- 7:01add origin
- 7:02let's quickly copy the origin from
- 7:04github
- 7:05and paste it here
- 7:08now we can push by typing git push
- 7:11hyphen u
- 7:13origin
- 7:14maine
- 7:16if i move back to github and give the
- 7:18page a refresh i should see my source
- 7:20code being uploaded here because i set
- 7:22the privacy settings of my repository to
- 7:24private my server needs to first
- 7:26authenticate to gain access to the
- 7:28source code so if i try to run
- 7:31git clone
- 7:32and then paste in the address of my
- 7:34repository here
- 7:37it tells me that i do not have the
- 7:39correct access rights
- 7:41we can fix this by authenticating our
- 7:43server
- 7:44into our github account there are a
- 7:46couple of ways for doing this my
- 7:48recommended way is using ssh keys so i'm
- 7:51gonna create a new ssh key for my server
- 7:54so that i can add it into my github
- 7:56account i can do that by typing ssh
- 7:59python
- 8:00keygen
- 8:01press enter to skip the other steps now
- 8:04i'm going to copy my ssh keys from this
- 8:07location so i'm going to copy it and
- 8:09write cat and paste it here next i will
- 8:12select the whole thing copy it
- 8:15open github again
- 8:16go into my settings and then choose ssh
- 8:20and gpg keys
- 8:23new ssh key
- 8:25paste it here the title doesn't really
- 8:27matter but i will type in tutorial
- 8:31so if i try to pull the repository one
- 8:33more time it should work now by pressing
- 8:35the up arrow button on my keyboard i can
- 8:37use the previous commands again
- 8:42let's check the existing files by typing
- 8:44ls actually there are a couple of extra
- 8:46files here because of the whole
- 8:48installation that i just did so let's
- 8:50remove those
- 8:51i can do that by typing rm and then the
- 8:54name of the file
- 8:57the snap directory is also extras so
- 9:00let's remove that by typing rm hyphen rf
- 9:04snap
- 9:05one more time and we're good
- 9:10i will cd into my project
- 9:13let's write the ls command one more time
- 9:15to see if the source code is here
- 9:17everything looks good now let's create
- 9:19the dmv file by typing cp dot
- 9:25now using the nano editor i will open my
- 9:27data mv file
- 9:29and the first thing that i'm going to do
- 9:31is to change the default password from
- 9:33test into something that no one can
- 9:35guess
- 9:36and the second line that i need to
- 9:37change is to enter my license api token
- 9:42i need to create a new one so i'm going
- 9:44to open jesse website i'm already inside
- 9:47the api token page but if you are not
- 9:49you can find it here
- 9:51from here i can create an api token
- 9:54the name of it doesn't really matter i'm
- 9:56just going to use tutorial
- 9:58and then copy this api token and paste
- 10:01it inside your dmv file press ctrl x and
- 10:04then hit y to save the file we should be
- 10:07good to go now so let's cd into the
- 10:08docker directory and all that i have to
- 10:11do for installing jse and inserting the
- 10:14containers is to type
- 10:16docker compose
- 10:18up
- 10:19if i were using docker inside my local
- 10:21machine this should have been enough but
- 10:23because it is on a remote server it is
- 10:25important that i run the process in the
- 10:27background so that after i close my
- 10:29terminal app the session will continue
- 10:31to work to execute docker in the
- 10:33background all i need to do is to pass
- 10:35heighten d at the end of it
- 10:37this command is going to pull all the
- 10:39required images from docker hub install
- 10:42the live thread plugin and run the
- 10:44containers for us this should take a few
- 10:46seconds and maybe one minute so i'll
- 10:48just skip the video
- 10:51all right everything looks fine now
- 10:53so now i should be able to open the
- 10:55dashboard from my browser
- 10:57the url of the dashboard is going to be
- 11:00the ip address of my remote server
- 11:02followed by the port which by default is
- 11:059000
- 11:06now i'm going to copy this wrong
- 11:08password that i set earlier and paste it
- 11:10here
- 11:12everything looks fine and if i can start
- 11:14a paper trading session that means
- 11:16everything including the live thread
- 11:18plugin is working fine
- 11:22and yes everything is indeed working
- 11:24properly
- 11:26[Music]
- 11:30on your hester account go into your
- 11:32servers page
- 11:35open the firewall section
- 11:37click on create firewall
- 11:40in order to make our server secure we
- 11:42have to restrict the inbound traffic the
- 11:45outbound traffic however should be open
- 11:47because we want our application to be
- 11:49able to communicate with the exchanges
- 11:51that it wants and there is really
- 11:53nothing to worry about there so we don't
- 11:55have to add any rules to the outbound
- 11:57section of the firewall
- 11:59on the inbound section however we're
- 12:01going to change things according to the
- 12:03default configurations all ip addresses
- 12:06whether version 4 or version 6 have
- 12:08access to the 22 port which is used for
- 12:10the ssh protocol
- 12:12first find the ip address of your local
- 12:14machine for that you can use a couple of
- 12:16tools i'm using a website called
- 12:19icanhasip.com but feel free to use any
- 12:21other method that you like
- 12:23after copying my ip address i will head
- 12:25back to the head center page
- 12:27and remove the default inputs by
- 12:29clicking on them and pressing the delete
- 12:31button on my keyboard
- 12:33then i will paste in my ip address
- 12:36the tcp protocol is fine the 22 port is
- 12:40also fine
- 12:41so
- 12:42the first rule is done
- 12:44for the second rule i will again paste
- 12:46in my ip address
- 12:48and change the protocol into tcp
- 12:51and for the port i will enter 9000
- 12:54everything looks fine now so i'll just
- 12:56click on the create firewall button
- 13:00so if i change my ip address and try to
- 13:02enter the dashboard again
- 13:05it shouldn't work
- 13:07now if i change my ap address back to
- 13:09what it was inside the firewall
- 13:11and try again it should work just fine
- 13:24[Music]
- 13:28let's say that i want to make a few
- 13:29changes to my strategy since i'm using
- 13:31git as my version manager it's important
- 13:33to never push changes directly to the
- 13:35server so instead i'll push them to my
- 13:38github repository first and then i'll
- 13:40pull them into the server so i will open
- 13:42the project inside my code editor
- 13:46then i will look at my strategy from the
- 13:48strategies directory example strategy
- 13:51and init file
- 13:53let's change a few things for example
- 13:55return 2 here
- 13:58and inside my go long method i will say
- 14:02just submit one by order for the
- 14:04quantity of one and the order price
- 14:07should be the current price
- 14:10to commit my changes and push it into
- 14:12github i could either use the terminal
- 14:15app or a git management app with a gui
- 14:19a good example of that is called github
- 14:22desktop which is what i usually use
- 14:24myself it's free to use and also
- 14:26supports all major operating systems but
- 14:28in this video i'll be using the built-in
- 14:30git management in whis code
- 14:33as it shows us there has been one
- 14:34modified file that hasn't been committed
- 14:37yet to commit the file click on the plus
- 14:39button here
- 14:41and type a message for our commit i will
- 14:44just say
- 14:45update
- 14:47strategy and press command or on windows
- 14:50it will be control and enter to save it
- 14:53to push this command into github i will
- 14:55click on the three dots button
- 14:58and choose
- 14:59push
- 15:02now if i open my github repository one
- 15:04more time i should see the changes here
- 15:07as you can see the last commit message
- 15:09is called update strategy which is
- 15:11exactly what i sent and it's been pushed
- 15:1427 seconds ago
- 15:16now let's move back into the server to
- 15:18pull the changes
- 15:19first i will make sure that i am inside
- 15:21the correct directory
- 15:26then inside the root of my jesse project
- 15:29i will run git
- 15:31pull
- 15:33right it looks good but let me show you
- 15:35how you can make sure that the last
- 15:37commit is indeed the one you just pushed
- 15:40to see the latest commits enter git
- 15:43log
- 15:44and the last one is indeed the message
- 15:46that i gave it
- 15:48whenever you start a new session with
- 15:50jesse it will use the most recent
- 15:52strategy code and there is no need to
- 15:53restart jesse itself
- 15:59[Music]
- 16:03i'm constantly releasing new versions of
- 16:05jesse containing improvements bug fixes
- 16:08new features and so on so it's really
- 16:10important to update your json
- 16:11installation regularly don't worry
- 16:14though it's really easy to do let me
- 16:15show you first head over to the top
- 16:17right corner of the dashboard and click
- 16:20on the about button to open the about
- 16:22section here you can see the jesse
- 16:24version that you have installed and
- 16:26below it you will find the version for
- 16:27the live thread plugin if at the time
- 16:29that you are watching this or in the
- 16:31future a new version is out and you want
- 16:34to update that one first make sure to
- 16:36terminate your running sessions
- 16:39then head back into the server and
- 16:41because i'm using the docker setup all i
- 16:43have to do is to enter the docker
- 16:45directory once again
- 16:49and first to stop the running containers
- 16:51i will run docker compose stop
- 16:55now if i head back to the dashboard and
- 16:57give the page to refresh it shouldn't
- 16:59work
- 17:01now to pull the latest version of the jc
- 17:03image which has everything installed on
- 17:05it all i have to do is to run docker
- 17:08compose
- 17:09pull
- 17:10since no newer version of the docker
- 17:12image has been released since the last
- 17:14time i pulled it it didn't download
- 17:16anything but in your case if there has
- 17:18been indeed a newer version you should
- 17:20see a short progress bar
- 17:23and lastly to start the containers again
- 17:25i will run docker compose up
- 17:28hyphen d
- 17:29i'll give it a few seconds for the
- 17:31containers to start again in the
- 17:33background
- 17:34and if i refresh the page one more time
- 17:36it should work
- 17:38if i open the about section i should see
- 17:40the updated versions now
- 17:44if you want to use the remote server not
- 17:46just for live trading but also for a
- 17:48strategy development then make sure to
- 17:49watch my previous video if you're
- 17:51interested in tutorials about algo
- 17:52trading please subscribe to the channel
- 17:55thanks for watching
About this transcript
This page contains the full transcript of How to deploy your Jesse project into the production server for live trading by Algo-trading with Saleh, generated from the public captions YouTube serves with the video. The transcript has 2,918 words across 463 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.