# Charting: add-fieldset codes

The following tables contain codes and syntax referenced by options in the [`add-fieldset`](transformer-cache-and-validate-intraday-data.md#add-fieldset) configuration item.

## recordtype option

Values accepted by the `recordtype` option of `add-fieldset`:

|  | fund | cash | futures | cash option | futures option | market stats | market indices | time series | link record | large page | small mntr pg | small non-mntr | spread data |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| **Treasury Debt** | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
| **Sovereign Debt** | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
| **Mortgage Backed Debt** | 64 | 65 | 66 | 67 | 69 | 60 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
| **Corporation Debt** | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |
| **Equity Linked** | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 |
| **Equity** | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 |
| **Energy** | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 |
| **Commodities - Soft** | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 |
| **Commodities - Base Metals** | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 |
| **Commodities - Precious Metals** | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 |
| **Commodities - Grain/seeds** | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 |
| **Forex** | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
| **Money Markets** | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 257 | 248 | 249 | 250 | 251 | 252 |

## add-field option

Values accepted by the Flags parameter of the `add-field` option of `add-fieldset`.

| Flag | Meaning |
| --- | --- |
| = | Cache last value in period |
| &lt;&lt; | Cache first value in period |
| > | Cache highest value in period |
| &lt; | Cache lowest value in period |
| >% | Cache highest integer |
| &lt;% | Cache lowest integer |
| +% | Cache rolling integer addition |
| + | Cache rolling floating addition |

## rules option

This section lists the operators and operands accepted by the `rules` option of `add-fieldset`. The rules option is used to validate a pricing update for caching, providing you with control over the values that the Charting Service caches.

The `rules` configuration option takes a [Reverse Polish notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation) (RPN) expression. If the RPN expression returns zero, then the update is cached. If the RPN expression returns a value other than zero, then the update is rejected.

**📌 NOTE**\
You can also validate updates using JavaScript or Lua. For a side-by-side comparison of the same validation rules implemented in RPN and Lua, see [Charting: add-fieldset examples](transformer-charting-blade-examples-add-fieldset.md#validation).

### RPN operators

Operators accepted by the `rules` configuration option are listed in the table below:

| Operator | Description | Notes |
| --- | --- | --- |
| + - / * | Standard operators | Operates on two operands. |
| = | Equals | Operates on two operands. |
| ! | Not equal | Operates on two operands. |
| { | Less than or equal to | Operates on two operands. |
| } | Greater than or equal to | Operates on two operands. |
| &lt; | Less than | Operates on two operands. |
| > | Greater than | Operates on two operands. |
| & | And | Operates on two operands. |
| | | Or | Operates on two operands. |
| ~ | Absolute value | Operates on a single operand. |

### RPN operands

Operands accepted by the rules configuration option are listed in the table below:

| Operand | Description |
| --- | --- |
| $_fieldname_ | The current value of the field _fieldname_. |
| @_fieldname_ | The previous valid value of the field _fieldname._ |

### RPN examples

In the example RPN expression below, when the field TRDPRICE_1 is zero, the expression evaluates to a non-zero value and the fieldset is not cached:

```
rules   $TRDPRC_1 0 =
```

In the example RPN expression below, when the value of the field TRDPRICE_1 differs from the four-period moving average by 40% or more, the expression evaluates to a non-zero value and the fieldset is not cached:

```
rules   $TRDPRC_1 $TRDPRC_2 $TRDPRC_3 $TRDPRC_4 $TRDPRC_5 + + + 4 / / 1 - ~ 0.4 }
```
