adamhyman / dinar-trader

0 stars 3 forks source link

Write prices to text file #10

Open adamhyman opened 7 years ago

adamhyman commented 7 years ago

Write the prices to a text file, including the time.

bustoutfunk commented 7 years ago

I'm thinking I will write a function that will print to the console (i.e. print function) and write to a file at the same time.

Additionally, I'll make the output file CSV format so we can import into Excel easily and analyze. Over time we can explore playing around with the Google Doc API and just pushing all data to a Google Doc Spreadsheet.

I'll make this a high priority item.

bustoutfunk commented 7 years ago

@adamhyman can you please tell me exactly what columns you'd like to be printed out in the CSV?

bustoutfunk commented 7 years ago

@adamhyman, currently we are capturing the bid and asking prices + the transaction fee. Do you want to just capture the bid/ask price in the CSV? If you want the transaction fee embedded in it (which it is now) then I should probably rename bid/ask to "bid + trans" and "ask + trans"

bustoutfunk commented 6 years ago

@adamhyman, still waiting on your input...

adamhyman commented 6 years ago

We don't need the transaction fee. Just the bid and ask is perfect.

adamhyman commented 6 years ago

What do you think about something like this?

They would be 3 different CSVs.

Account Balances

Time Requested          Time Delivered          Exchange        Currency        Qty
7/19/2017 4:00:13 pm    7/19/2017 4:00:16 pm    Kraken          ETH             8
7/19/2017 4:00:13 pm    7/19/2017 4:00:16 pm    Kraken          BTC             1.05
7/19/2017 4:00:13 pm    7/19/2017 4:00:16 pm    Kraken          USD             2304.5
7/19/2017 4:00:17 pm    7/19/2017 4:00:19 pm    Gemini          ETH             8
7/19/2017 4:00:19 pm    7/19/2017 4:00:21 pm    Gemini          BTC             1.05
7/19/2017 4:00:21 pm    7/19/2017 4:00:22 pm    Gemini          USD             2304.5

Market Data

Time Requested          Time Delivered          Exchange        Market        Price
7/19/2017 4:00:13 pm    7/19/2017 4:00:16 pm    Kraken          BTC-LTC       .004
7/19/2017 4:00:13 pm    7/19/2017 4:00:16 pm    Kraken          BTC-USD       1500
7/19/2017 4:00:13 pm    7/19/2017 4:00:16 pm    Kraken          ETH-USD       250

Transactions

Time Requested          Time Delivered          Exchange        Transaction       Currency      Qty
7/19/2017 4:00:13 pm    7/19/2017 4:00:16 pm    Kraken          Buy               ETH           .203
7/19/2017 4:00:16 pm    7/19/2017 4:00:18 pm    Gemini          Sell              ETH           .203
bustoutfunk commented 6 years ago

Sounds good. How do you propose we get the time requested and delivered?

adamhyman commented 6 years ago

When we do something like kraken.update_balances(), it would do:

TimeRequested = time.now()
balances = self.getbalances()
TimeReceived = time.now()
balances_array = json.loads(balances)
for each mycurrency in self.currencies:
    for each item in balances_array:
          if item[1] = mycurrency.ticker():
                 mycurrency.balance(item[1][balance])
                 logging.balances(TimeRequested, TimeReceived, mycurrency.ticker(), mycurrency.balance())