Advertisement
ImDerekD

Rippingmyhairout_01_03

Jan 2nd, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.19 KB | None | 0 0
  1. #!/usr/bin/bash python
  2.  
  3. import csv
  4. import datetime
  5. from datetime import datetime
  6. from colorama import Back, Fore, Style
  7. from colorama import init
  8. import numbers
  9. import time
  10. import itertools
  11. from itertools import zip_longest
  12. from time import sleep
  13. with open('/Users/King/Spy_Current.csv', 'r') as csv_file:
  14. csv_reader = csv.reader(csv_file)
  15. header = next(csv_reader)
  16.  
  17.  
  18. ref = [] # Start off w/ empty list
  19. ref_Num = int(0) # First to go in list = ref # (390 cells in 1 day)(using ref+=1 for each row)
  20. data = [] # Not sure but I could rearrange for liquidity?
  21. Liquidity = float()
  22. found = int(0)
  23. Range = []
  24. Target = []
  25. filled = bool
  26. filled_Price = float()
  27. Range_List = {}
  28. Low_Range_Found = {}
  29. High_Range_Found = {}
  30. ht_filled = bool
  31. hr_filled = bool
  32. lr_filled = bool
  33. lt_filled = bool
  34. lows_found = int()
  35. highs_found = int()
  36. Range_Found = {}
  37. range_ref_String = ('')
  38. dTime = []
  39. printRanges = str()
  40. range_identifier_low = 'Low'
  41. range_identifier_high = 'High'
  42. range_identifier_all = 'All'
  43. All_Range_References = []
  44. All_Referenced_Prices = []
  45. menu_ans = input('What would you like to do? \n [1] Print Liquidity Data | [2] See previous ranges | [3] Test | [4] Show Changes By Date\n')
  46. if menu_ans == '1':
  47. Liquidity_Data = input('Would you like to print liquidity data? [y/n]: ')
  48. if menu_ans == '2':
  49. printRanges = input('Which ranges would you like to see?: [High/Low/All]\n')
  50. range_identifier = ''
  51. new_range = bool
  52. t = bool
  53. tLow = bool
  54. tHigh = bool
  55. Target = float()
  56. Range_Dict = {}
  57. TickString = str()
  58. Tick_String = ''
  59. Strength = int()
  60. StartTraceback = {}
  61. day_Count = int()
  62. tList = []
  63. last = float()
  64. LT = float()
  65. HT = float()
  66. last = float()
  67. TrendStrength = ''
  68. Previous = []
  69. allfoundallfilled = {}
  70. lowfilled = float()
  71. highfilled = float()
  72. rangefilled = bool
  73. low_Ranges_Filled = int()
  74. high_Ranges_Filled = int()
  75. high_Targets_Filled = int()
  76. low_Targets_Filled = int()
  77. Vol1 = int()
  78. Vol2 = int()
  79. VolList = []
  80. MFlow1 = float()
  81. MFlow2 = float()
  82. MFlowList = [MFlow1, MFlow2]
  83. VolList = [Vol1, Vol2]
  84.  
  85.  
  86. for row in csv_reader:
  87. # row = [Time, Open, Close, High, Low, realVol, Money_Flow]
  88. ref_Num += 1 # Starting at 0
  89. dTime = str(datetime.strptime(row[0], '%a %b %d %H:%M'))
  90. Time = dTime[-14:]
  91. Open_Price = float(row[1]) # Price Data Dictionary
  92. Close_Price = float(row[2]) # Price Data Dictionary
  93. High_Price = float(row[3]) # Price Data Dictionary
  94. Low_Price = float(row[4]) # Price Data Dictionary
  95. Money_Flow = float(row[6]) # Price Data Dictionary
  96. Vol = row[5] # Price Data Dictionary
  97. f_Vol = float(Vol[:-1]) # Price Data Dictionary
  98. m_Vol = str(Vol[-1:]) # Price Data Dictionary
  99. if m_Vol == "K": # Price Data Dictionary
  100. f_Vol = f_Vol * 1000 # Price Data Dictionary
  101. if m_Vol == "M": # Price Data Dictionary
  102. f_Vol = f_Vol * 1000000
  103. if m_Vol != "K" and m_Vol != "M":
  104. f_Vol = float(row[5]) # Price Data Dictionary
  105. if f_Vol < 1:
  106. M_Price = HLCC
  107. else:
  108. M_Price = round(float(Money_Flow) / f_Vol, 2)
  109. HLCC = float(High_Price + Low_Price + Close_Price + Close_Price)/4 # Price Data Dictionary & RangeReference Dictionary # Price Data Dictionary & RangeReference Dictionary
  110. Diff = round(HLCC - M_Price, 2) # Price Data Dictionary & RangeReference Dictionary & Data Dictionary
  111. MMM = float(f_Vol * HLCC) # Price Data Dictionary & RangeReference Dictionary & Data Dictionary
  112. Liq_change = float(Money_Flow - MMM) # Price Data Dictionary & RangeReference Dictionary & Data Dictionary
  113. Liquidity += Liq_change # Price Data Dictionary & RangeReference Dictionary & Data Dictionary
  114. Date = str(Time[:5]) # Important
  115. military_time = str(Time[-8:])
  116. criteria = abs(.003*HLCC)
  117. Liq_Tick = int()
  118. Price_Tick = int()
  119.  
  120. allData = [ref_Num,Date, military_time, High_Price,Low_Price,Close_Price, HLCC, M_Price, f_Vol, Money_Flow,MMM, Liquidity,Liq_change]
  121. Data_Dict = {'REF#':[ref_Num],'Date':[Date],'Time':[military_time], 'Close_Price':[Close_Price], 'M_Price':[M_Price], 'Volume':[f_Vol]}
  122. '''USING THIS DATA
  123. [0]REFERENCE NUMBER
  124. [1]DATE
  125. [2]MILITARY_TIME
  126. [3]HIGH_PRICE
  127. [4]LOW_PRICE
  128. [5]CLOSE_PRICE
  129. [6]HLCC
  130. [7]M_Price
  131. [8]F_VOL
  132. [9]MONEY_FLOW
  133. [10]MARKETMAKERMOVE 'MMM'
  134. [11]LIQUIDITY
  135. [12]LIQ_CHANGE
  136. '''
  137. if abs(allData[7]-allData[6]) >= criteria:
  138. found +=1
  139. diff = abs(M_Price - Close_Price)
  140. Range_Clause = True
  141. range_identifier_all = 'All'
  142. if Range_Clause == True:
  143. t_price = M_Price
  144. found_Price = HLCC
  145. Low_Range = round(HLCC - abs(float(M_Price - HLCC)), 2)
  146. High_Range = round(HLCC + abs(float(M_Price - HLCC)), 2)
  147. Low_Target = round(Low_Range - abs(float(M_Price - HLCC)), 2)
  148. High_Target = round(High_Range + abs(float(M_Price - HLCC)), 2)
  149. if M_Price >= found_Price+diff:
  150. range_ref_String = "HIGH TARGET"
  151. tHigh = True
  152. Target = M_Price
  153. range_identifier = 'High'
  154. found_Price = HLCC
  155. range_identifier_all = 'All'
  156. thList = ['HIGH TARGET', High_Target, highfilled]
  157. filled = False
  158. ht_filled = False
  159. hr_filled = False
  160. highs_found += 1
  161. elif M_Price<= found_Price-diff:
  162. range_ref_String = "LOW TARGET"
  163. tLow = True
  164. Target = M_Price
  165. range_identifier = 'Low'
  166. range_identifier_all = 'All'
  167. found_Price = HLCC
  168. tlList = ['LOW TARGET', Low_Target, lowfilled]
  169. filled = False
  170. lt_filled = False
  171. lr_filled = False
  172. lows_found += 1
  173. RT_Reference1 = [Low_Range, High_Range, Low_Target, High_Target]
  174. LRS = '$'+str(Low_Range)
  175. LRT = '$'+str(Low_Target)
  176. HRS = '$'+str(High_Range)
  177. HRT = '$'+str(High_Target)
  178. found_Price_String = '$'+str(found_Price)
  179. RT_Reference = [LRS, LRT, HRS, HRT]
  180. Target_String = '$'+str(Target)
  181. lows = [LRS, LRT]
  182. highs = [HRS, HRT]
  183. range_ref_String = range_ref_String
  184. target_String = range_ref_String+': $'
  185. end_String = 'Price while found: $'+str(Close_Price)
  186.  
  187. if printRanges == range_identifier and range_identifier == range_identifier_low:
  188. Low_Range_Reference = [Date, military_time, range_ref_String, Target_String, end_String]
  189. Low_Range_Found = {'\nData Found':Low_Range_Reference, 'Watch for: $':lows, 'Potential Resistance: ':highs}
  190. Low_Range = Low_Range_Found
  191. for k, v in dict.items(Low_Range):
  192. print(Fore.RED, k, v)
  193.  
  194. if printRanges == range_identifier and range_identifier == range_identifier_high:
  195. High_Range_Reference = [Date, military_time, range_ref_String, end_String]
  196. High_Range_Found = {'\nData Found': High_Range_Reference, 'Watch for: $':highs, 'Potential Support: ':lows}
  197. High_Range = High_Range_Found
  198. for k, v in dict.items(High_Range):
  199. print(Fore.CYAN, k, v)
  200.  
  201. elif printRanges == range_identifier_all and range_identifier_all == range_identifier_all:
  202. Range_Reference = [Date, military_time, Close_Price, range_ref_String, Target_String]
  203. Low_Ranges = [LRS, LRT]
  204. High_Ranges = [HRS, HRT]
  205. Range_Found = {'<-- Reference':Range_Reference, 'Low Ranges':Low_Ranges, 'High Ranges':High_Ranges}
  206. Range_List[ref_Num] = Range_Found
  207. print(Back.BLUE+Fore.WHITE+str(found), str(Range_Found)+Style.RESET_ALL)
  208. '''if Range_Clause == True:
  209. if range_ref_String == "HIGH TARGET" and Money_Flow < 300000000:
  210. print("MARKET MAKER HIGH TARGET")
  211. if range_ref_String == "LOW TARGET" and Money_Flow > 300000000:
  212. print("MARKET MAKER LOW TARGET")'''
  213.  
  214. else:
  215. Range_Clause = False
  216. tHigh = False
  217. tLow = False
  218.  
  219. if menu_ans == '1' and Liquidity_Data =='y':
  220. MFlow1 = Money_Flow
  221. MFlow2 = MFlowList[:-1]
  222. Vol1 = f_Vol
  223. Vol2 = VolList[:-1]
  224. MIV_Index = 100*(Vol1/Vol2)-100*(MFlow1/MFlow2)
  225. print('MIV_Index: ', MIV_Index, '%')
  226. if Close_Price > Open_Price and Liq_change > 0:
  227. Price_Tick = 1
  228. Liq_Tick = 1
  229. elif Close_Price >= Open_Price and Liq_change < 0:
  230. Price_Tick = 0
  231. Liq_Tick = -1
  232. elif Close_Price <= Open_Price and Liq_change > 0:
  233. Price_Tick = 0
  234. Liq_Tick = -1
  235. elif Close_Price >= Open_Price and Liq_change < 0:
  236. Price_Tick = -1
  237. Liq_Tick = -1
  238. Tick = Liq_Tick + Price_Tick
  239. Strength += Tick
  240.  
  241. if Tick == 2:
  242. Tick_String = Fore.BLUE+Back.GREEN+'STRONG BUYERS'+Style.RESET_ALL+' '+Fore.GREEN+str(Strength)
  243. if Tick == -1 and Price_Tick == 0:
  244. Tick_String = Fore.WHITE+'PRICE UP LIQ DOWN'+Style.RESET_ALL+' '+Fore.RED+str(Strength)
  245. if Tick == -2:
  246. Tick_String = Fore.RED+Back.YELLOW+'STRONG SELLERS BUYERS'+Style.RESET_ALL+' '+Fore.WHITE+str(Strength)
  247. if Tick == -1 and Liq_Tick == 0:
  248. Tick_String = Fore.RED+'SHORT COVERING'+Style.RESET_ALL+' '+Fore.YELLOW+Back.BLUE+str(Strength)
  249. Range_List[ref_Num] = Range_Found
  250.  
  251. if lr_filled == False:
  252. if filled == False:
  253. if range_ref_String == "LOW TARGET" and Low_Price <= Low_Range:
  254. filled_Price = Low_Price
  255. time.sleep(.5)
  256. print(Fore.WHITE + Back.RED + "LOW RANGE FILLED" + Style.RESET_ALL)
  257. time.sleep(1)
  258. lr_filled = True
  259. lt_filled = False
  260. lrf = 1
  261. low_Ranges_Filled += lrf
  262. if lt_filled == False and lr_filled == True:
  263. if Close_Price <= Low_Target:
  264. filled_target_price = Close_Price
  265. time.sleep(.5)
  266. print(Fore.RED + Back.YELLOW + 'LOW TARGET FILLED' + Style.RESET_ALL)
  267. time.sleep(1)
  268. lt_filled = True
  269. filled = True
  270. low_Targets_Filled += 1
  271. if hr_filled == False:
  272. if filled == False:
  273. if range_ref_String == "HIGH TARGET" and High_Price >= High_Range:
  274. filled_range_price = High_Price
  275. time.sleep(.5)
  276. print(Fore.CYAN + "HIGH RANGE FILLED" + Style.RESET_ALL)
  277. time.sleep(1)
  278. hr_filled = True
  279. ht_filled = False
  280. hrf = 1
  281. high_Ranges_Filled += hrf
  282. if ht_filled == False and hr_filled == True:
  283. if Close_Price >= High_Target:
  284. filled_target_price = High_Price
  285. print(Fore.CYAN + "HIGH TARGET FILLED")
  286. time.sleep(1)
  287. ht_filled = True
  288. filled = True
  289. high_Targets_Filled += 1
  290. if Range_Clause == True:
  291. if range_ref_String == "HIGH TARGET" and Money_Flow < 300000000:
  292. if Liq_change > 1000000:
  293. print("MARKET MAKER HIGH TARGET")
  294. if range_ref_String == "LOW TARGET" and Money_Flow > 300000000:
  295. if Liq_change < 1000000:
  296. print("MARKET MAKER LOW TARGET")
  297.  
  298. Close_Price = Close_Price
  299. if tHigh == True:
  300. t = True
  301. HRS = str(High_Range)
  302. HRT = str(High_Target)
  303. LRS = str(Low_Range)
  304. LRT = str(Low_Target)
  305. print(Fore.YELLOW+'['+Date+']',military_time,Style.RESET_ALL+Fore.BLUE+Back.YELLOW+Style.BRIGHT+'Current Liquidity:'+'{:20,.2f}'.format(Liquidity)+Style.RESET_ALL+Fore.BLUE+Back.YELLOW+Style.BRIGHT+' Liq Change: '+'{:20,.2f}'.format(Liq_change)+Style.RESET_ALL, Fore.YELLOW+Back.BLUE+Style.BRIGHT,'Last Price: [$'+str(Close_Price)+'] '+Style.RESET_ALL+Tick_String+Style.RESET_ALL+Fore.GREEN+Back.BLUE+Style.BRIGHT+' NEW HIGH RANGE FOUND:[$'+HRS+']'+' NEW HIGH TARGET FOUND: [$'+HRT+']'+Style.RESET_ALL)
  306. time.sleep(2)
  307. add_Range_Target = input('Would you like to add this range to file?: [y/n]:')
  308. if add_Range_Target == 'y':
  309. with open('/Users/King/Desktop/RangeTargets.csv', 'a') as csv_file:
  310. file_PriceList = [Date, military_time, range_ref_String, Close_Price, M_Price, HRT, Money_Flow, f_Vol, LRS, LRT, Liquidity, Liq_change]
  311. wr = csv.writer(csv_file)
  312. wr.writerow(file_PriceList)
  313. else:
  314. t = False
  315. Close_Price = Close_Price
  316. if tLow == True:
  317. t = True
  318. HRS = str(High_Range)
  319. HRT = str(High_Target)
  320. LRS = str(Low_Range)
  321. LRT = str(Low_Target)
  322. Low_Prices = {'LOW RANGE: $': Low_Range, 'LOW TARGET: $': Low_Target} ##### May not need this line
  323. print(Fore.YELLOW+'['+Date+']',military_time,Style.RESET_ALL+Fore.CYAN+Back.RED+Style.BRIGHT+'Current Liquidity:'+'{:20,.2f}'.format(Liquidity)+Style.RESET_ALL+Fore.CYAN+Back.RED+Style.BRIGHT+' Liq Change: '+'{:20,.2f}'.format(Liq_change)+Style.RESET_ALL, Fore.YELLOW+Back.BLUE+Style.BRIGHT,'Last Price: [$'+str(Close_Price)+'] '+Style.RESET_ALL+Tick_String+Style.RESET_ALL+Fore.CYAN+Back.RED+Style.BRIGHT+' NEW LOW RANGE FOUND:[$'+LRS+']'+' NEW LOW TARGET FOUND: [$'+LRT+']'+Style.RESET_ALL)
  324. time.sleep(2)
  325. add_Range_Target = input('Would you like to add this range to file?: [y/n]:')
  326. if add_Range_Target == 'y':
  327. with open('/Users/King/Desktop/RangeTargets.csv', 'a') as csv_file:
  328. file_PriceList = [Date, military_time, range_ref_String, Close_Price, M_Price, LRT, Money_Flow, f_Vol, HRS, HRT, Liquidity, Liq_change]
  329. wr = csv.writer(csv_file)
  330. wr.writerow(file_PriceList)
  331. elif Liq_change < -1000000:
  332. print(Fore.YELLOW + '[' + Date + ']', military_time,
  333. Style.RESET_ALL + Fore.CYAN + Back.RED + Style.BRIGHT + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity) + Style.RESET_ALL + Fore.YELLOW + Back.RED + Style.BRIGHT + ' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + Style.RESET_ALL, Fore.YELLOW + Back.RED + Style.BRIGHT,'Last Price: [$' + str(Close_Price) + '] ' + Style.RESET_ALL + Tick_String + Style.RESET_ALL + Fore.YELLOW + Back.RED + Style.BRIGHT + '**SELL SIGNAL**' + Style.RESET_ALL)
  334. time.sleep(1)
  335. else:
  336. t = False
  337. if abs(Liq_change) > 500000:
  338. time.sleep(.005)
  339. print(Fore.CYAN + '[' + Date + ']', military_time,Fore.CYAN + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity) + Style.RESET_ALL + Fore.YELLOW + Back.BLUE + Style.BRIGHT + ' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + ' ' + Fore.YELLOW + Back.BLUE,'Last Price [$' + str(Close_Price) + '] ' + Tick_String + Style.RESET_ALL)
  340. elif Liquidity > 0:
  341. if Liq_change > 0:
  342. time.sleep(.005)
  343. print(Fore.YELLOW + '[' + Date + ']', military_time,
  344. Fore.GREEN + 'Current Liquidity:' + '{:20,.2f}'.format(
  345. Liquidity) + Fore.GREEN + ' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + ' ' + Fore.YELLOW + Back.BLUE,'Last Price [$' + str(Close_Price) + '] ' + Tick_String + Style.RESET_ALL)
  346. if Liq_change < 0:
  347. time.sleep(.005)
  348. print(Fore.YELLOW + '[' + Date + ']', military_time,
  349. Fore.GREEN + 'Current Liquidity:' + '{:20,.2f}'.format(
  350. Liquidity) + Style.RESET_ALL + Fore.RED + ' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + Style.RESET_ALL + ' ' + Fore.YELLOW + Back.BLUE,'Last Price [$' + str(Close_Price) + '] ' + Tick_String + Style.RESET_ALL)
  351. elif Liq_change > 0:
  352. time.sleep(.005)
  353. print(Fore.YELLOW + '[' + Date + ']', military_time,Fore.BLUE + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity) + Style.RESET_ALL + Fore.WHITE,' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + ' ' + Fore.YELLOW + Back.BLUE,'Last Price [$' + str(Close_Price) + '] ' + Tick_String + Style.RESET_ALL)
  354. elif Liq_change < 0:
  355. time.sleep(.005)
  356. print(Fore.YELLOW + '[' + Date + ']', military_time,Fore.BLUE + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity) + Style.RESET_ALL + Fore.CYAN,' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + ' ' + Fore.YELLOW + Back.BLUE+'Last Price [$' + str(Close_Price) + '] ' + Tick_String + Style.RESET_ALL)
  357. '''if menu_ans == '1' and Liquidity_Data == 'list':
  358. print(Fore.CYAN + 'REF#:', ref_Num)
  359. time.sleep(.05)
  360. print(Fore.WHITE + Time)
  361. time.sleep(.05)
  362. print("Last:", "$" + str(Close_Price))
  363. time.sleep(.05)
  364. print("HLCC:", "$" + str(HLCC))
  365. time.sleep(.05)
  366. print("Money Price: ", "$" + str(round(M_Price, 2)))
  367. time.sleep(.05)
  368. print('Price Diff: ' + '$' + str(Diff))
  369. time.sleep(.05)
  370. if f_Vol > 1000000:
  371. print(Fore.YELLOW + 'Volume:' + '{:20,.2f}'.format(f_Vol))
  372. else:
  373. print(Fore.WHITE + 'Volume:' + '{:20,.2f}'.format(f_Vol))
  374. time.sleep(.05)
  375. if Money_Flow > 350000000:
  376. print(Fore.YELLOW + '$Flow:' + '{:20,.2f}'.format(Money_Flow))
  377. else:
  378. print(Fore.WHITE + '$Flow:' + '{:20,.2f}'.format(Money_Flow))
  379. time.sleep(.05)
  380. if Liq_change < 0:
  381. print(Fore.RED + 'Liq Change:', '{:20,.2f}'.format(Liq_change), Style.RESET_ALL)
  382. else:
  383. print(Fore.CYAN + 'Liq Change:', '{:20,.2f}'.format(Liq_change))
  384. time.sleep(.05)
  385. if Liquidity < 0:
  386. print(Fore.RED + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity), Style.RESET_ALL)
  387. else:
  388. print(Fore.CYAN + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity), Style.RESET_ALL)
  389. time.sleep(.1)'''
  390.  
  391. if menu_ans == '3':
  392. Days = ref_Num // 390
  393. Hours = float(ref_Num / 60)
  394. HoursLeft = float(ref_Num / 390 - Days) / 60
  395. Minutes = ref_Num
  396. MinutesLeft = HoursLeft * 100
  397. print('Total Minutes recorded: ',ref_Num)
  398. print('Total Days recorded ', Days,'Days', str(round(HoursLeft, 2)), 'Hours', str(round(MinutesLeft, 2)), 'Minutes')
  399. testans = input('Would you like to see other found ranges?: [y/n]')
  400. if testans == 'y':
  401. with open('/Users/King/Desktop/RangeTargets.csv', 'r') as csv_file:
  402. csv_reader = csv.reader(csv_file)
  403. for row in csv_reader:
  404. Date = row[0]
  405. Time = row[1]
  406. range_ref_String = row[2]
  407. Close_Price = float(row[3])
  408. M_Price = float(row[4])
  409. TargetPrice = row[5]
  410. Money_Flow = float(row[6])
  411. f_Vol = float(row[7])
  412. OppRange = row[8]
  413. OppTarget = row[9]
  414. list = [Date, Time, range_ref_String]
  415. Targets = [M_Price, TargetPrice]
  416. oppositePrices = [OppRange, OppTarget]
  417. listlist = [TargetPrice, OppRange, OppTarget]
  418. dict = {'Info':list, 'Targets: ':Targets, 'Found price: ':Close_Price, 'Opposite Ranges/Targets':oppositePrices}
  419. print(dict)
  420. if menu_ans == '4':
  421. print('Low Targets Found: ', lows_found)
  422. shortAccuracy = low_Ranges_Filled / lows_found
  423. print('Low Targets Met: ', low_Ranges_Filled, '[Accuracy: ', shortAccuracy, '%')
  424. print('High Targets Found: ', highs_found)
  425. longAccuracy = high_Ranges_Filled / highs_found
  426. print('Long Targets Met: ', high_Ranges_Filled, '[Accuracy: ', longAccuracy, '%')
  427.  
  428. print(Fore.CYAN + 'REF#:', ref_Num)
  429. time.sleep(.25)
  430. print(Fore.WHITE + Time)
  431. time.sleep(.25)
  432. print("Last:", "$" + str(Close_Price))
  433. time.sleep(.25)
  434. print("HLCC:", "$" + str(HLCC))
  435. time.sleep(.25)
  436. print("Money Price: ", "$" + str(round(M_Price, 2)))
  437. time.sleep(.25)
  438. print('Price Diff: ' + '$' + str(Diff))
  439. time.sleep(.25)
  440. if f_Vol > 1000000:
  441. print(Fore.YELLOW + 'Volume:' + '{:20,.2f}'.format(f_Vol))
  442. else:
  443. print(Fore.WHITE + 'Volume:' + '{:20,.2f}'.format(f_Vol))
  444. time.sleep(.25)
  445. if Money_Flow > 350000000:
  446. print(Fore.YELLOW + '$Flow:' + '{:20,.2f}'.format(Money_Flow))
  447. else:
  448. print(Fore.WHITE + '$Flow:' + '{:20,.2f}'.format(Money_Flow))
  449. time.sleep(.25)
  450. if Liq_change < 0:
  451. print(Fore.RED + 'Liq Change:', '{:20,.2f}'.format(Liq_change), Style.RESET_ALL)
  452. else:
  453. print(Fore.CYAN + 'Liq Change:', '{:20,.2f}'.format(Liq_change))
  454. time.sleep(.25)
  455. if Liquidity < 0:
  456. print(Fore.RED + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity), Style.RESET_ALL)
  457. else:
  458. print(Fore.CYAN + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity), Style.RESET_ALL)
  459. time.sleep(.25)
  460. percent_Strength = round(Strength / ref_Num, 4)
  461. if percent_Strength >= -.68:
  462. percent_Strength_String = Fore.WHITE+'Current Strength: '+str(percent_Strength)+'%'
  463. else:
  464. percent_Strength_String = Fore.RED+'Current Strength: '+str(percent_Strength)+'%'
  465. new_Strength = 100-(100*(Strength/ref_Num-(-.286)/(Strength/ref_Num-(-.9333))))
  466. if new_Strength > .70:
  467. new_Strength_String = Fore.CYAN+'Bullishness Percentile: '+str(round(new_Strength, 2))+'%'+Style.RESET_ALL
  468. else:
  469. new_Strength_String = Fore.RED+'Bullishness Percentile: '+str(round(new_Strength, 2))+'%'+Style.RESET_ALL
  470. print(percent_Strength_String)
  471. print(new_Strength_String)
  472. high_range_Accuracy = high_Ranges_Filled / highs_found
  473. print('\nHigh Ranges/Targets Found|Filled: ',highs_found, '| ', high_Ranges_Filled, str(high_Ranges_Filled/highs_found),'%')
  474. print(found)
  475.  
  476. '''if found >0:
  477. tList = tList
  478. if tList[1] == 'High':
  479. print(Fore.GREEN+'LAST RANGE FOUND: [$' + str(Low_Range)+']','[$' + str(High_Range)+']', ' [' + range_ref_String + ': $' + str(Target)+']'+Style.RESET_ALL)
  480. print(Fore.GREEN+'POTENTIAL TARGETS: [$' + str(Low_Target)+']', '[$' + str(High_Target)+']'+Style.RESET_ALL)
  481. print(Fore.GREEN+'Found price: [$' + found_price + ']', 'Target implies a move of [' + implied_move + '%]'+'from current price ['+str(Close_Price)+']'+Style.RESET_ALL)
  482. else:
  483. tList = tList
  484. if tList[1] == 'Low':
  485. print(Fore.RED+'LAST RANGE FOUND: [$' + str(Low_Range)+']','$' + str(High_Range) + ' [' + range_ref_String + ': $' + str(Target)+Style.RESET_ALL)
  486. print(Fore.RED+'POTENTIAL TARGETS: [$' + str(Low_Target)+']', '$' + str(High_Target)+Style.RESET_ALL)
  487. print(Fore.RED+'Found price: [$' + (found_price) + ']', 'Target implies a move of [' + implied_move + '%]' + 'from current price [' + str(Close_Price) + ']'+Style.RESET_ALL)'''
  488.  
  489. '''input = input('Would you like to see other found ranges?: [y/n]')
  490. if input == 'y':
  491. with open('/Users/King/Desktop/RangeTargets.csv' 'r') as csv_file:
  492. csv_reader = csv.reader(csv_file)
  493. for row in csv_file:
  494. row[0] = Date
  495. row[1] = Time
  496. row[2] = range_ref_String
  497. row[3] = Close_Price
  498. row[4] = M_Price
  499. row[5] = TargetPrice
  500. print('\nLow Ranges/Targets Found|Filled: ', lows_found, '| ', low_Ranges_Filled, str(round(low_range_Accuracy, 2)), '%')
  501. low_range_Accuracy = low_Ranges_Filled / lows_found
  502.  
  503. row[6] = Money_Flow
  504. row[7] = f_Vol
  505. row[8] = OppRange
  506. row[9] = OppTarget'''
  507.  
  508. '''if abs(Liq_change) > 500000:
  509. time.sleep(.005)
  510. print(Fore.CYAN+'['+Date+']',military_time,Fore.CYAN+'Current Liquidity:'+'{:20,.2f}'.format(Liquidity)+Style.RESET_ALL+Fore.YELLOW+Back.BLUE+Style.BRIGHT+' Liq Change: '+'{:20,.2f}'.format(Liq_change)+' '+Fore.YELLOW+Back.BLUE, 'Last Price [$'+str(Close_Price)+'] '+Tick_String+Style.RESET_ALL)
  511. else if Liquidity > 0:
  512. if Liq_change > 0:
  513. time.sleep(.005)
  514. print(Fore.YELLOW+'['+Date+']', military_time,Fore.GREEN+'Current Liquidity:'+'{:20,.2f}'.format(Liquidity)+Fore.GREEN+' Liq Change: ' + '{:20,.2f}'.format(Liq_change)+' '+Fore.YELLOW+Back.BLUE, 'Last Price [$'+str(Close_Price)+'] '+Tick_String+Style.RESET_ALL)
  515. if Liq_change < 0:
  516. time.sleep(.005)
  517. print(Fore.YELLOW+'['+Date+']', military_time,Fore.GREEN+'Current Liquidity:'+'{:20,.2f}'.format(Liquidity)+Style.RESET_ALL+Fore.RED+' Liq Change: '+'{:20,.2f}'.format(Liq_change)+Style.RESET_ALL+' '+Fore.YELLOW+Back.BLUE, 'Last Price [$'+str(Close_Price)+'] '+Tick_String+Style.RESET_ALL)
  518. else if Liq_change > 0:
  519. time.sleep(.005)
  520. print(Fore.YELLOW+'['+Date+']', military_time,Fore.BLUE+'Current Liquidity:'+'{:20,.2f}'.format(Liquidity)+Style.RESET_ALL+Fore.CYAN,' Liq Change: '+'{:20,.2f}'.format(Liq_change)+' '+Fore.YELLOW+Back.BLUE, 'Last Price [$'+str(Close_Price)+'] '+Tick_String+Style.RESET_ALL)
  521. else if Liq_change < 0:
  522. time.sleep(.005)
  523. print(Fore.RED+'['+Date+']', military_time,Fore.BLUE+'Current Liquidity:'+'{:20,.2f}'.format(Liquidity)+Style.RESET_ALL+Fore.CYAN,' Liq Change: '+'{:20,.2f}'.format(Liq_change)+' '+Fore.YELLOW+Back.BLUE, 'Last Price [$'+str(Close_Price)+'] '+Tick_String+Style.RESET_ALL)'''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement