Charting Blade Examples (add-fieldset)

The following code illustrates how add-fieldset entries are used to define each field used in different types of record (in this case equity cash instruments, statistics and indices). See here for all recordtype and parameter values.

Equity (Building block)/ Cash (Instrument type)

# Equity cash instrument
add-fieldset
    recordtype 113
    # last price fields
    add-field                   OPEN_PRC              10       <<          TRDPRC_1        TRDPRC_1
    add-field                   HST_CLOSE             10        =          TRDPRC_1        TRDPRC_1
    add-field                   HIGH_1                10        >          TRDPRC_1        TRDPRC_1
    add-field                   LOW_1                 10        <          TRDPRC_1        TRDPRC_1
    add-field                   TRDVOL_1              10       +%          TRDVOL_1        TRDPRC_1
    # bid price fields
    add-field                   BID_OPEN_PRC          10       <<          BID BID
    add-field                   BID_HST_CLOSE         10       =           BID BID
    add-field                   BID_HIGH_1            10       >           BID BID
    add-field                   BID_LOW_1             10       <           BID BID
    add-field                   BID_TRDVOL_1          10       +%          TRDVOL_1          BID
    # ask price fields
    add-field                   ASK_OPEN_PRC          10       <<          ASK ASK
    add-field                   ASK_HST_CLOSE         10       =           ASK ASK
    add-field                   ASK_HIGH_1            10       >           ASK ASK
    add-field                   ASK_LOW_1             10       <           ASK ASK
    add-field                   ASK_TRDVOL_1          10      +%           TRDVOL_1          ASK
    # level-1 fields
    cache-field                 PROD_PERM
    cache-field                 DSPLY_NAME

    rules                       "$TRDPRC_1 0 =" # filter 0 price updates
    rules                       "$BID 0 =" # filter 0 price updates
    rules                       "$ASK 0 =" # filter 0 price updates
    rules                       "$TRDPRC_1 $TRDPRC_2 $TRDPRC_3 $TRDPRC_4 $TRDPRC_5 + + + 4 / / 1 - ~ 0.4 }" # filter >=
                                 40% (four period moving average)
    rules                       "$BID $BID_1 $BID_2 + 2 / / 1 - ~ 0.4 }" # filter >= 40% (two period moving average)
    rules                       "$ASK $ASK_1 $ASK_2 + 2 / / 1 - ~ 0.4 }" # filter >= 40% (two period moving average)
end-fieldset

Equity (Building block)/ Market statistics (Instrument type)

# Equity/Market stats
add-fieldset
    recordtype 117
    # last price fields
    add-field                   OPEN_PRC              10       <<          TRDPRC_1        TRDPRC_1
    add-field                   HST_CLOSE             10       =           TRDPRC_1        TRDPRC_1
    add-field                   HIGH_1                10       >           TRDPRC_1        TRDPRC_1
    add-field                   LOW_1                 10       <           TRDPRC_1        TRDPRC_1
    add-field                   TRDVOL_1              10      +%           TRDVOL_1        TRDPRC_1
    # level-1 fields
    cache-field                 PROD_PERM
    cache-field                 DSPLY_NAME
    rules                       "$TRDPRC_1 0 =" # filter 0 price updates
    rules                       "$TRDPRC_1 $TRDPRC_2 $TRDPRC_3 $TRDPRC_4 $TRDPRC_5 + + + 4 / / 1 - ~ 0.4 }" # filter >=
                                 40% (four period moving average)
end-fieldset

Equity (Building block)/ Market Indices (Instrument type)

# Equity Market indices
add-fieldset
    recordtype 118
    # last price fields
    add-field                  OPEN_PRC              10      <<            TRDPRC_1       TRDPRC_1
    add-field                  HST_CLOSE             10       =            TRDPRC_1       TRDPRC_1
    add-field                  HIGH_1                10       >            TRDPRC_1       TRDPRC_1
    add-field                  LOW_1                 10       <            TRDPRC_1       TRDPRC_1
    add-field                  TRDVOL_1              10      +%            TRDVOL_1       TRDPRC_1
    # level-1 fields
    cache-field                PROD_PERM
    cache-field                DSPLY_NAME
    rules                      "$TRDPRC_1 0 =" # filter 0 price updates
    rules                      "$TRDPRC_1 $TRDPRC_2 $TRDPRC_3 $TRDPRC_4 $TRDPRC_5 + + + 4 / / 1 - ~ 0.4 }" # filter >=
                               40% (four period moving average)
end-fieldset