fix close position trades
This commit is contained in:
parent
98a15d301a
commit
21a473a4c2
@ -14,8 +14,11 @@
|
|||||||
|
|
||||||
# ====== Funding ======
|
# ====== Funding ======
|
||||||
"funding_per_pair": 2000.0,
|
"funding_per_pair": 2000.0,
|
||||||
|
|
||||||
# ====== Trading Parameters ======
|
# ====== Trading Parameters ======
|
||||||
"price_column": "close",
|
# "price_column": "close",
|
||||||
|
"price_column": "vwap",
|
||||||
|
|
||||||
"execution_price": {
|
"execution_price": {
|
||||||
"column": "vwap",
|
"column": "vwap",
|
||||||
"shift": 1,
|
"shift": 1,
|
||||||
|
|||||||
@ -146,8 +146,13 @@ class RollingFit(PairsTradingFitMethod):
|
|||||||
print(f"{pair}: *** Position is NOT CLOSED. ***")
|
print(f"{pair}: *** Position is NOT CLOSED. ***")
|
||||||
# outstanding positions
|
# outstanding positions
|
||||||
if config["close_outstanding_positions"]:
|
if config["close_outstanding_positions"]:
|
||||||
|
close_position_row = pair.market_data_.iloc[-1]
|
||||||
|
close_position_row["disequilibrium"] = 0.0
|
||||||
|
close_position_row["scaled_disequilibrium"] = 0.0
|
||||||
|
close_position_row["signed_scaled_disequilibrium"] = 0.0
|
||||||
|
|
||||||
close_position_trades = self._get_close_trades(
|
close_position_trades = self._get_close_trades(
|
||||||
pair=pair, row=pred_row, close_threshold=close_threshold
|
pair=pair, row=close_position_row, close_threshold=close_threshold
|
||||||
)
|
)
|
||||||
if close_position_trades is not None:
|
if close_position_trades is not None:
|
||||||
close_position_trades["status"] = PairState.CLOSE_POSITION.name
|
close_position_trades["status"] = PairState.CLOSE_POSITION.name
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user