The "philosophy" of the forex trading system, as with the rest of the QuantStart site, is to try and mimic real-life trading as much as possible in our backtesting. This means including the details that are often excluded from more "research oriented" backtesting situations. Latency, server outages, automation, monitoring, realistic transaction costs will all be included within the models to give us a good idea of how well a strategy is likely to perform.
We also apply a concentrated margining requirement to Margin accounts. An account's two largest positions and their underlying derivatives will be re-valued using the worst case scenario within a +/- 30% scanning range. The remaining positions will be re-valued based upon a move of +/-5%. If the concentrated margining requirement exceeds that of the standard rules based margin required, then the newly calculated concentrated margin requirement will be applied to the account.
Just like securities, commodities have required initial and maintenance margins. These are typically set by the individual exchanges as a percentage of the current value of a futures contract, based on the volatility and price of the contract. The initial margin requirement for a futures contract is the amount of money you must put up as collateral to open position on the contract. To be able to buy a futures contract, you must meet the initial margin requirement, which means that you must deposit or already have that amount of money in your account.
How can you avoid this unanticipated surprise? Margin calls can be effectively avoided by carefully monitoring your account balance on a regular basis, and by using stop-loss orders on every position to minimise the risk. Another smart action to consider is to implement risk management within your trading. By managing your the potential risks effectively, you will be more aware of them, and you should also be able to anticipate them and potentially avoid them altogether.
Robust Strategies - I have only demonstrated some simple random signal generating "toy" strategies to date. Now that we are beginning to create a reliable intraday forex trading system, we should start carrying out some more interesting strategies. Future diary entries will concentrate on strategies drawn from a mixture of "technical" indicators/filters as well as time series models and machine learning techniques.
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.
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.