mirror of
https://github.com/Death916/emailtrade.git
synced 2026-04-10 03:04:40 -07:00
testing csv
This commit is contained in:
parent
e1878b561f
commit
0e36312346
2 changed files with 33 additions and 0 deletions
|
|
@ -1,7 +1,36 @@
|
|||
|
||||
from ast import arg
|
||||
from inspect import ArgSpec
|
||||
from sqlite3 import Date
|
||||
from symbol import arglist
|
||||
import time
|
||||
import csv
|
||||
import pandas
|
||||
|
||||
|
||||
TIME = "1200"
|
||||
EXCHANGE = "kraken"
|
||||
PRICE = "1800"
|
||||
PROFIT = "30"
|
||||
DATE = "10-10-14"
|
||||
TYPE = "buy"
|
||||
PAIR = "BTCUSD"
|
||||
|
||||
|
||||
def tradehist(msg):
|
||||
log = open("tradehist.txt", 'a')
|
||||
log.write('\n' + time.ctime() + ' ' + msg)
|
||||
log.close()
|
||||
|
||||
|
||||
def tradecsv(DATE, *args):
|
||||
with open('/home/death/code/python/emailtrade/emailtrade/bottrades.csv','w', newline= '') as csvfile:
|
||||
|
||||
args = {Date: DATE, 'Time': TIME, }
|
||||
tradewriter = csv.DictWriter(csvfile, fieldnames="Date, Time, Exchange, Price, Profit,Type, Pair")
|
||||
for i in args:
|
||||
tradewriter.writerow({i})
|
||||
tradewriter.writerows({'Date': DATE})
|
||||
csvfile.close
|
||||
|
||||
tradecsv([DATE],[TIME],[EXCHANGE],[PRICE],[PROFIT], [TYPE], [PAIR])
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ API_KEY = keys["public"]
|
|||
PRIV_KEY = keys["priv"]
|
||||
TICKER= "ETHUSD"
|
||||
API = krakenex.API(API_KEY, PRIV_KEY)
|
||||
TIME = ""
|
||||
EXCHANGE = "kraken"
|
||||
PRICE = ""
|
||||
PROFIT = ""
|
||||
#BUY_CURRENCY = input().capitalize()
|
||||
|
||||
kraken = KrakenAPI(API)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue