Quantcast
Channel: ProgrammableWeb - Financial
Viewing all articles
Browse latest Browse all 2238

How the FXCM APIs and Tools can get you Started with Algorithmic Trading

$
0
0
Super Short Hed: 
How the FXCM APIs and Tools can get you Started with Algorithmic Trading
Featured Graphic: 
Primary Target Audience: 
Primary Channel: 
Primary category: 
Secondary category: 
Related Companies: 
Related APIs: 
FXCM FIX
FXCM Socket REST
Featured: 
Yes
Summary: 
Just as online trading expanded the options available to traders, a similar industry shift has been playing out over the past few years as algorithmic trading has become more accessible. This article looks at FXCM's platform including its API that helps traders get started with algo trading.

Prior to the proliferation of online trading brought about by the internet boom decades ago, traders had limited options for execution and analysis. As online trading became the industry norm, an increasing number of brokers and technology providers emerged with numerous unique offerings, expanding a trader's options. A similar industry shift has been playing out over the past few years as algorithmic trading has become more accessible, giving traders a new swath of markets to trade, platforms to use, methods of execution, and devices for analysis.

While algorithmic trading is largely uncharted territory for most retail traders, this recent proliferation of advanced platforms and technology have made it possible for practically anyone to create an account and trade algorithmically from their living room. Expertise in data science, quantitative mathematics or even programming is not necessary in order to take advantage of the benefits and features of algo trading.

Why Algorithmic Trading?

An algorithm is a set of rules to be followed to calculate the solution to a particular problem. Algorithmic trading, also known as algo trading/quant trading/systematic trading, involves using a program to execute trades automatically. Using a trading algorithm allows a trader to avoid the psychological struggle many discretionary traders face. In addition traders can add complexity and customization to their strategy, all while saving time compared to manual point-and-click trading. There are many platforms and venues an individual can choose to trade in a more efficient and systematic way, regardless of programming skills.

So how does it work? An algorithm is programmed to look for signals, generally fundamental or technical. An example of a fundamental signal would be a change in the valuation of a currency, while a technical signal may occur when the fast moving average of the price of an asset crosses over its slow moving average. The algo recognizes this signal and makes a decision to buy or sell without any direct involvement from a human.

Remove Emotions

Traders of all asset classes and skill levels have one struggle in common—maintaining mental stability in times of uncertainty. Humans are prone to making irrational decisions when faced with stressful situations, and stressful situations occur often when trading due to sudden political events or market movements. To quote Economist John Maynard Keynes, "The market can remain irrational longer than you can remain solvent".

How can we protect ourselves from making psychological mistakes due to impulsive thinking?

By using an algo, traders can maintain discipline by removing the psychological temptations that arise when manually trading. The instrument, trade size, appropriate take profit/stop loss and the trading signal are created by the trader, while the algo continuously performs calculations on incoming prices waiting until a signal is identified. While a manual trader runs the risk of making a psychological mistake like placing an order due to fear of missing out or closing a trade before the desired take profit, an algo uses a mathematical formula to calculate each and every trade.

Save Time

From planning your trading idea, analyzing charts, waiting for the entry and monitoring the exit, manual trading is exceedingly time consuming. Setting aside several hours per day for trading is not necessarily realistic for most individuals with a full-time job. Setting up an algo allows a trader to sit back and relax while leaving the algo running.

An algo can identify a pattern much more quickly and efficiently than a human looking at the same data because a computer is able to execute several computationally complex processes at once, while the human brain is limited on the amount of information it can digest at once.

Continued from page 1

Artificial intelligence and machine learning, while not fundamental components of algo trading, are increasingly being utilized for this purpose. In fact, some trading platforms now offer machine learning applications which do not require any prior experience in the field allowing traders of all skill levels to utilize this technology.

Customize

Discretionary traders generally use a system of manually watching charts or prices and executing trades based on what they see. A trading algo simply automates this process. Because an algorithm is a computer program, it has the potential to analyze increasingly more complex inputs than a human. Instead of deciding which condition to watch for or data to analyze, a trader can program a completely unique algo which considers multiple factors simultaneously before executing a trade.

