forexfactory calendar downloader - Matlab, R project and Python | futures io social day trading
futures io futures trading

forexfactory calendar downloader
Updated: Views / Replies:13,265 / 12
Created: by enjoyaol Attachments:3

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

forexfactory calendar downloader

  #11 (permalink)
Elite Member
Stuttgart, Germany
Futures Experience: Master
Platform: Tradestation, Jigsaw
Broker/Data: TS Brokerage / InteractiveBrokers / Rithmic
Favorite Futures: ES, TF, NQ, Stocks
Posts: 20 since May 2010
Thanks: 23 given, 17 received

i had some issues with the "actual" and found another (working) script by accident...

from bs4 import BeautifulSoup
import requests
import datetime
import logging
import csv

def setLogger():
                    format='%(asctime)s - %(levelname)s - %(message)s',
    console = logging.StreamHandler()
    formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')

def getEconomicCalendar(startlink,endlink):

    # write to console current status"Scraping data for link: {}".format(startlink))

    # get the page and make the soup
    baseURL = ""
    r = requests.get(baseURL + startlink)
    data = r.text
    soup = BeautifulSoup(data, "lxml")

    # get and parse table data, ignoring details and graph
    table = soup.find("table", class_="calendar__table")

    # do not use the ".calendar__row--grey" css selector (reserved for historical data)
    trs ="tr.calendar__row.calendar_row")
    fields = ["date","time","currency","impact","event","actual","forecast","previous"]

    # some rows do not have a date (cells merged)
    curr_year = startlink[-4:]
    curr_date = ""
    curr_time = ""
    for tr in trs:

        # fields may mess up sometimes, see Tue Sep 25 2:45AM French Consumer Spending
        # in that case we append to errors.csv the date time where the error is
            for field in fields:
                data ="td.calendar__cell.calendar__{}.{}".format(field,field))[0]
                # print(data)
                if field=="date" and data.text.strip()!="":
                    curr_date = data.text.strip()
                elif field=="time" and data.text.strip()!="":
                    # time is sometimes "All Day" or "Day X" (eg. WEF Annual Meetings)
                    if data.text.strip().find("Day")!=-1:
                        curr_time = "12:00am"
                        curr_time = data.text.strip()
                elif field=="currency":
                    currency = data.text.strip()
                elif field=="impact":
                    # when impact says "Non-Economic" on mouseover, the relevant
                    # class name is "Holiday", thus we do not use the classname
                    impact = data.find("span")["title"]
                elif field=="event":
                    event = data.text.strip()
                elif field=="actual":
                    actual = data.text.strip()
                elif field=="forecast":
                    forecast = data.text.strip()
                elif field=="previous":
                    previous = data.text.strip()

            dt = datetime.datetime.strptime(",".join([curr_year,curr_date,curr_time]),
                                            "%Y,%a%b %d,%I:%M%p")
            with open("errors.csv","a") as f:

    # exit recursion when last available link has reached
    if startlink==endlink:"Successfully retrieved data")

    # get the link for the next week and follow
    follow ="")
    follow = follow[0]["href"]

if __name__ == "__main__":
    Run this using the command "python `script_name`.py >> `output_name`.csv"

Reply With Quote
  #12 (permalink)
Salt Lake City, Utah
Futures Experience: Beginner
Platform: Jigsaw, NinjaTrader8
Favorite Futures: ZB
Posts: 460 since Apr 2016
Thanks: 15 given, 387 received

That's funny. I searched and searched for something like this and couldn't find it. Now after I've already written my own code I see this thread.

The code did the parsing part. The next bit was to get the bot to poll forexfactory at the right time and report the results. However, I put that part on the shelf after I found some twitter bots. Seeing how that goes before I go to finishing it.

Reply With Quote
  #13 (permalink)
Trading Apprentice
Manchester, UK
Futures Experience: Beginner
Platform: Multiple
Favorite Futures: Crude
Posts: 1 since Jul 2017
Thanks: 0 given, 0 received

I've been using the script corvin wrote for the past year, works perfect on a linux system and then using grep to filter what you want out.

It's written in Python2

I can't post URL's so search Corvin Codirla, he has a link to the script on his website.

Reply With Quote


futures io > > > > forexfactory calendar downloader

Upcoming Webinars and Events (4:30PM ET unless noted)

Journal Challenge w/Earn2Trade and $599 in Prizes


Anthony Drager: TBA

Nov 29

Linda Raschke: TBA

Elite only

Peter Davies: TBA

Dec 6

Brannigan Barrett: TBA

Elite only

Cannon Trading: Ask Me Anything

Dec 13

Similar Threads
Thread Thread Starter Forum Replies Last Post
Economic Events Downloader (news) Nicolas11 Platforms and Indicators 27 June 2nd, 2018 11:16 AM
chard downloader NT7 snusnufreak NinjaTrader 3 December 10th, 2013 05:02 PM
Market Analyzer as a Historical Downloader? LostTrader NinjaTrader 2 February 17th, 2013 10:49 PM
NT7 excel downloader tinkerz NinjaTrader 0 February 16th, 2013 05:11 PM
Data Downloader StockJock AmiBroker 22 April 8th, 2012 02:44 PM

automated trading, code, dow, es, fed, firefox, forecasting, forex, historical data, information, jpy, matlab, matlab trading, python, python trading, r project, r trading, research, search, sql, timezone, trading, update

All times are GMT -4. The time now is 02:34 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2018-11-19 in 0.09 seconds with 16 queries on phoenix