Trading foreign exchange on margin carries a high level of risk, and may not be suitable for everyone. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. Remember, you could sustain a loss of some or all of your initial investment, which means that you should not invest money that you cannot afford to lose. If you have any doubts, it is advisable to seek advice from an independent financial advisor.
All currency trading is done in pairs. Unlike the stock market, where you can buy or sell a single stock, you have to buy one currency and sell another currency in the forex market. Next, nearly all currencies are priced out to the fourth decimal point. A pip or percentage in point is the smallest increment of trade. One pip typically equals 1/100 of 1 percent.
The currency exchange rate is the rate at which one currency can be exchanged for another. It is always quoted in pairs like the EUR/USD (the Euro and the US Dollar). Exchange rates fluctuate based on economic factors like inflation, industrial production and geopolitical events. These factors will influence whether you buy or sell a currency pair.
Unit Tests for Position/Portfolio - While I've not mentioned it directly in diary entries #1 and #2, I've actually been writing some unit tests for the Portfolio and Position objects. Since these are so crucial to the calculations of the strategy, one must be extremely confident that they perform as expected. An additional benefit of such tests is that they allow the underlying calculation to be modified, such that if all tests still pass, we can be confident that the overall system will continue to behave as expected.
Local Portfolio Handling - In my opinion carrying out a backtest that inflates strategy performance due to unrealistic assumptions is annoying at best and extremely unprofitable at worst! Introducing a local portfolio object that replicates the OANDA calculations means that we can check our internal calculations while carrying out practice trading, which gives us greater confidence when we later use this same portfolio object for backtesting on historical data.