Symbols (Instrument) Management
New symbols cannot be added to the system via the API. This must be done via the trading platform itself and TradrAPI will automatically pick up the new symbols.
Existing symbols however can be updated via the API
Updating A Symbol
In the example below we will update the configured symbol with the id of 45030 to change the security type to 'Forex (alt)'
const result: boolean = await tradrApi.admin.symbol.update(45030, {
security: 'Forex (alt)',
});
The following fields can be updated based on the UpdateSymbolDto
interface:
interface UpdateSymbolDto {
/** The name of the symbol, e.g. ETHUSD */
name?: string;
/** The id of the spread group the symbol belongs to */
spreadGroupId?: number;
/** The spread to apply on buy actions */
spreadBuy?: number;
/** The spread to apply on sell actions */
spreadSell?: number;
/** The security the symbol belongs to */
security?: string;
/** The contract size of the symbol */
contractSize?: number;
}