Skip to content

Commit 2ae997b

Browse files
committed
v1.7.5: adding a get_unrealized_pl and a new overload of get_close_price
1 parent 21e9e7b commit 2ae997b

File tree

10 files changed

+24
-9
lines changed

10 files changed

+24
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ get_filename_component(PROJECT_DIR_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
88
string(REPLACE " " "_" PROJECT_DIR_NAME ${PROJECT_DIR_NAME})
99

1010
project(${PROJECT_DIR_NAME}
11-
VERSION 1.7.0 # <major>.<minor>.<patch>
11+
VERSION 1.7.5 # <major>.<minor>.<patch>
1212
LANGUAGES CXX)
1313

1414
set(LIB_NAME shift)

include/Trader.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ class Trader {
5555
.def("get_portfolio_summary", &Trader::getPortfolioSummary)
5656
.def("get_portfolio_items", &Trader::getPortfolioItems)
5757
.def("get_portfolio_item", &Trader::getPortfolioItem, py::arg("symbol"))
58+
.def("get_unrealized_pl", &Trader::getUnrealizedPL, py::arg("symbol") = "")
5859
.def("get_submitted_orders_size", &Trader::getSubmittedOrdersSize)
5960
.def("get_submitted_orders", &Trader::getSubmittedOrders)
6061
.def("get_order", &Trader::getOrder, py::arg("order_id"))
6162
.def("get_executed_orders", &Trader::getExecutedOrders, py::arg("order_id"))
6263
.def("get_waiting_list_size", &Trader::getWaitingListSize)
6364
.def("get_waiting_list", &Trader::getWaitingList)
6465
.def("cancel_all_pending_orders", &Trader::cancelAllPendingOrders)
65-
.def("get_close_price", &Trader::getClosePrice, py::arg("symbol"), py::arg("buy"), py::arg("size"))
66+
.def("get_close_price", py::overload_cast<const std::string&, bool, int>(&Trader::getClosePrice), py::arg("symbol"), py::arg("buy"), py::arg("size"))
67+
.def("get_close_price", py::overload_cast<const std::string&>(&Trader::getClosePrice), py::arg("symbol"))
6668
.def("get_last_price", &Trader::getLastPrice, py::arg("symbol"))
6769
.def("get_last_size", &Trader::getLastSize, py::arg("symbol"))
6870
.def("get_last_trade_time", &Trader::getLastTradeTime)
@@ -111,6 +113,7 @@ class Trader {
111113
shift::PortfolioSummary getPortfolioSummary();
112114
std::map<std::string, shift::PortfolioItem> getPortfolioItems();
113115
shift::PortfolioItem getPortfolioItem(const std::string& symbol);
116+
double getUnrealizedPL(const std::string& symbol);
114117
int getSubmittedOrdersSize();
115118
std::vector<shift::Order> getSubmittedOrders();
116119
shift::Order getOrder(const std::string& orderID);
@@ -121,6 +124,7 @@ class Trader {
121124

122125
// price methods
123126
double getClosePrice(const std::string& symbol, bool buy, int size);
127+
double getClosePrice(const std::string& symbol);
124128
double getLastPrice(const std::string& symbol);
125129
int getLastSize(const std::string& symbol);
126130
std::chrono::system_clock::time_point getLastTradeTime();

release/conda/quickfix/meta.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ requirements:
1717
- openssl
1818

1919
about:
20-
home: https://github.com/quickfix/quickfix
20+
home: https://github.com/hanlonlab/quickfix
21+
# home: https://github.com/quickfix/quickfix
2122
license_file: LICENSE

release/conda/shift-coreclient/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: shift-coreclient
3-
version: "1.7.0"
3+
version: "1.7.5"
44

55
source:
66
git_url: https://github.com/hanlonlab/shift-main.git

release/conda/shift-miscutils/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: shift-miscutils
3-
version: "1.7.0"
3+
version: "1.7.5"
44

55
source:
66
git_url: https://github.com/hanlonlab/shift-main.git

release/conda/shift-python/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: shift-python
3-
version: "1.7.0"
3+
version: "1.7.5"
44

55
source:
66
git_url: https://github.com/hanlonlab/shift-python.git

release/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN conda install black
1919
RUN pip install keras==2.2.5 tensorflow==1.14.0
2020

2121
# Install shift-python
22-
RUN wget -qO- https://github.com/hanlonlab/shift-python/releases/download/v1.7.0/shift_python-1.7.0-conda_linux.zip | bsdtar -xvf- && \
22+
RUN wget -qO- https://github.com/hanlonlab/shift-python/releases/download/v1.7.5/shift_python-1.7.5-conda_linux.zip | bsdtar -xvf- && \
2323
cd shift* && \
2424
conda install *.tar.bz2
2525

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def run(self):
9696

9797
setup(
9898
name="shift",
99-
version="1.7.0",
99+
version="1.7.5",
100100
author="SHIFT",
101101
author_email="",
102102
description="Stevens High Frequency Trading (SHIFT) Simulation System Python Client",

src/SHIFT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
PYBIND11_MODULE(shift, m)
1313
{
1414
m.doc() = "SHIFT-Python API";
15-
m.attr("__version__") = "1.7.0";
15+
m.attr("__version__") = "1.7.5";
1616

1717
py::register_exception<shift::IncorrectPasswordError>(m, "IncorrectPasswordError");
1818
py::register_exception<shift::ConnectionTimeoutError>(m, "ConnectionTimeoutError");

src/Trader.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ shift::PortfolioItem Trader::getPortfolioItem(const std::string& symbol)
137137
return m_client->getPortfolioItem(symbol);
138138
}
139139

140+
double Trader::getUnrealizedPL(const std::string& symbol)
141+
{
142+
return m_client->getUnrealizedPL(symbol);
143+
}
144+
140145
int Trader::getSubmittedOrdersSize()
141146
{
142147
return m_client->getSubmittedOrdersSize();
@@ -177,6 +182,11 @@ double Trader::getClosePrice(const std::string& symbol, bool buy, int size)
177182
return m_client->getClosePrice(symbol, buy, size);
178183
}
179184

185+
double Trader::getClosePrice(const std::string& symbol)
186+
{
187+
return m_client->getClosePrice(symbol);
188+
}
189+
180190
double Trader::getLastPrice(const std::string& symbol)
181191
{
182192
return m_client->getLastPrice(symbol);

0 commit comments

Comments
 (0)