Update generator.py

This commit is contained in:
MoonGem 2018-03-26 23:57:58 -05:00 committed by GitHub
parent 8296ac646d
commit 0a42d5c58b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ ppservers = ()
#ppservers = ("10.0.0.1",) #ppservers = ("10.0.0.1",)
# Number of jobs to run # Number of jobs to run
parts = 1280000 parts = 32
@ -41,7 +41,7 @@ if len(sys.argv) > 1:
job_server = pp.Server(ncpus, ppservers=ppservers) job_server = pp.Server(ncpus, ppservers=ppservers)
else: else:
# Creates jobserver with automatically detected number of workers # Creates jobserver with automatically detected number of workers
job_server = pp.Server(ppservers=ppservers) job_server = pp.Server(32, ppservers=ppservers)
print("Starting pp with", job_server.get_ncpus(), "workers") print("Starting pp with", job_server.get_ncpus(), "workers")
@ -55,37 +55,36 @@ while True:
for job in jobs: for job in jobs:
try: try:
res = job() res = job()
if res is not None: string = str(res)
string = str(res) params = re.search(r'~~~~(.*)~~~~', string).group(1)
params = re.search(r'~~~~(.*)~~~~', string).group(1) mfi = re.search(r'MFI Value(.*)XXX', string)
mfi = re.search(r'MFI Value(.*)XXX', string) fastd = re.search(r'FASTD Value(.*)XXX', string)
fastd = re.search(r'FASTD Value(.*)XXX', string) adx = re.search(r'ADX Value(.*)XXX', string)
adx = re.search(r'ADX Value(.*)XXX', string) rsi = re.search(r'RSI Value(.*)XXX', string)
rsi = re.search(r'RSI Value(.*)XXX', string) tot = re.search(r'TOTAL (.*)\\n', string).group(1)
tot = re.search(r'TOTAL (.*)', string).group(1) total = float(tot)
total = float(tot) if total and (float(total) > float(current)):
if total and (float(total) > float(current)): current = total
current = total print('total better profit paremeters: ')
print('total better profit paremeters: ') print(format(total, '.8f'))
print(total) if params:
if params: print(params)
print(params) print('~~~~~~')
print('~~~~~~') print('Only enable the above settings, not all settings below are used!')
print('Only enable the above settings, not all settings below are used!') print('~~~~~~')
print('~~~~~~') if mfi:
if mfi: print('~~~MFI~~~')
print('~~~MFI~~~') print(mfi.group(1))
print(mfi.group(1)) if fastd:
if fastd: print('~~~FASTD~~~')
print('~~~FASTD~~~') print(fastd.group(1))
print(fastd.group(1)) if adx:
if adx: print('~~~ADX~~~')
print('~~~ADX~~~') print(adx.group(1))
print(adx.group(1)) if rsi:
if rsi: print('~~~RSI~~~')
print('~~~RSI~~~') print(rsi.group(1))
print(rsi.group(1)) print("Time elapsed: ", time.time() - start_time, "s")
print("Time elapsed: ", time.time() - start_time, "s") job_server.print_stats()
job_server.print_stats()
except: except:
pass pass