Oriented Object Programming combines a group of related variables and functions into unit which is called an object. We refer to these variables as properties and the functions as methods. Let’s say we create a class robot, we need to represent each different robots or entities. That’s where classes and objects come in. In python,…
Category: Python
Trading Strategies
A trading strategy is a systematic methodology used for buying and selling in the securities markets. A trading strategy is based on predefined rules and criteria used when making trading decisions. Active VS. Passive trading strategies Passive Strategies (존버) – Buying bitcoin 10 years ago and just holding it until today Semi-active Strategies (Long-only Strategies)…
Measuring Reward and Risk of an Investment
Let’s load the msft.csv dataframe and make it chart: we can get some summary statistics by using this commnad: Mean return is the performance metric for the reward so we have daily mean return of 11 percent. The standard deviation of returns is the metric for the risk (volatility) which is 1.72 Calculate daily returns…
Price Changes and Financial Returns
Drop the NaN value without changing the original data frame Change a column label MSFT to Price: Last day of price: Compare between two days of price: Absolute price changes are not meaningful yet, this is how we can calculate relative changes The output of percentage change: save the file to csv format:
Financial Data Analysis using Pandas
Loading Financial Data from the Web Ticker Symbol (회사를 나타내는 표식(약자)) BA: Boeing (US Stock) MSFT: Microsoft Corp (US Stock) ^DJI: Dow Jones Industrial Average (US Stock Index) EURUSD=X: Exchange Rate for Currency Pair EUR/USD (Forex) GC=F: Gold Price (Precious Metal / Commodity) BTC-USD: Bitcoin in USD (Cryptocurrency) Inspection Visualization Normalizing (정규화) Another Example Load…
How to Get Free Historical Daily Bar Data
Go to https://finance.yahoo.com In the search field, type in your desired symbol or company name and select the appropriate result Click the ‘Historical Data’ tab Set the date range to ‘MAX’ Hit the ‘Apply’ button Click the ‘Download Data’ link just below the ‘Apply’ button Enjoy your daily bar data Reference https://fxgears.com/index.php?threads/how-to-acquire-free-historical-tick-and-bar-data-for-algo-trading-and-backtesting-in-2020-stocks-forex-and-crypto-currency.1229/#post-19298
Working with Open Data Sources (Quandl)
How to retrieve historical average prices for the BTC/USD exchange rate Obtains such a key by signing up for a free Quandl account on the Quandl sign up page. Data requests requiring an API key expect the key to be provided as the parameter api_key. In the example, the API key (which is found on…
SSL encrypted Jupyter Lab server Installation on Cloud (DigitalOcean)
DigitalOcean is well known for low rates for smaller cloud instances which costs only 5 USD per month or 0.007 USD per hour, so I’m going to use it for about 2 hours, destroy it, and get charged just 0.014 USD. The goal of this post is to set up a Droplet on DigitralOcean that…
Python for Algorithmic Trading – Conda as a Package Manager in Docker (2)
Python for Algorithmic Trading (1) Docker Container This section goes into the details of what the docker technology can do in the context of Python deployment. Building a Ubuntu and Python Docker Image This dockerfile control the building procedure for the image itself. The Bash script in below will be installing three parts: Linux housekeeping…