API Manual

v9 is an analytical product for tracking past and current futures contracts. It allows you to programmatically perform actions based on incoming Chicago Mercantile Exchange (CME) WebSocket event data with nanosecond precision and same-day transaction settlement (T-0).

Accessing v9

The latest build of v9 may be accessed at v9.vertex-analytics.com.

v9 Editor

The v9 Editor is where programmers can write custom algorithms in order to build out individual data visualization solutions.

Each algorithm's script, located on the lefthand side, corresponds to a data visualization solution located on the righthand side.

Initially, you must click the "new script" button, shown above, in order to access all of the different sections of the v9 Editor.

Sections (Editor)

Top-Bar (Editor)

The top-bar houses four navigation buttons to the right that each take you to different pages of v9.

Top-Bar Buttons
Navigates to the v9 Dashboard
Navigates to the v9 Data Center
Navigates to the v9 Documentation
Navigates to the v9 Log In Page

Left-Bar (Editor)

The bar on the left-hand side of the v9 Editor contains options for showing and hiding different sections of v9.

Left-Bar Top Buttons
Shows / hides the Explorer
Shows / hides the Text Editor
Shows / hides the Pane
Shows / hides the Debug Output
Left-Bar Bottom Buttons
Changes the v9 Editor to a dark theme
Changes the Text Editor to a light theme
Changes the v9 Editor to a dark blue theme
Changes the v9 Editor to a light blue theme

Explorer (Editor)

The explorer houses all of the user's scripts and Vertex Analytics sample scripts.

  • Top buttons

These buttons correspond to different actions that may be performed on files within the explorer.

Top Explorer Buttons
Adds a new base script
Opens a window that allows for importing a script
Downloads the current script
Deletes the current script
  • User scripts

The scripts dropdown, pictured above, houses each and every one of the user's scripts.

  • Templates

The templates dropdown, pictured above, houses sample scripts created by Vertex Analytics staff separated by library.

Text Editor (Editor)

This section represents the area to the right of the explorer section where users create and edit HTML files that contains algorithms to visualize different symbol data.

Debugging Output (Editor)

This section represents the area below the text editor where syntax and runtime errors are logged regarding current the script(s).

  • Chrome's built-in console will handle issues with external libraries.

Pane (Editor)

The pane section, to the right of the text editor, is where a data visualization solution appears upon running the current script. The user may choose to specify the symbol and date values that the current script should reference here or within their script.

File Architecture (Editor)

As part of the file architecture, there are four main parts that make up each file:

  • Library Imports

    • This section refers to the top of the HTML file where both v9's propritary library and third-party libraries are imported.

      • Every script imports the v9 backend via:
      <script src="https://v9.vertex-analytics.com/_vxaapi-1.0.0/v9.js"></script>
      
  • JavaScript (Extending v9.feed)

      <script>
        class CustomFeed extends v9.feed {
          onInit(){}
          onOpen(pMeta){}
          onRender(){}
          onEvent(pSymbol, pEvent, pRealTime){}
          onStop(){}
        }
    
        let feed = new CustomFeed();
      </script>
    
    • This section houses all of the data visualization logic that is executed through the v9 API. This includes the class declaration for the v9 event v9.feed, the lifecycle methods associated with a v9 feed, and the instantiation of a v9.feed object after overriding all of the data visualization logic within the CustomFeed class body.

      There are five main lifecycle methods associated with each v9.feed. Each lifecycle method executes at a different point in time while the current script is running.

      • onInit()

        onInit() {
        
        }
        
        • This is the first method that is called when a script is run. It should be used to instantiate the chart, because it only runs once.
      • onOpen(pMeta)

        onOpen(pMeta) {
        
        }
        
        • This is the second method that is called when a script is run. It only runs once per day.

        • Parameters

          • pMeta: Contains metadata associated with each symbol ran within the v9 runtime.
        • This method is called when the pane has initally loaded all previous session events and information from the current symbol.

      • onRender()

        onRender() {
        
        }
        
        • This method is called, at most, 60 times per second once onLoad completes.
      • onEvent(pSymbol, pEvent, pRealTime)

        onEvent(pSymbol, pEvent, pRealTime) {
            switch (pEvent.header.unionID) {
                case v9.UnionID.<Value>:
                    // Do something when pEvent.header.unionID is equal to v9.UnionID.<Value>
                    break;
                default :
                    break;
            }
        }
        
        • This method is called once for every incoming event in relation to the current symbol.

        • pEvent is a JavaScript object that holds exchange Event information. To determine what type of Event is currently being handled, a switch statement should be used as shown above.

        • Parameters

          • pSymbol: String representing the name of the current symbol.

          • pEvent: Current event being handled.

          • pRealTime: Boolean determining whether or not to only handle current events.

      • onStop()

        onStop() {
        
        }
        
        • This method is called when the script is stopped by the user.
  • CSS Section

    <style>
      html, body, #container {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
    
    • This section refers to styling overrides the user makes within their script(s).
  • HTML Section

    <body>
      <div id="container"></div>
    </body>
    
    • This section will always contain a div. By default, its ID is "container". The script's feed will point to this HTML element's ID by default.

      • The proper method to reference this HTML element's ID will be different depending on the library being used.

v9 Dashboard

v9's Dashboards are composed of either one or multiple scripts written in the v9 Editor.

The v9 Dashboard is where traders can create Dashboards to monitor multiple scripts they created in the v9 Editor at once.

Sections (Dashboard)

Top-Bar (Dashboard)

The top-bar houses four navigation buttons to the right that each take you to different pages of v9.

Top-Bar Buttons
Navigates to the v9 Data Center
Navigates to the v9 Documentation

Left-Bar (Dashboard)

The bar on the left-hand side of the v9 Editor contains options for showing and hiding different sections of v9.

Left-Bar Top Button
Shows / hides the Explorer
Left-Bar Bottom Buttons
Changes the v9 Editor to a dark theme
Changes the Text Editor to a light theme
Changes the v9 Editor to a dark blue theme
Changes the v9 Editor to a light blue theme

Explorer (Dashboard)

The explorer houses all of the user's scripts and Vertex Analytics sample scripts.

  • Top Buttons

These buttons correspond to different actions that may be performed on files within the explorer.

Top Explorer Buttons
Adds a new base dashboard
Deletes the current dashboard
  • User Dashboards

The dashboard dropdown, pictured above, houses each and every one of the user's scripts.

  • User Scripts

The scripts dropdown, pictured above, houses user-created scripts from the v9 Editor.

Dashboard (Dashboard)

The dashboard section, to the right of the explorer, houses the currently selected dashboard in the explorer.

Users can drag and drop different scripts from their v9 Editor onto different sections of the current dashboard from the explorer.

Initially, you must click the "new dashboard" button, shown above, in order to access all of the different sections of the v9 Editor.

Troubleshooting

For certain periods throughout the day, v9 will not be able to run real-time scripts, because the v9 platform makes use of the time in which the exchange is down to process and archive data. Below is a chart containing weekly hours of estimated downtime.

Monday Tuesday Wednesday Thursday Friday Saturday Sunday
4:00pm-5:00pm 4:00pm-5:00pm 4:00pm-5:00pm 4:00pm-5:00pm 4:00pm- - -5:00pm

Also, please note that the CME closes at 3:15pm to 3:30pm on weekdays.

Contact

If you come across any major issue/bugs, please let us know by creating an issue at this repository's issues page.

Additionally if the issue is pertinent or there is something that you think we could improve about this documentation, please send us an email at support@vertex-analytics.com.