Back to Community
Running algos for Bovespa's Stocks

Hi all,

I would like to know if is possible to find some stock listed in Bovespa Stock Exchange.
For example, PETR4 ITUB4 BBSA3...

I really will appreciate to test some algos on Brazilian stocks.

Any help will be great!

Cheers,

Jose A.

8 responses

Hello Jose,

BBSA3 confused me. It's a weather station in Arizona....

P.

Clone Algorithm
89
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
def initialize(context):
    context.dummySid = sid(2)
    fetch_csv("http://www.quandl.com/api/v1/datasets/GOOG/BVMF_PETR4.csv?&trim_start=2003-06-02&trim_end=2014-04-11&sort_order=desc",
              symbol = "PETR4",
              date_column = "Date",
              date_format = "%Y-%m-%d")
    fetch_csv("http://www.quandl.com/api/v1/datasets/GOOG/BVMF_ITUB4.csv?&trim_start=2012-11-22&trim_end=2014-04-11&sort_order=desc",
              symbol = "ITUB4",
              date_column = "Date",
              date_format = "%Y-%m-%d")
    fetch_csv("http://www.quandl.com/api/v1/datasets/GOOG/BVMF_BBAS3.csv?&trim_start=2012-11-22&trim_end=2014-04-11&sort_order=desc",
              symbol = "BBAS3",
              date_column = "Date",
              date_format = "%Y-%m-%d")
    
def handle_data(context, data):
    if 'Close' in data['PETR4']:
        record(PETR4=data['PETR4']['Close'])
    if 'Close' in data['ITUB4']:
        record(ITUB4=data['ITUB4']['Close'])
    if 'Close' in data['BBAS3']:
        record(BBAS3=data['BBAS3']['Close'])
     
    
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

Hi Peter,

The "BBAS3" is "Banco do Brasil" stock a main state bank listed on Bovespa Exchange.

I checked the www.quandl.com and found it and many others stocks from Brazil.

Thanks for the assistance.

Now I'll fetch the data using this data source =]

Many thanks!

Cheers,

Jose

Hi Jose,

We currently only support backtesting for US stocks and ETFs. We're working to fully build the platform for backtesting and live trading US stocks and then will add other data sources in the future.

You can use the fetcher feature to import any external data in csv format. This external data can be used as a trading signal, but the Quantopian backtester can only buy/sell sids in our database using our prices. We don't have the ability at this point to run backtests with other price series.

That being said, check out this post to use Fetcher with any dataset: https://www.quantopian.com/posts/use-the-fetcher-for-any-quandl-dataset

Cheers,
Alisa

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Alisa,

Is there any prediction for the backtesting of trading strategies on external data?

Thanks,

Rodrigo F.

Could you clarify what you mean by "is there any prediction"? You can run a backtest using external data as a tradign signal. Here is an example: https://www.quantopian.com/help#sample-csv-1

Alisa,

Thanks for the attention.

From what I understand, currently Quantopian supports using external data as a trading signal for US stocks and ETFs, but so far the backtesting only works for these securities, right? For instance, is there any way I could backtest a strategy that uses gold and paladium csv's as a trading signal for a stock not available in your database, such as the Brazilian CSNA3.SA (who's historical prices would also be inputted as a csv)?

Currently I have been doing all of this through Zipline on a Python IDE, but I would like to know if there is any prediction on how soon it will be possible to do this backtesting on Quantopian (of course, disregarding the real money live trading feature, because this certainly would take much longer).

is there any way I could backtest a strategy that uses gold and paladium csv's as a trading signal for a stock not available in your database

No, you can only backtest (paper trade and live trade) securities that we have in our database. If we don't have the security (ie Brazilian CSNA3.SA), you can only use it as a signal to trade US stocks and ETFs

Update: Quantopian now supports the research of equities from 25 global markets, including Bovespa. See our announcement on the availability of global equity pricing and fundamental data.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.