Advertisement
ImDerekD

Jan2nd

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