Barchart Commodity Reader

The Barchart Commodity Reader copies data in a Chameleon Financial Module from the online Barchart API data service which is documented on this website: https://www.barchart.com/ondemand/api

To use the reader you will need an API key from Barchart.

First Time Setup

The first time you launch the app you will be prompted to create a new instance. Provide a name in the dialogue window and press the OK button. The name can be arbitrary.

Setup

MySQL Connection

The commodity reader requires that you setup the connection to your MySQL database used by the Chameleon instance. You can do this easily by entering the Flow URL you use when you login.

Example: localhost/chameleon/

Then press the Get DB Info from Flow URL button. Assuming it is able to connect it will fill in the server, port and database fields with the correct connection information.

Datafeed

The reader requires an API key from Barchart to be able to access the commodity data. You can type in or paste in the key. Then press the Apply key to be saved and have it take effect.

You can also specify how often (in seconds) the reader will grab the latest data from the datafeed.

Commodities

You can manage the topics and commodities updated by the reader on the Commodities tab.

Topics

You will need to create topics in the reader. Only the topics created in the reader will be updated by the reader. To create a new topic

  1. Select the appropriate Content Group

  2. Press the New button beside the topic list.

  3. The list will disappear and in its place will be a text box for you to enter the name of a topic.

  4. Press the Add Topic button.

  5. Your topic is now ready for you to add commodities to it.

Disable Topics

By default topics will be enabled when you create them. This means the reader will update them with new data from Barchart as it runs. If you want to stop these updates you can disable the selected topic by clicking on the Enabled checkbox beside the topic list.

Manage Commodity Lists in the Reader

To add a commodity to a topic in the reader:

  1. Select the Content Group and then Topic.

  2. Type the symbol name of the commodity in the text box beside the Add Symbol button.

    1. Symbols should either be fully specified or use a wildcard notation like this: ZC*1

      1. The *1 indicates that it uses the first contract month for the commodity

      2. You could use *2 to specify the second available month for the commodity

  3. If the symbol you typed is valid it will automatically display the name of the commodity associated to the left of the text box.

  4. Press the Add Symbol button.

  5. The symbol will be added to the list and the list will be refreshed.

    1. The reader will apply the current data from barchart so values are up-to-date right away.

Manage Commodity Lists in Flow

To add a commodity to a topic by using Flow for Chameleon:

  1. Login and navigate to the Financials module.

  2. Select the appropriate Content Group and Topic

  3. Click on the Add New button in the header of the grid showing the current list of commodities

  4. Provide the required information

    1. Symbol

      1. Symbols should either be fully specified or use a wildcard notation like this: ZC*1

        1. The *1 indicates that it uses the first contract month for the commodity

        2. You could use *2 to specify the second available month for the commodity

    2. Name

    3. Price

  5. Press the Add button.

  6. The symbol will be added to the list and the list will be refreshed.

    1. The next time the reader runs it will update the new item with data from barchart.

Run the Reader

Once the setup is complete and there are commodities added to a topic created in the reader you can start running the reader.

Press the play button and it will resume it’s timer countdown to the next update.

Press the pause button to stop the countdown timer and the reader will wait to be restarted.

Press the Read Now button to cause the player to immediately update with data from Barchart.

Messages from the reader will be displayed in the Status box. The reader will also provide its status information to the Chameleon system for monitoring via the Agent Status widget.

You need to have completed setup with valid connection information and an API key before the run options will be enabled.

The reader will run continuously once started.

Displaying the Data in a Chameleon Ticker

When you’re ready to display your data with Chameleon you’ll want to use the dynamic fields added to the financial records that provide custom display values based on the commodity type.

  • displayPrice

  • displayChange

  • displaySymbol

  • displayDate (Mon 'YY)

These display values can take on one of 14 different format types defined by baseCode values from the barchart data. Some format types are decimal based and some are fractional based and display values such as 12’4 and 136’6. Decimal based formats may contain 0 to 7 decimal places. The correct format is automatically applied based on the commodity type.

Check for Updates

The app can notify you in the bottom status bar if it has detected an available update to the app. This check happens automatically once a day.

You can also manually check for updates:

  1. Open the Help menu

  2. Click on Check for Updates

  3. If updates are available you will then be presented with a button to start downloading the update.

  4. Once the update installer has been downloaded you should

    1. close the reader

    2. run the installer

Logging and Debugging

The app will record debug and general operation information to its logs. You can read these logs by using the Help menu and then selecting the appropriate option in the Logs submenu.

You can turn on additional Performance log messages as well. When the Performance Logs option is checked extra messages will be added to the log file as it runs.

You can turn on additional Debug log messages as well. When the Debug Logs option is checked extra messages will be added to the log file as it runs to help with troubleshooting.