SimulatedTrading.py
def record_into_file(self, btc_price):
        """Record account status into file."""
        # total bitcoin value according to current price
        btc_value = btc_price * self.__current_amount
        # total asset value according to current price
        total_value = btc_value + self.__current_cash
        # set items to record
        record = [datetime.now().strftime("%Y-%m-%d,%H:%M:%S"),\
                 str(total_value), str(self.__current_cash), str(btc_value),\
                 str(self.__current_amount)]
        
        # open file and write record
        with open(TRADE_HISTORY_FILE, "a") as trade_histoty:
            trade_histoty.write(" ".join(record) + "\n")

        print("\nSuccessfully record Total Assert Value ${:,.2f}, "
              "Available Cash ${:,.2f}, BitCoin Value ${:,.2f} "
              "and Bitcoin Amount {:,.2f}."
              .format(total_value, self.__current_cash, \
                      btc_value, self.__current_amount))
Record account status into file.
Record account status into file.
Record account status into file .
def record_into_file(self, btc_price):
        btc_value = btc_price * self.__current_amount
        total_value = btc_value + self.__current_cash
        record = [datetime.now().strftime("%Y-%m-%d,%H:%M:%S"),\
                 str(total_value), str(self.__current_cash), str(btc_value),\
                 str(self.__current_amount)]
        with open(TRADE_HISTORY_FILE, "a") as trade_histoty:
            trade_histoty.write(" ".join(record) + "\n")
        print("\nSuccessfully record Total Assert Value ${:,.2f}, "
              "Available Cash ${:,.2f}, BitCoin Value ${:,.2f} "
              "and Bitcoin Amount {:,.2f}."
              .format(total_value, self.__current_cash, \
                      btc_value, self.__current_amount))
def record_into_file ( self , btc_price ) : btc_value = btc_price * self . __current_amount total_value = btc_value + self . __current_cash record = [ datetime . now ( ) . strftime ( "%Y-%m-%d,%H:%M:%S" ) , str ( total_value ) , str ( self . __current_cash ) , str ( btc_value ) , str ( self . __current_amount ) ] with open ( TRADE_HISTORY_FILE , "a" ) as trade_histoty : trade_histoty . write ( " " . join ( record ) + "\n" ) print ( "\nSuccessfully record Total Assert Value ${:,.2f}, " "Available Cash ${:,.2f}, BitCoin Value ${:,.2f} " "and Bitcoin Amount {:,.2f}." . format ( total_value , self . __current_cash , btc_value , self . __current_amount ) )
Record account status into file.
Record account status into file .
"""Record account status into file.""" # total bitcoin value according to current price
 # total asset value according to current price
 # set items to record
 # open file and write record

self
btc_price