How does the interface work?

We just so happen to have an appropriate video:

QuantBlocks: Interface tutorial, hosted by Vimeo.

How can I build a MACD strategy?

QuantBlocks: A Moving Average Convergance Divergance tutorial, hosted by Vimeo.

How can I build a Price Crossover strategy?

QuantBlocks: A Price Crossover tutorial, hosted by Vimeo.

How can I build a Moving Average Crossover strategy?

QuantBlocks: A Moving Average Crossover tutorial, hosted by Vimeo.

Where does QuantBlocks get its data?

We use end-of-day data from Xignite, Inc. based in California.

How are the backtests calculated?

All of our strategies are calculated on End-of-Day data, at the end of the day. We use a combination of actual closing and adjusted closing prices to try and provide a more accurate depiction of how one's strategy would have performed over the given period of time. We've found that only using one or the other can provide misleading results. For example, by only using actual close one would be ignoring the many corporate actions such as dividends and stock splits. By only using adjusted returns one may exit or enter a position falsely depending on the strategy they're trying to implement. By using a combination of the two we can take both considerations into effect to provide a more accurate backtest.

WARNING! As a means of trying to maximize simplicity to the end user, our system does not take into account volume and partial fills. This means that the results for instruments with a relatively lower volume and/or price will have a greater chance of being inaccurate.

How are you calculating the Relative Strength Index(RSI)?

Our Relative Strength Index calculation uses Simple Moving Average (not Exponential Moving Average) and results in a number between 0 - 100. An example of an RSI strategy is to buy a stock whenever the RSI is below 30 and to sell the stock when it's above 70, riding the upward trend along the way.

How are you calculating the Exponential Moving Average(EMA)?

Our Exponential Moving Average approach uses the standard weighting of 2 / ([no. of days] + 1) and seeds the calculation with the initial closing price for the instrument being examined. For example if our instrument, FBAR, has the prices [100, 200, 300, 400, 500] and we wish to find the 5 day EMA we would take the weighting as 1/3 and the seed value for the EMA as 100. The calculation would then be:

100 + 1/3(200 - 100) + 1/3(300 - (100 + 1/3(200 - 100))) ...

How are the rate of returns calculated?

Cumulative returns are calculated via a discrete Rate of Change.

What does MACD crossing its signal mean?

This is a little bit complicated so it's sensible to cover a little bit of background first. A MACD is the Moving Average Convergance Divergance line, it is the difference between the Exponential Moving Average (EMA) for a short (or fast) period of time and the EMA of a long (or slow) one. This gives a line that represents change in the trend of a stock, not the change in the stock itself. If we compare MACD to an average (commonly it's EMA) of the MACD then we can (hopefully) catch small discrepancies in the stock's trend, this average is called the signal line. Quantblocks uses 12 and 26 days respectively for it's fast and slow periods of time and a 9 day EMA for the signal line, as these are generally accepted as useful parameters.

The two crossover blocks return a true or false value (so does not need any comparison operators) and indicate whether or not the MACD has crossed it's signal. The up block is true when the MACD line has gone from below it's signal to above it and the down block represents the opposite. The crossover direction is important because it suggests the direction in which the stock is about to move, and as such, it is generally considered a good idea to buy when the crossover is in the upward direction and sell when it is down.

What is the price ratio block for?

Using this block a simple pairs trading strategy can be represented. With two instruments known to correlate you can create a rule that holds one and shorts the other if the ratio goes above an upper threshold and vice versa if it goes below a lower threshold. Remember to close the trades when between the thresholds otherwise the shorted and/or held stock may end up making losses while you wait for the threshold clauses to be triggered.

Buy? Hold? Short? Close? What are they representing and isn't it more politically correct to say vertically challenged?

Good question, glad I asked it.
Buy is straightforward: You can either buy a certain number of shares of an instrument or a number of dollars worth of shared of that instrument.
Hold is a bit more interesting: When you hold a percentage of portfolio on an instrument we try to balance your portfolio to match that request:

Day 1 Day 1 After Hold 25% Day 2 Day 2 After Hold 75%
Share Price $10 $10 $15 $15
Portfolio Cash $100 $50 $50 $35
Volume of Shares 0 5 5 6
Portfolio Worth $100 $100 $125 $125

Day 1: The portfolio value is $100 and we want 50% of it to be spent on some instrument with a value of $10. We therefore finish with 5 of the shares and $50 remaining in cash.
Day 2: The portfolio value is $125 because the share price has increased. The strategy now requires 75% of the portfolio value to be in the instrument and we currently have 5 shares at a value of $75, which is 60% of the portfolio value. 75% of $125 is $93.75, that value minus $75 gives us the amount we need to spend which is $18.75. In other words we should buy 1.25 shares, we can't buy .25 of a share so floor the value and buy 1. We finish with 6 shares at a value of $90 dollars, representing 72% of the portfolio value.

Shorting is essentially borrowing stock you don't have and selling it at the current price. The assumption being that the price will have gone down when you have to give it back and you can buy it for less money than you originally sold it. Quantblocks prevents you from shorting when your total portfolio value is less than or equal to 0 and when you do not have the available cash to support the short. Quantblocks is not trying to emulate a broker and as a result these restrictions are as simple as they can be while preventing you from shorting indefinitely, which could lead to gains and losses of millions despite a small starting budget.
Close is, like buy, pretty straightforward: You can close out the percentage (shorted or held) of a specific instrument, a given dollar value worth of an instrument or a specific number of shares of an instrument. The latter two will close held and shorted stock indiscriminately.

Why don't all of the equities show up on the drop-down list?

The drop-down list only displays those equities most searched by QuantBlocks users. If you would like access to an equity and don't see it on the list, just type it in and try to run the backtest. If that still doesn't work, please contact us ( with the equity you were looking for and we'll get back to you as soon as we can.