Skip to content

SymbolValueJsonConverter

QuantConnect.SymbolValueJsonConverter

Bases: JsonConverter

Defines a JsonConverter to be used when you only want to serialize the Symbol.value property instead of the full Symbol instance

can_convert

can_convert(object_type: Type) -> bool

Determines whether this instance can convert the specified object type.

Parameters:

Name Type Description Default
object_type Type

Type of the object.

required

Returns:

Type Description
bool

true if this instance can convert the specified object type; otherwise, false.

read_json

read_json(
    reader: Any,
    object_type: Type,
    existing_value: Any,
    serializer: Any,
) -> Object

Reads the JSON representation of the object.

Parameters:

Name Type Description Default
reader Any

The Newtonsoft.Json.JsonReader to read from.

required
object_type Type

Type of the object.

required
existing_value Any

The existing value of object being read.

required
serializer Any

The calling serializer.

required

Returns:

Type Description
Object

The object value.

write_json

write_json(
    writer: Any, value: Any, serializer: Any
) -> None

Writes the JSON representation of the object.

Parameters:

Name Type Description Default
writer Any

The Newtonsoft.Json.JsonWriter to write to.

required
value Any

The value.

required
serializer Any

The calling serializer.

required