Notes
Notes - notes.io |
import time
smallInterval = 20 # how many seconds between each new calculation of high and low
largeInterval = 300 # each segment we take the candlestick from in secondsl
lastcandle = 'BULL'
prediction = 'BULL'
right = 0
wrong = 0
a = 0
bank = 0
active = 100
control = 100
while (1): #runs constantly
a = a + 1
request = requests.get("https://blockchain.info/ticker").json()
high = request['USD']['last']
low = request['USD']['last']
start = request['USD']['last']
end = request['USD']['last']
bob = 'NAN'
i = 0
while(i < (largeInterval / smallInterval)): # runs for 5 minutes
updating = requests.get("https://blockchain.info/ticker").json()['USD']['last']
if(high < updating):
high = updating
if(low > updating):
low = updating
end = updating
if(start >= end):
bob = 'BEAR'
uppershadow = (high-start)
lowershadow = (end-low)
percentchange = ((end-start)/start)
change = end-start
if(start < end):
bob = 'BULL'
uppershadow = (high-end)
lowershadow = (start-low)
percentchange = ((end-start)/start)
change = end-start
time.sleep(20)
i = i+1
print('######### FIVE MIN INTERVALS############')
print('index:')
print(a)
print("last five mins was a : " + bob)
active = active * (1+percentchange)
control = control * (1+percentchange)
print("one before that was a : " + lastcandle)
print('bank:')
print(bank)
print('active:')
print(active)
print('bank + active:')
print(bank+active)
print('control:')
print(control)
print('difference between my system and mkt:')
print((bank+active) - control)
print("percent change in last block was: ")
print(percentchange)
print('Last prediction right?:')
if (prediction == bob):
right = right + 1
print('yes')
if (prediction == "HODL"):
print('prediction was to hold')
if (prediction != bob and prediction != 'HODL'):
wrong = wrong + 1
print('no')
print('Next prediction is:')
if (lastcandle == "BEAR" and bob == "BULL"):
prediction = 'BULL'
active = bank
bank = 0
print('BULL... BUY BUY BUY')
if (lastcandle == "BULL" and bob == "BEAR"):
prediction = 'BEAR'
bank = active
active = 0
print('BEAR... SELL SELL SELL')
if (lastcandle == bob):
prediction = "HODL"
print("HODL IT")
lastcandle = bob
print('amt right:')
print(right)
print('amt wrong:')
print(wrong)
print('percentage right:')
print(((right)/(right+wrong))*100)
print('#########################################')
print("end")
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team