-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
48 lines (37 loc) · 1.19 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import time
import datetime
import random
from bs4 import BeautifulSoup
import pandas as pd
from coinigy import *
import Cryptoping, HandlerThread, BittrexThread, PoloniexThread
import ConfigParser
import thread
config = ConfigParser.ConfigParser()
config.read("config.ini")
firstRun = True
lastpair = ""
currpair = ""
cryptoping = Cryptoping.Cryptoping()
while True:
currency, exchange = cryptoping.refreshAndGetData()
if firstRun:
lastpair=currency+exchange
firstRun = False
# currpair - z.B. BTXBittrex
currpair=currency+exchange
if(lastpair!=currpair):
legitExchange = False
# Pruefen ob Poloniex oder Bittrex Wenn ja Transaktion freigeben
if (exchange == "Poloniex"):
legitExchange = True
if (exchange == "Bittrex"):
legitExchange = True
# Transaktion freigegeben
if legitExchange:
if (exchange == "Bittrex"):
thread.start_new(BittrexThread.BittrexThread, (currency,))
if (exchange == "Poloniex"):
thread.start_new(PoloniexThread.PoloniexThread, (currency,))
lastpair = currpair
time.sleep(random.randint(1,3))