MCPcopy Create free account
hub / github.com/FinancialComputingUCL/LOBFrame / exit_long

Method exit_long

simulator/trading_agent.py:25–31  ·  view source on GitHub ↗
(self, price, datetime=None)

Source from the content-addressed store, hash-verified

23 self.date_time_entry_short = datetime
24
25 def exit_long(self, price, datetime=None):
26 self.trading_history.append({'Type': 'Long', 'Entry_Long': self.date_time_entry_long, 'Price_Entry_Long': self.long_price,
27 'Exit_Long': datetime, 'Price_Exit_Long': price})
28
29 self.long_inventory = 0
30 self.long_price = 0
31 self.date_time_entry_long = None
32
33 def exit_short(self, price, datetime=None):
34 self.trading_history.append({'Type': 'Short', 'Entry_Short': self.date_time_entry_short, 'Price_Entry_Short': self.short_price,

Callers 1

backtestFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected