Excel Integration - Trigger Commands

This page explains how to use Cymatic trigger commands in Excel, to send orders to Betfair.

General Considerations:

  • Put your trigger commands in the column called 'Command' in the Cymatic worksheet.
  • The Status cell must be empty for a command to be triggered.  As soon as the command is detected, PENDING will appear in the Status cell - this prevents the order repeating multiple times while waiting for the repsonse from Betfair.
  • The commands are not case sensitive.
  • Commands can be used on multiple rows simultaneously and even a mixture of commands can be used (no more than one command on each row).  All commands of a similar type will be executed together as a simulataneous batch.
  • If a command fails, the Status column will show either FAILURE, TIMEOUT or PROCESSED_WITH_ERRORS.  Additional details of the error will appear in the Report column.
  • If a command was succesful, the contents of the Status column will change accordingly, as described below in the details for each command (for example, CANCELLED will appear in the status cell, if the CANCEL command was successful).
  • You can do any intermediary calculations in the columns to the right of the Report column, so columns BJ onwards.  Alternatively you might prefer to rename one of the spare sheets (for example Sheet2 or Sheet3) and call it 'Rules'. Then put all of your intermediary calculations in Rules. Then in the Command column in the Cymatic sheet, you can put formulae that refer to your final resulting column in Rules.  That might be slightly more efficient because you can do any typing you want in the Rules worksheet without triggering the Cymatic grid to keep reading what you have typed (which is what happens when you type in the Cymatic worksheet).  However, either method will work equally well.

Trigger Commands in Excel for Advanced Cymatic Trader

Here are the details and syntax of all the commands:

BACK / LAY

BACK/LAY [LAPSE][KEEP][TAKE-SP] [OFFSETx [STOPLOSSx [PLACEATx] [TRAIL]] [GREEN] ] [FILLORKILLx]

Used to send either a BACK or a LAY bet.

  • x represents the number of ticks (price increments)
  • The Stake cell must contain a value.
  • The Odds cell must contain a value.
  • STOPLOSS can only be included if OFFSET is included.
  • The GREEN option can only be included in a BACK/LAY command if OFFSET is also included.  It determines whether to use a green stake for offset and stop loss bets, instead of a level stake.  This green option should not be confused with the standalone GREEN command, which is used entirely on its own as a separate command.
  • Whether the offset bet will be applied to partial matches is currently controlled by the Partial checkbox in the Offset settings within the Tools section in the main Cymatic window (and is read and applied at the time when each partial match occurs).
  • LAPSE/KEEP/TAKE-SP are used to determine what happens to the bet when the market turns in-play.  The default is LAPSE, if no persistence type is specified.
  • If the order is successful, PLACED will appear in the Status column and OK in the Report column.
  • If the bet is matched instantly in the moment that it arrives at the exchange, then the Matched Odds and Amount Matched columns will show those results. However, if the bet is matched later, the details will only be reflected in the bet summary columns (the ones to the left of the commands), not in the Matched Odds and Amount Matched columns to the right of the commands (these will remain empty).

Here are some examples of various valid BACK/LAY commands:

  • BACK
  • LAY
  • BACK Fillorkill5
  • BACK Offset1 Stoploss5 PlaceAt2 Fillorkill10
  • lay Offset1
  • lay Offset1 Green
  • LAY OFFSET1 FILLORKILL10

Here is an example of a command and a full explanation below:

  • BACK Offset1 Stoploss5 Green PlaceAt2 Fillorkill10

The command above means: Send a BACK bet at the price specified in the Odds column and with the stake specified in the Stake column.  If the bet is not matched after 10 seconds then cancel it (FillOrKill10).  If the back bet is matched, then send a LAY bet 1 price increment lower (OFFSET1), using a green stake.  If the LAY bet is not matched, do a stop loss (LAY) five ticks higher than the back bet, but actually place the stop loss 7 ticks higher (5 + 2) to try to ensure that it is matched.  A green stake is used for both the offset and stop loss bets.

CANCEL

  • If the BetID cell contains a bet ID, just that one bet will be cancelled.
  • If the BetID cell is empty, then all bets on this selection/runner will be cancelled.
  • If the order is successful, CANCELLED will appear in the Status column and OK in the Report column.

CANCEL ALL

  • Cancels all bets on the entire market (all selections).
  • Insert this command against any one of the selections and it will cancel all bets on every selection.  There is no need to insert this command on more than one row.
  • If the order is successful, CANCELLED will appear in the Status column and OK in the Report column.

UPDATE

UPDATE LAPSE/KEEP/TAKE-SP

  • This command is only used to change the persistence type of the bet.  It does not affect size or price of the bet.
  • The BetID cell must contain the ID of the bet to be updated.
  • If the order is successful, UPDATED will appear in the Status column and OK in the Report column.

REPLACE

  • This command is used when you want to change the price of an unmatched bet.  The exchange processes it by cancelling the bet and re-issuing it at the new price (thus it gets a new betID).
  • The BetID cell must contain the ID of the bet you want to replace.
  • The ODDS cell must contain the new price that you want.
  • If the order is successful, REPLACED will appear in the Status column and OK in the Report column.

GREEN

  • Greens up (or reds-up) the position on one selection.
  • Any existing unmatched bets are not cancelled by this command.
  • If the order is successful, GREENED will appear in the Status column and OK in the Report column.

GREEN ALL

  • Greens up (or reds-up) the entire market (all selections).
  • Insert this command against any one of the selections and it will green up every selection.  There is no need to insert this command on more than one row.
  • Any existing unmatched bets are not cancelled by this command.
  • If the order is successful, GREENED will appear in the Status column and OK in the Report column.

Not got Microsoft Excel yet? It's included in Microsoft Office.  Get Microsoft Office now.