1313
1414#include " tigerapi/easylogging++.h"
1515
16- INITIALIZE_EASYLOGGINGPP
16+ // INITIALIZE_EASYLOGGINGPP
1717
1818using namespace std ;
1919using namespace web ;
@@ -442,22 +442,22 @@ class TestTigerApi {
442442};
443443
444444void position_changed_callback (const tigeropen::push::pb::PositionData& data) {
445- ucout << " Position changed:" << std::endl;
446- ucout << " - symbol: " << data.symbol () << std::endl;
447- ucout << " - positionqty: " << data.positionqty () << std::endl;
448- ucout << " - salableqty: " << data.salableqty () << std::endl;
449- ucout << " - marketvalue: " << data.marketvalue () << std::endl;
450- ucout << " - averagecost: " << data.averagecost () << std::endl;
445+ ucout << " Position changed:" << std::endl;
446+ ucout << " - symbol: " << utility::conversions::to_string_t ( data.symbol () ) << std::endl;
447+ ucout << " - positionqty: " << data.positionqty () << std::endl;
448+ ucout << " - salableqty: " << data.salableqty () << std::endl;
449+ ucout << " - marketvalue: " << data.marketvalue () << std::endl;
450+ ucout << " - averagecost: " << data.averagecost () << std::endl;
451451}
452452
453453void order_changed_callback (const tigeropen::push::pb::OrderStatusData& data) {
454- ucout << " Order changed:" << std::endl;
455- ucout << " - id: " << data.id () << std::endl;
454+ ucout << " Order changed:" << std::endl;
455+ ucout << " - id: " << data.id () << std::endl;
456456}
457457
458458void asset_changed_callback (const tigeropen::push::pb::AssetData& data) {
459- ucout << " Asset changed:" << std::endl;
460- ucout << " - cashbalance: " << data.cashbalance () << std::endl;
459+ ucout << " Asset changed:" << std::endl;
460+ ucout << " - cashbalance: " << data.cashbalance () << std::endl;
461461}
462462
463463int main ()
@@ -476,9 +476,9 @@ int main()
476476
477477
478478 auto push_client = IPushClient::create_push_client (config);
479- // push_client->set_position_changed_callback(std::function<void(const tigeropen::push::pb::PositionData&)>(position_changed_callback));
480- // push_client->set_order_changed_callback(std::function<void(const tigeropen::push::pb::OrderStatusData&)>(order_changed_callback));
481- // push_client->set_asset_changed_callback(std::function<void(const tigeropen::push::pb::AssetData&)>(asset_changed_callback));
479+ push_client->set_position_changed_callback (std::function<void (const tigeropen::push::pb::PositionData&)>(position_changed_callback));
480+ push_client->set_order_changed_callback (std::function<void (const tigeropen::push::pb::OrderStatusData&)>(order_changed_callback));
481+ push_client->set_asset_changed_callback (std::function<void (const tigeropen::push::pb::AssetData&)>(asset_changed_callback));
482482
483483 push_client->subscribe_position (" " );
484484 push_client->subscribe_order (" " );
0 commit comments