How to use the ctpwrapper.ApiStructure.ExchangeRateField function in ctpwrapper

To help you get started, we’ve selected a few ctpwrapper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nooperpudd / ctpwrapper / tests / test_structure.py View on Github external
def test_struct_missing_parameter(self):
        result = {
            "BrokerID": "45544",
            "FromCurrencyID": "",
            "FromCurrencyUnit": 0.0,
            "ToCurrencyID": "4334",
            "ExchangeRate": 11.0
        }

        field = ApiStructure.ExchangeRateField(
            BrokerID="45544",
            ToCurrencyID="4334",
            ExchangeRate=11.0
        )
        result_dict = field.to_dict()
        self.assertDictEqual(result_dict, result)
github nooperpudd / ctpwrapper / tests / test_structure.py View on Github external
def test_to_dict(self):
        result = {
            "BrokerID": "45544",
            "FromCurrencyID": "4343",
            "FromCurrencyUnit": 19.0,
            "ToCurrencyID": "4334",
            "ExchangeRate": 11.0
        }
        field = ApiStructure.ExchangeRateField(
            BrokerID="45544",
            FromCurrencyID="4343",
            FromCurrencyUnit=19.0,
            ToCurrencyID="4334",
            ExchangeRate=11.0
        )
        result_dict = field.to_dict()
        self.assertDictEqual(result, result_dict)