Typical trading platforms offer a user-friendly interface which generally provides a few options with basic trading functions to provide the user with the easiest trading experience possible.

However, just because the choices aren't available doesn't mean they don't exist. By connecting to an API a trader can receive prices and execution from a broker without using its platform, allowing for ultimate customization. There are many open-source libraries of indicators, sample code, and charting packages for algo traders that could be utilized with or as part of the strategy. Using a web-based API like FXCM's REST API, a trader can connect and execute trades through a python interpreter like iPython, which makes it possible to import additional tools for backtesting, trading, and analysis.

How do I Get Started?

Despite popular belief, understanding how to program an algorithm is not a prerequisite to using one. There are many platforms that exist for precisely this purpose. Some platforms come with algorithms ready to go, like FXCM's Trading Station, while others allow you create a strategy by entering your parameters with no coding involved. If you are an experienced coder, connecting to a broker's API allows you to access prices and execute trades while using an environment and language you are comfortable with. FXCM offers four APIs boasting different features to accommodate a variety of strategies and traders. For example, the FIX API is best-suited for high frequency traders as it provides up to 300 price updates per second. The ultra-flexible REST API can be used with any language that supports standard HTTP calls, while the ForexConnect and Java APIs have user-friendly SDK packages.

The first step to getting started is to create an account. Many brokers, like FXCM, offer demo or practice accounts which are helpful when backtesting and forward testing a strategy. FXCM provides connection instructions as well as sample code, making it easy to connect and access historical and live data in minutes.

Fxcmpy

In order to make connecting and trading as straightforward as possible FXCM has developed a python wrapper compatible with the REST API. In order to get started with fxcmpy, follow the steps below to install it and login to the server.

  1. Pip install fxcmpy
  2. Create a demo/live account and generate your token
    • Log into http://tradingstation.fxcm.com/
    • Click your account number > token management
    • Enter your password and click 'generate token'— be sure to write this down
  3. Create a configuration file with your token in order to quickly, securely connect and interact with the server
    • fxcmpy documentation and connection guide here
    • Sample code to begin practicing here

Trading Station

Looking to get started with an algo but don't have the time to learn to program? The Trading Station platform comes with several algo trading strategies already coded so all you need to do is backtest the strategy with your desired parameters and get started. In order to install Trading Station, follow the steps below.

  1. Create an FXCM account and download Trading Station desktop
  2. Choose a strategy from the strategies menu or download a strategy from the FXCM App Store
  3. Use the Strategy Backtester to decide how you'd like to run the strategy
  4. Once you've backtested and found the parameters you'd like to use for your algo, you're ready to allow live trading and get going
    • Remember, the platform must be running in order for your strategy to be active. If you need to turn off your computer regularly or you want a more reliable solution, look into setting up a VPS.

The most work-intensive portion of this process is setting up your system. Once the system has been deployed and trades are properly executing, it does not require constant attention. Running a system on a virtual machine which is never shut off allows the algo to trade any time the market is open.

As you can see getting started as an algo trader is simple, straightforward, and accessible to people with varying skillsets. The important thing is to have a plan and stay dedicated to your goals. Following an algo trading community site (such as QuantNews) and participating in forums can help you stay engaged while also keeping you informed of the latest industry trends.

Market Opinions: Any opinions, news, research, analyses, prices, other information, or links to third-party sites contained on this article are provided as general market commentary and do not constitute investment advice. The market commentary has not been prepared in accordance with legal requirements designed to promote the independence of investment research, and it is therefore not subject to any prohibition on dealing ahead of dissemination. FXCM will not accept liability for any loss or damage including, without limitation, to any loss of profit which may arise directly or indirectly from use of or reliance on such information.

Risk Warning: FXCM's service includes products that are traded on margin and carry a risk of losses in excess of your deposited funds. The products may not be suitable for all investors. Please ensure that you fully understand the risks involved.

Content type group: 
Articles
Top Match Search Text: 
How the FXCM APIs and Tools can get you Started with Algorithmic Trading

Viewing all articles
Browse latest Browse all 2238

Trending Articles