The script is currently hardcoded to generate forex data for the entire month of January 2014. It uses the Python calendar library in order to ascertain business days (although I haven't excluded holidays yet) and then generates a set of files of the form BBBQQQ_YYYYMMDD.csv, where BBBQQQ will be the specified currency pair (e.g. GBPUSD) and YYYYMMDD is the specified date (e.g. 20140112).
As part of the Universal Account service, we are authorized to automatically transfer funds as necessary between your securities account and your futures account in order to satisfy margin requirements in either account. You can configure how you want us to handle the transfer of excess funds between accounts on the Excess Funds Sweep page in Account Management: you can choose to sweep funds to the securities account, to the futures account, or you can choose to not sweep excess funds at all.
Currency markets are important to a broad range of participants, from banks, brokers, hedge funds and investor traders who trade FX. Any company that operates or has customers overseas will need to trade currency. Central banks can also be active in currency markets, as they seek to keep the currency they are responsible for trading within a specific range.
Free margin in Forex is the amount of money that is not involved in any trade. You can use it to take more positions, however, that isn't all - as the free margin is the difference between equity and margin. If your open positions make you money, the more they achieve profit, the greater the equity you will have, so you will have more free margin as a result. There may be a situation when you have some open positions and also some pending orders simultaneously.
Once an investor has started buying a stock on margin, the NYSE and FINRA require that a minimum amount of equity be maintained in the investor's margin account. These rules require investors to have at least 25% of the total market value of the securities they own in their margin account. This is called the maintenance margin. For market participants identified as pattern day traders, the maintenance margin requirement is a minimum of $25,000 (or 25% of the total market value of the securities, whichever is higher).
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.
Margins are a hotly debated topic. Some traders argue that too much margin is very dangerous, however it all depends on trading style and the amount of trading experience one has. If you are going to trade on a margin account, it is important that you know what your broker's policies are on margin accounts, and that you fully understand and are comfortable with the risks involved. Be careful to avoid a Forex margin call.
In order to understand Forex trading better, one should know all they can about margins. Forex margin level is another important concept that you need to understand. The Forex margin level is the percentage value based on the amount of accessible usable margin versus used margin. In other words, it is the ratio of equity to margin, and is calculated in the following way:
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.
Trading on margin is extremely popular among retail Forex traders. It allows you to open a much larger position than your initial trading account would otherwise allow, by allocating only a small portion of your trading account as the margin, or collateral for the trade. Trading on margin also carries certain risks, as both your profits and losses are magnified.
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.