An extremely important requested feature for QSForex has been the ability to backtest over multiple days. Previously the system only supported backtesting via a single file. This was not a scalable solution as such a file must be read into memory and subsequently into a Pandas DataFrame. While the tick data files produced are not huge (roughly 3.5Mb each), they do add up quickly if we consider multiple pairs over periods of months or more.
Let's presume that the market keeps on going against you. In this case, the broker will simply have no choice but to shut down all your losing positions. This limit is referred to as a stop out level. For example, when the stop out level is established at 5% by a broker, the trading platform will start closing your losing positions automatically if your margin level reaches 5%. It is important to note that it starts closing from the biggest losing position.
© Forex Factory 2020.  All rights reserved.  The Forex Factory calendar changes frequently to reflect the latest information.  For the most up to date calendar, please visit  Forex Factory takes no responsibility for decisions based on this information, please see our terms of service at

This material does not contain and should not be construed as containing investment advice, investment recommendations, an offer of or solicitation for any transactions in financial instruments. Please note that such trading analysis is not a reliable indicator for any current or future performance, as circumstances may change over time. Before making any investment decisions, you should seek advice from independent financial advisors to ensure you understand the risks.
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.
Forex trading, also known as foreign exchange trading or currency trading, is where an investor tries to make money by buying and selling currencies on the foreign exchange market. Most investors will follow trends and use strategies to optimise their return. This is a very basic definition that does not reflect the full complexity of Forex trading; our free workshops are ideal for people who are unfamiliar with the concept and want to quickly achieve an in-depth insight into how this all works.
Popular leverage ratios in Forex trading include 1:10, 1:50, 1:100, 1:200, or even higher. Simply put, the leverage ratio determines the position size you’re allowed to take based on the size of your trading account. For example, a 1:100 leverage allows you to open a position 10 times higher than your trading account size, i.e., if you have $1,000 in your account, you can open a position worth $10,000. Similarly, a  leverage ratio of 1:100 allows you to open a position size 100 times larger than your trading account size. With $1,000 in your trading account, you could open a position worth $100,000!
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.
For those of you who are new to source version control you will probably want to read up on how git (and version control in general) works with the fantastic free ebook Pro Git. It is worth spending some time learning about source control as it will save you a huge amount of future headache if you spend a lot of time programming and updating projects!
In particular I would like to make the system a lot faster, since it will allow parameter searches to be carried out in a reasonable time. While Python is a great tool, it's one drawback is that it is relatively slow when compared to C/C++. Hence I will be carrying out a lot of profiling to try and improve the execution speed of both the backtest and the performance calculations.
Free Margin – Your free margin represents your total equity minus any margin used for leveraged trades. For example, if your equity is $1,000 and your used margin is $100, your free margin would amount to $900. Following your free margin is extremely important, as it is used to withstand negative price fluctuations from your open trades and to open new leveraged trades. It’s important to understand that your free margin increases with profitable positions, but decreases with your losing positions. Once the free margin drops to zero or below, your broker will activate the so-called margin call and close all your open positions at the current market rate, in order to prevent your equity from falling below the required margin.
The Federal Reserve Board and self-regulatory organizations (SROs), such as the New York Stock Exchange and FINRA, have clear rules regarding margin trading. In the United States, the Fed's Regulation T allows investors to borrow up to 50 percent of the price of the securities to be purchased on margin. The percentage of the purchase price of securities that an investor must pay for is called the initial margin. To buy securities on margin, the investor must first deposit enough cash or eligible securities with a broker to meet the initial margin requirement for that purchase.

Margin requirements for futures and futures options are established by each exchange through a calculation algorithm known as SPAN margining. SPAN (Standard Portfolio Analysis of Risk) evaluates overall portfolio risk by calculating the worst possible loss that a portfolio of derivative and physical instruments might reasonably incur over a specified time period (typically one trading day.) This is done by computing the gains and losses that the portfolio would incur under different market conditions. The most important part of the SPAN methodology is the SPAN risk array, a set of numeric values that indicate how a particular contract will gain or lose value under various conditions. Each condition is called a risk scenario. The numeric value for each risk scenario represents the gain or loss that that particular contract will experience for a particular combination of price (or underlying price) change, volatility change, and decrease in time to expiration.
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.
Forex margin is a good faith deposit that a trader puts up as collateral to initiate a trade. Essentially, it is the minimum amount that a trader needs in the trading account to open a new position. This is usually communicated as a percentage of the notional value (trade size) of the forex trade. The difference between the deposit and the full value of the trade is “borrowed” from the broker.
Brokers use margin levels in an attempt to detect whether FX traders can take any new positions or not. Different brokers have varying limits for the margin level, but most will set this limit at 100%. This limit is called a margin call level. Technically, a 100% margin call level means that when your account margin level reaches 100%, you can still close your positions, but you cannot take any new positions.
Often, closing one losing position will take the margin level Forex higher than 5%, as it will release the margin of that position, so the total used margin will decrease and consequently the margin level will increase. The system often takes the margin level higher than 5%, by closing the biggest position first. If your other losing positions continue losing and the margin level reaches 5% once more, the system will just close another losing position.