Download Pulse

Add kdb+ Server Connection

To add a connection goto Connections->"Add Data Connection" and fill in your details.
You can try clicking test to see if the connection works before adding it.

Pulse connecting to kdb+ database

Populating the Tables

SQL Editor Page
  1. Go to the SQL Editor
  2. Make sure your data source is selected
  3. Enter your SQL query
  4. Click Run All or press ctrl+E

Add and Edit Dashboard

  1. On the dashboards listing page, click add
    Add Dashboard
  2. Click on the newly created dashboard to go into it. Either click on edit or toggle design mode once in the dashboard.
    Edit Dashboard

Add Algo Table

  1. Click Table to add that component
  2. Make sure your kdb+ data source is selected
  3. Select the refresh rate. Every 1s
  4. Enter your SQL query select from algos click save or press ctrl+E
  5. For styling, I have set pager to none.
  6. and assigned the TAG formatter to the name and variant columns.
Select Algo Trading Table

Add Start/Stop Buttons

  1. Click User Form to add that component
  2. Click Add Button Icon to add a button to the form.
  3. Add an Event Handler to the button.
  4. Set the kdb+ data source.
  5. Set the code to:stopAll[] to call the function.
  6. Perform similar steps again to call startAll[] with a Start button.
Select Algo Trading Table

Add Right Click Menu Options

We want to add a right-click menu to the table, that allows starting and stopping individual algos. To do this, select the grid component and scroll down on the right-hand side editor panel, expand the interactive tab and click Add Event Handler.

Add Right Click Menu Options
  1. Click Add Event Handler.
  2. Set the Trigger to Menu.
  3. Set the Name to STOP, this controls what the menu option is named.
  4. Set kdb+ as the data source that will recieve the call when an event is triggered.
  5. Set the code to:setStatus[`${{e.variant}};`Stopped].
    The {{e}} object here is a dictionary that has an entry for every row in the table.
    If you wanted you could just send {{e}} and kdb+ would receive a dictionary but we only need the variant column so we will send that casted to symbol.
  6. Perform the steps again, this time calling the menu option Start with code:setStatus[`${{e.variant}};`Running].
Add kdb Right Click Menu

You can now right-click on the table and select Start/Stop for individual Algos.

Activating Right Click Menu

Notice that the table returned from calling setStatus is dsiplayed as a popup message. When there is one row, it will show the full text, when there are more it may present a summary.

Popup Message

Complete

Congratulations, if you have followed along, you have now created a fully interactive Data App. The power of variables allows creating even more advanced interactivity, in the screenshot below you can see Algo limits being set using a text field and the right click menu has a google entry that opens a new browser window while using the {{e}} variable to open a specific page relevant to that algo. Something for you to try in future perhaps. Our links below have more information.

Algo Contents

Thanks for watching our demo. Please download Pulse to give it a try for yourself.