Slippage Handling - The system is currently generating a lot of slippage due to the high-frequency nature of the tick data provided from OANDA. This means that the portfolio balance calculated locally is not reflecting the balance calculated by OANDA. Until correct event-handling and slippage adjustment is carried out, this will mean that a backtest will not correctly reflect reality.
If your free margin drops to zero, your broker will send you a margin call in order to protect the used margin on your account. Always monitor your free margin to prevent margin calls from happening, and calculate the potential losses of your trades (depending on their stop-loss levels) to determine their impact on your free margin. With some experience, you’ll find it significantly easier to follow your margin ratio and understand the meaning of margin in Forex trading.
Now, let’s say you open a trade worth $50,000 with the same trading account size and leverage ratio. Your required margin for this trade would be $500 (1% of your position size), and your free margin would now also amount to $500. In other words, you could withstand a negative price fluctuation of $500 until your free margin falls to zero and causes a margin call. Your position size of $50,000 could only fall to $49,500 – this would be the largest loss your trading account could withstand.
Interactive Brokers ®, IBSM, InteractiveBrokers.com ®, Interactive Analytics ®, IB Options AnalyticsSM, IB SmartRoutingSM, PortfolioAnalyst ®, IB Trader WorkstationSM and One World, One AccountSM are service marks and/or trademarks of Interactive Brokers LLC. Supporting documentation for any claims and statistical information will be provided upon request. Any trading symbols displayed are for illustrative purposes only and are not intended to portray recommendations.
In particular I've made the interface for beginning a new backtest a lot simpler by encapsulating a lot of the "boilerplate" code into a new Backtest class. I've also modified the system to be fully workable with multiple currency pairs. In this article I'll describe the new interface and show the usual Moving Average Crossover example on both GBP/USD and EUR/USD.
It is essential that traders understand the margin close out rule specified by the broker in order to avoid the liquidation of current positions. When an account is placed on margin call, the account will need to be funded immediately to avoid the liquidation of current open positions. Brokers do this in order to bring the account equity back up to an acceptable level.
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.
To get started, investors interested in trading in the forex markets must first sign up with either a regular broker or an online forex discount broker. Once an investor finds a proper broker, a margin account must be set up. A forex margin account is very similar to an equities margin account – the investor is taking a short-term loan from the broker. The loan is equal to the amount of leverage taken on by the investor.
In addition, I've had some comments from people suggesting that they'd like to see more varied order types than the simple Market Order. For carrying out proper HFT strategies against OANDA we are going to need to use Limit Orders. This will probably require a reworking of how the system currently executes trades, but it will allow a much bigger universe of trading strategies to be carried out.
Not all securities can be bought on margin. Buying on margin is a double-edged sword that can translate into bigger gains or bigger losses. In volatile markets, investors who borrowed from their brokers may need to provide additional cash if the price of a stock drops too much for those who bought on margin or rallies too much for those who shorted a stock. In such cases, brokers are also allowed to liquidate a position, even without informing the investor. Real-time position monitoring is a crucial tool when buying on margin or shorting a stock.
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.