Advertisement
ImDerekD

rushnsauce.py

Jun 27th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.28 KB | None | 0 0
  1. #!python3
  2.  
  3. import csv
  4. import datetime
  5. from datetime import datetime
  6. from colorama import Back, Fore, Style
  7. import sys
  8. from termcolor import colored, cprint
  9. from colorama import init
  10. import numbers
  11. import time
  12. import itertools
  13. from itertools import zip_longest
  14. from time import sleep
  15. import hashlib
  16. import statistics
  17. import shutil
  18. import os
  19.  
  20.  
  21.  
  22. MIV_Spike_List = []
  23. MIV_Spike_Count = int()
  24. MIV_Spike = float()
  25. Avg_MIV_Spike = float()
  26. ShortPrice = float()
  27. LongPrice = float()
  28. ShortVolumeTotal = float()
  29. C_Price = float()
  30. S_Price = float()
  31. CoverLiquidity = float()
  32. ShortLiquidity = float()
  33. CoverCount = int()
  34. ShortCount = int()
  35.  
  36.  
  37. log = []
  38. lastFPrice = float()
  39.  
  40. MP_List = []
  41. V_List = []
  42. count_M_items = int()
  43. count_V_items = int()
  44. V_Stdev = float()
  45. MP_Stdev = float()
  46. MV_Stdev = float()
  47. findPrice = float()
  48.  
  49.  
  50.  
  51. CoverPrice = float()
  52. CoverVolumeTotal = float()
  53. CoverMoney = float()
  54. ShortMoney = float()
  55.  
  56. TotalDiff = float()
  57.  
  58. sum_Vol = float()
  59. sum_Flow = float()
  60. avg_Flow = float(1)
  61. avg_Vol = float(1)
  62. mRatio = float()
  63. xratio = float()
  64. LFPC = float()
  65. rawdatalist = []
  66. rawdatalist1 = []
  67. rawdatalist2 = []
  68. est_price = float(1)
  69. LFP = float(1)
  70.  
  71. countitems = int()
  72. SumFlow = float()
  73. SumLiq = float()
  74. avg_Flow = float()
  75. avg_Liq_change = float()
  76. sneakR = float()
  77. support = float()
  78. resistance = float()
  79.  
  80. BES = bool
  81. bullTS = bool
  82. bearTS = bool
  83. PD = bool
  84. nTS = bool
  85.  
  86. labels = str()
  87. underline = str()
  88. with open(r"C:\Users\Kory\SpyFlow Dropbox\SpyFlow_DropBox\data.csv", "r") as csv_file:
  89. csv_reader = csv.reader(csv_file)
  90. header = next(csv_reader)
  91.  
  92.  
  93. ref = [] # Start off w/ empty list
  94. ref_Num = int(0) # First to go in list = ref # (390 cells in 1 day)(using ref+=1 for each row)
  95. data = [] # Not sure but I could rearrange for liquidity?
  96. Liquidity = float()
  97. found = int(0)
  98. Range = []
  99. Target = []
  100. filled = bool
  101. filled_Price = float()
  102. Range_List = {}
  103. Low_Range_Found = {}
  104. High_Range_Found = {}
  105. ht_filled = bool
  106. hr_filled = bool
  107. lr_filled = bool
  108. lt_filled = bool
  109. lows_found = int()
  110. highs_found = int()
  111. Tick = int()
  112. Range_Found = {}
  113. range_ref_String = ('')
  114. dTime = []
  115. printRanges = str()
  116. range_identifier_low = 'Low'
  117. range_identifier_high = 'High'
  118. range_identifier_all = 'All'
  119. All_Range_References = []
  120. All_Referenced_Prices = []
  121. menu_ans = input('What would you like to do? \n [1] Print Liquidity | [2] See previous ranges | [3] Tcopy Ranges | [4] Show Est TA/TB Prices | [5] Analyze Scenarios | [6] Data Analysis\n')
  122. if menu_ans == '1':
  123. Liquidity_Data = input('Would you like to print liquidity data? [y/n]: ')
  124. if menu_ans == '2':
  125. printRanges = input('Which ranges would you like to see?: [High/Low/All]\n')
  126. if menu_ans == '3':
  127. option3 = True
  128. range_identifier = ''
  129. new_range = bool
  130. t = bool
  131. tLow = bool
  132. tHigh = bool
  133. Target = float()
  134. Range_Dict = {}
  135. TickString = str()
  136. Tick_String = ''
  137. Strength = int()
  138. StartTraceback = {}
  139. day_Count = int()
  140. tList = []
  141. Last = float()
  142. LT = float()
  143. HT = float()
  144. ATR = float()
  145. OC_ATR = float()
  146. Avg_ATR = float()
  147. TrendStrength = ''
  148. Previous = []
  149. allfoundallfilled = {}
  150. lowfilled = float()
  151. highfilled = float()
  152. rangefilled = bool
  153. low_Ranges_Filled = int()
  154. high_Ranges_Filled = int()
  155. high_Targets_Filled = int()
  156. low_Targets_Filled = int()
  157. prevVol = float(1)
  158. prevFlow = float(1)
  159. lastFlow = float(1)
  160. lastVol = float(1)
  161. prevIndexValue = float(1)
  162. prevPrice = float(1)
  163. lastLFPC = float(1)
  164. lastsneakR = float(1)
  165. lastmRatio = float(1)
  166.  
  167. Status = str('')
  168. RangeTarget = float()
  169. rFound = bool
  170. count = int(0)
  171. PCT_Range_Str = ''
  172.  
  173. sum_OC_Range = float()
  174. sum_HL_Range = float()
  175. sum_OHLC_Range = float()
  176. WarningString = ''
  177. sum_Liq = float()
  178. avg_Liq_change = float()
  179. HighRangeFlow = float()
  180. LowRangeFlow = float()
  181. LiqFlowPrice = float()
  182. LiqFlowPriceClone = float()
  183. EntryStr = str()
  184. OC_HL_RangePct = float()
  185. StrengthReference = float()
  186. AvgStrengthReference = float()
  187. counter = int()
  188.  
  189. liqList = []
  190. PULQ = bool
  191.  
  192. BuyVolume = float()
  193. BuyPower = float()
  194. ShortVolume = float()
  195. ShortPower = float()
  196. SellVolume = float()
  197. SellPower = float()
  198. BuySellRatio = float()
  199. HL_RangePct = float()
  200.  
  201. Price1 = float()
  202. prevPrice1 = float()
  203. Last = float()
  204. gapDown = int()
  205. gapUp = int()
  206.  
  207. prevMPrice = float()
  208. prevMPrice2 = float()
  209. prevPrice1 = float()
  210. lastMPrice = float()
  211. lastHPrice = float()
  212. lastLPrice = float()
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219. for row in csv_reader:
  220. range_ref_String = ''
  221. LRS = '$'
  222. LRT = '$'
  223. HRS = '$'
  224. HRT = '$'
  225. found_Price_String = '$'
  226. end_String = 'Price while found: $'
  227. # row = [Time, Open, Close, High, Low, realVol, Money_Flow]
  228. ref_Num += 1 # Starting at 0
  229. dTime = str(datetime.strptime(row[0], '%a %b %d %H:%M'))
  230. Time = dTime[-14:]
  231. Open_Price = float(row[1]) # Price Data Dictionary
  232. Close_Price = float(row[2]) # Price Data Dictionary
  233. High_Price = float(row[3]) # Price Data Dictionary
  234. Low_Price = float(row[4]) # Price Data Dictionary
  235. Money_Flow = float(row[6]) # Price Data Dictionary
  236. Vol = row[5] # Price Data Dictionary
  237. f_Vol = float(Vol[:-1]) # Price Data Dictionary
  238. m_Vol = str(Vol[-1:]) # Price Data Dictionary
  239. if m_Vol == "K": # Price Data Dictionary
  240. f_Vol = f_Vol * 1000 # Price Data Dictionary
  241. if m_Vol == "M": # Price Data Dictionary
  242. f_Vol = f_Vol * 1000000
  243. if m_Vol != "K" and m_Vol != "M":
  244. f_Vol = float(row[5]) # Price Data Dictionary
  245. if f_Vol < 1:
  246. M_Price = HLCC
  247. else:
  248. M_Price = round(float(Money_Flow) / f_Vol, 2)
  249. HLCC = float(High_Price + Low_Price + Close_Price + Close_Price)/4 # Price Data Dictionary & RangeReference Dictionary # Price Data Dictionary & RangeReference Dictionary
  250. Diff = round(HLCC - M_Price, 2)
  251. findDiff = round(M_Price - Close_Price, 2)
  252. TotalDiff += findDiff
  253. PivotPrice = round(Close_Price + TotalDiff, 2)
  254. if PivotPrice > Close_Price + .45:
  255. PivotStr = Fore.CYAN+str(PivotPrice)+Style.RESET_ALL
  256. if PivotPrice < Close_Price - .45:
  257. PivotStr = Fore.RED+str(PivotPrice)+Style.RESET_ALL
  258.  
  259. if abs(PivotPrice - Close_Price) < .15:
  260. PivotStr = Fore.WHITE+str(PivotPrice)+Style.RESET_ALL
  261.  
  262. if abs(PivotPrice - Close_Price) > .15 and abs(PivotPrice - Close_Price) < .45:
  263. PivotStr = Fore.YELLOW+str(PivotPrice)+Style.RESET_ALL # Price Data Dictionary & RangeReference Dictionary & Data Dictionary
  264.  
  265. if PivotPrice > Close_Price + .75:
  266. PivotStr = Fore.CYAN+Style.BRIGHT+str(PivotPrice)+Style.RESET_ALL
  267.  
  268. if PivotPrice < Close_Price - .75:
  269. PivotStr = Fore.RED+Style.BRIGHT+str(PivotPrice)+Style.RESET_ALL
  270. MMM = float(f_Vol * HLCC) # Price Data Dictionary & RangeReference Dictionary & Data Dictionary
  271. Liq_change = float(Money_Flow - MMM) # Price Data Dictionary & RangeReference Dictionary & Data Dictionary
  272. Liquidity += Liq_change # Price Data Dictionary & RangeReference Dictionary & Data Dictionary
  273. Date = str(Time[:5]) # Important
  274. military_time = str(Time[-8:])
  275. criteria = abs(.003*HLCC)
  276. hashTime = hashlib.md5(str.encode(military_time))
  277. Liq_Tick = int()
  278. Price_Tick = int()
  279. tREF = int()
  280. rFound = False
  281.  
  282. OC_Range = abs(Close_Price - Open_Price)
  283. HL_Range = abs(High_Price - Low_Price)
  284. sum_OC_Range += OC_Range
  285. sum_HL_Range += HL_Range
  286.  
  287. sum_Liq += abs(Liq_change)
  288. liqList.append(sum_Liq)
  289. avg_HL_Range = float()
  290. avg_OC_Range = float()
  291. abs_Liq = abs(Liq_change)
  292. prevLiq = float()
  293. MP_List.append(Money_Flow)
  294. V_List.append(f_Vol)
  295. mticksymbol = ''
  296. ticksymbolc = ''
  297. ticksymbolo = ''
  298.  
  299.  
  300.  
  301. for i in MP_List:
  302. count_M_items += 1
  303.  
  304. for i in V_List:
  305. count_V_items += 1
  306.  
  307. if count_M_items >= 2:
  308. MP_Stdev = statistics.stdev(MP_List[-2:])
  309. MP_List.pop(0)
  310.  
  311. if count_V_items >= 2:
  312. V_Stdev = statistics.stdev(V_List[-2:])
  313. V_List.pop(0)
  314.  
  315. if count_M_items >= 1 and count_M_items >= 1:
  316. if V_Stdev >= 1:
  317. MV_Stdev = 100*round(MP_Stdev / V_Stdev, 2)
  318.  
  319.  
  320. findPrice = MV_Stdev / 100
  321.  
  322. if Money_Flow > 0:
  323. MIV_Index = round(100 * (f_Vol / prevVol) - 100 * ((Money_Flow * HLCC) / (prevFlow * prevPrice)), 3)
  324. runningValueIndex = round(MIV_Index + prevIndexValue, 3)
  325. prevPrice = Close_Price
  326. prevFlow = Money_Flow
  327. prevVol = f_Vol
  328. prevIndexValue = MIV_Index
  329. MIV_Index_String = str(MIV_Index)
  330. runningValueIndex_String = str(runningValueIndex)
  331. MIV_Index_String = str(round(MIV_Index, 2))
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339. if ref_Num >=2:
  340. prevPrice1 = Close_Price
  341. prevMPrice = M_Price
  342. prevFPrice = findPrice
  343.  
  344.  
  345.  
  346.  
  347. if ref_Num % 2 != 0:
  348. Price1 = Close_Price
  349. prevMPrice1 = M_Price
  350. prevFPrice1 = findPrice
  351. prevVol1 = f_Vol
  352. prevFlow1 = Money_Flow
  353. HPrice1 = High_Price
  354. LPrice1 = Low_Price
  355.  
  356. if ref_Num % 2 == 0:
  357. Price2 = Close_Price
  358. prevMPrice2 = M_Price
  359. prevFPrice2 = findPrice
  360. prevVol2 = f_Vol
  361. prevFlow2 = Money_Flow
  362. HPrice2 = High_Price
  363. LPrice2 = Low_Price
  364.  
  365.  
  366. if ref_Num % 2 != 0 and ref_Num > 2:
  367. Last = Price2
  368. lastMPrice = prevMPrice2
  369. lastFPrice = prevFPrice2
  370. lastVol = prevVol2
  371. lastFlow = prevFlow2
  372. lastHPrice = HPrice2
  373. lastLPrice = LPrice2
  374.  
  375.  
  376. if ref_Num % 2 == 0 and ref_Num >= 2:
  377. Last = Price1
  378. lastMPrice = prevMPrice1
  379. lastFPrice = prevFPrice1
  380. lastVol = prevVol1
  381. lastFlow = prevFlow1
  382. lastHPrice = HPrice1
  383. lastLPrice = LPrice1
  384.  
  385. SumFlow += Money_Flow
  386. SumLiq += abs(Liq_change)
  387. sneakR = round(.0000001*(Money_Flow / (OC_Range + HL_Range)), 2)
  388.  
  389. if ref_Num >= 2:
  390. avg_Flow = round(SumFlow / ref_Num, 2)
  391. avg_Liq_change = round(SumLiq / ref_Num, 2)
  392. mRatio = round(Money_Flow / avg_Flow, 3)
  393. xratio = round(100 * abs(Liq_change) / abs(Liquidity), 3)
  394. lastLFPC = LFPC
  395. lastmRatio = mRatio
  396. lastsneakR = sneakR
  397.  
  398.  
  399.  
  400.  
  401.  
  402. percent_Strength = Strength / ref_Num
  403. allData = [ref_Num,Date, military_time, High_Price,Low_Price,Close_Price, HLCC, M_Price, f_Vol, Money_Flow,MMM, Liquidity,Liq_change]
  404. Data_Dict = {'REF#':[ref_Num],'Date':[Date],'Time':[military_time], 'Close_Price':[Close_Price], 'M_Price':[M_Price], 'Volume':[f_Vol]}
  405. '''USING THIS DATA
  406. [0]REFERENCE NUMBER
  407. [1]DATE
  408. [2]MILITARY_TIME
  409. [3]HIGH_PRICE
  410. [4]LOW_PRICE
  411. [5]CLOSE_PRICE
  412. [6]HLCC
  413. [7]M_Price
  414. [8]F_VOL
  415. [9]MONEY_FLOW
  416. [10]MARKETMAKERMOVE 'MMM'
  417. [11]LIQUIDITY
  418. [12]LIQ_CHANGE
  419. '''
  420.  
  421.  
  422.  
  423.  
  424.  
  425. if abs(allData[7]-allData[6]) >= criteria:
  426. diff = abs(M_Price - Close_Price)
  427. Range_Clause = True
  428. range_identifier_all = 'All'
  429. else:
  430. Range_Clause = False
  431. if Range_Clause == True:
  432. r_price = M_Price
  433. found_Price = HLCC
  434. Low_Range = round(HLCC - abs(float(M_Price - HLCC)), 2)
  435. High_Range = round(HLCC + abs(float(M_Price - HLCC)), 2)
  436. Low_Target = round(Low_Range - abs(float(M_Price - HLCC)), 2)
  437. High_Target = round(High_Range + abs(float(M_Price - HLCC)), 2)
  438. RT_Reference1 = [Low_Range, High_Range, Low_Target, High_Target]
  439. LRS = '$' + str(Low_Range)
  440. LRT = '$' + str(Low_Target)
  441. HRS = '$' + str(High_Range)
  442. HRT = '$' + str(High_Target)
  443. found_Price_String = '$' + str(found_Price)
  444. RT_Reference = [LRS, LRT, HRS, HRT]
  445. lows = [LRS, LRT]
  446. highs = [HRS, HRT]
  447. range_ref_String = range_ref_String
  448. target_String = range_ref_String + ': $'
  449. end_String = 'Price while found: $' + str(Close_Price)
  450. Target_String = '$' + str(Target)
  451.  
  452.  
  453.  
  454. LiqFlowPrice = .01*round(Money_Flow / abs(Liq_change), 3)
  455. VolLiqPrice = round(f_Vol / abs(Liq_change), 2)
  456. LiqFlowPriceClone = round(1000 * (abs(Liq_change) / Money_Flow), 4) * .01
  457.  
  458.  
  459. if M_Price >= High_Range:
  460. found += 1
  461. range_ref_String = "HIGH TARGET"
  462. tHigh = True
  463. RangeTarget = High_Target
  464. Target = M_Price
  465. range_identifier = 'High'
  466. found_Price = HLCC
  467. range_identifier_all = 'All'
  468. thList = ['HIGH TARGET', High_Target, highfilled]
  469. filled = False
  470. ht_filled = False
  471. hr_filled = False
  472. highs_found += 1
  473. rFound = True
  474. HighRangeFlow += Money_Flow
  475. elif M_Price<= Low_Range:
  476. found += 1
  477. range_ref_String = "LOW TARGET"
  478. tLow = True
  479. RangeTarget = Low_Target
  480. Target = M_Price
  481. range_identifier = 'Low'
  482. range_identifier_all = 'All'
  483. found_Price = HLCC
  484. tlList = ['LOW TARGET', Low_Target, lowfilled]
  485. filled = False
  486. lt_filled = False
  487. lr_filled = False
  488. lows_found += 1
  489. rFound = True
  490. LowRangeFlow += Money_Flow
  491.  
  492. if lows_found > 0:
  493. AvgLowRangeFlow = LowRangeFlow / lows_found
  494. if highs_found > 0:
  495. AvgHighRangeFlow = HighRangeFlow / highs_found
  496.  
  497.  
  498. if printRanges == range_identifier and range_identifier == range_identifier_low:
  499. Low_Range_Reference = [Date, military_time, range_ref_String, Target_String, end_String]
  500. Low_Range_Found = {'\nData Found':Low_Range_Reference, 'Watch for: $':lows, 'Potential Resistance: ':highs}
  501. Low_Range = Low_Range_Found
  502. for k, v in dict.items(Low_Range):
  503. print(Fore.RED, k, v)
  504.  
  505. if printRanges == range_identifier and range_identifier == range_identifier_high:
  506. High_Range_Reference = [Date, military_time, range_ref_String, end_String]
  507. High_Range_Found = {'\nData Found': High_Range_Reference, 'Watch for: $':highs, 'Potential Support: ':lows}
  508. High_Range = High_Range_Found
  509. for k, v in dict.items(High_Range):
  510. print(Fore.CYAN, k, v)
  511.  
  512. elif printRanges == range_identifier_all:
  513. if range_ref_String == 'LOW TARGET' or range_ref_String == 'HIGH TARGET':
  514. money_string = '$'
  515. Target_String = '$' + str(Target)
  516. Close_Price_String = money_string+str(Close_Price)
  517. Range_Reference = [Date, military_time, Close_Price_String, range_ref_String, Target_String]
  518. Low_Ranges = [LRS, LRT]
  519. High_Ranges = [HRS, HRT]
  520. Range_Found = {'<-- Reference':Range_Reference, 'Low Ranges':Low_Ranges, 'High Ranges':High_Ranges, 'REF#':ref_Num}
  521. Range_List[ref_Num] = Range_Found
  522. text = colored(str(found)+' '+str(Range_Found), 'cyan', 'on_grey', attrs=['reverse'])
  523. cprint(text)
  524.  
  525.  
  526. # '''if Range_Clause == True:
  527. # if range_ref_String == "HIGH TARGET" and Money_Flow < 300000000:
  528. # print("MARKET MAKER HIGH TARGET")
  529. # if range_ref_String == "LOW TARGET" and Money_Flow > 300000000:
  530. # print("MARKET MAKER LOW TARGET")'''
  531.  
  532. else:
  533. Range_Clause = False
  534. tHigh = False
  535. tLow = False
  536. rFound = False
  537.  
  538.  
  539.  
  540.  
  541. if menu_ans == '1' and Liquidity_Data == 'y':
  542.  
  543. sum_Vol += f_Vol
  544. sum_Flow += Money_Flow
  545.  
  546.  
  547. avg_HL_Range = sum_HL_Range / ref_Num
  548. avg_OC_Range = sum_OC_Range / ref_Num
  549. avg_Liq_change = sum_Liq / ref_Num
  550.  
  551. if Close_Price > Open_Price:
  552. ticksymbolo = Fore.GREEN+Style.BRIGHT+'ˆ'+Style.RESET_ALL
  553. if Close_Price < Open_Price:
  554. ticksymbolo = Fore.RED+Style.BRIGHT+'ˇ'+Style.RESET_ALL
  555.  
  556.  
  557. if (M_Price + lastMPrice) / 2 < (Last + Close_Price) / 2 - (.1 * avg_OC_Range):
  558. if lastMPrice >= lastLPrice and lastMPrice <= lastHPrice:
  559. ticksymbolc = Fore.GREEN+Style.BRIGHT+'ˆ '+Style.RESET_ALL
  560. elif lastMPrice >= lastHPrice and lastMPrice <= lastHPrice + avg_OC_Range:
  561. ticksymbolc = Fore.YELLOW+Style.BRIGHT+'∞ '+Style.RESET_ALL
  562.  
  563.  
  564.  
  565.  
  566. if (M_Price + lastMPrice) / 2 > (Last + Close_Price) / 2 + (.1 * avg_OC_Range):
  567. if lastMPrice >= lastLPrice and lastMPrice <= lastHPrice:
  568. ticksymbolc = Fore.RED+Style.BRIGHT+'ˇ '+Style.RESET_ALL
  569.  
  570. elif lastMPrice <= lastLPrice and lastMPrice >= lastLPrice - avg_OC_Range:
  571. ticksymbolc = Fore.YELLOW+Style.BRIGHT+'• '+Style.RESET_ALL
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587. if Money_Flow > 0:
  588. MIV_Index = round(100 * (f_Vol / prevVol) - 100 * ((Money_Flow * HLCC) / (prevFlow * prevPrice)), 3)
  589. runningValueIndex = round(MIV_Index + prevIndexValue, 3)
  590. prevPrice = Close_Price
  591. prevFlow = Money_Flow
  592. prevVol = f_Vol
  593. prevIndexValue = MIV_Index
  594. MIV_Index_String = str(MIV_Index)
  595. runningValueIndex_String = str(runningValueIndex)
  596. MIV_Index_String = str(round(MIV_Index, 2))
  597.  
  598. if abs(MIV_Index) >= .25 and ref_Num > 1:
  599. MIV_Spike += abs(MIV_Index)
  600. MIV_Spike_Count += 1
  601. MIV_Spike_List.append(abs(MIV_Index))
  602. Avg_MIV_Spike = round(MIV_Spike / MIV_Spike_Count, 3)
  603. if abs(MIV_Index) >= .25 and ref_Num > 1:
  604. Avg_MIV_Spike_String = str(Avg_MIV_Spike)
  605. if MIV_Index > 0:
  606. MIV_Index_String = str(round(MIV_Index, 2))
  607. print(Fore.BLACK+Back.RED+Style.BRIGHT+'MIV_Index: '+Style.RESET_ALL+Fore.BLACK+Back.RED+'[+'+MIV_Index_String+'%]'+Style.RESET_ALL+Fore.BLACK+Back.RED+Style.BRIGHT+'Avg Spike: '+Style.RESET_ALL+Fore.BLACK+Back.RED+'[+',Avg_MIV_Spike,'%]'+Style.RESET_ALL+Fore.WHITE+'Volume:'+'{:,.2f}'.format(f_Vol)+Style.RESET_ALL)
  608.  
  609. elif MIV_Index < 0:
  610. MIV_Index_String = str(round(MIV_Index, 2))
  611. print(Fore.BLACK+Back.CYAN+Style.BRIGHT+'MIV_Index: '+Style.RESET_ALL+Fore.BLACK+Back.CYAN+'['+MIV_Index_String+'%]'+Style.RESET_ALL+Fore.BLACK+Back.CYAN+Style.BRIGHT+'Avg Spike: '+Style.RESET_ALL+Fore.BLACK+Back.CYAN+'[',Avg_MIV_Spike,'%]'+Style.RESET_ALL+Fore.WHITE+'Volume:'+'{:,.2f}'.format(f_Vol)+Style.RESET_ALL)
  612.  
  613.  
  614.  
  615.  
  616. if abs(Liq_change) > 0:
  617. LFP = round(Money_Flow / abs(Liq_change) *.01, 3)
  618. LFPC = round(1000 * (abs(Liq_change) / Money_Flow) * .01, 4)
  619.  
  620. if LFP < 13 and LFPC < .085:
  621. LFP_WarningStr = 'FKN SELL THIS SHIT SON %s' % LFP
  622. LFP_WarningStr_clr = colored(LFP_WarningStr, 'red', attrs=['bold','blink'])
  623. # print(LFP_WarningStr_clr)
  624.  
  625. if LFP < 20 and LFP > 13:
  626. LFP_WarningStr = 'FKN BUY THIS SHIT SON %s' % LFP
  627. LFP_WarningStr_clr = colored(LFP_WarningStr, 'cyan', attrs=['bold','blink'])
  628. # print(LFP_WarningStr_clr)
  629.  
  630.  
  631. # if Money_Flow > 0 and lastFlow > 0:
  632. # if f_Vol > 0 and lastVol > 0:
  633. # M_index = round(100*(Money_Flow / lastFlow), 3)
  634. # V_index = round(100*(f_Vol / lastVol), 3)
  635. # new_MIV = round(M_index - V_index, 3)
  636. # avg_Vol = sum_Vol / ref_Num
  637.  
  638. #
  639. # if new_MIV >= .15 and OC_Range < avg_HL_Range:
  640. # WarningString = Fore.CYAN+'BULLISH MV'
  641. # print(WarningString)
  642. #
  643. # if new_MIV <= -.15 and OC_Range < avg_HL_Range:
  644. # WarningString = Fore.RED+'BEARISH MV'
  645. # print(WarningString)
  646.  
  647.  
  648.  
  649.  
  650.  
  651. if Close_Price >= Open_Price and Liq_change > 0:
  652. Price_Tick = 1
  653. Liq_Tick = 1
  654. BuyVolume += f_Vol
  655. BuyPower += Liq_change
  656. SellPower += Liq_change * -1
  657.  
  658. if Liquidity < 0:
  659. ShortPower += Liq_change*-1
  660.  
  661. PULQ = False
  662. elif Close_Price >= Open_Price and Liq_change < 0:
  663. Price_Tick = 0
  664. Liq_Tick = -1
  665. ShortVolume += f_Vol
  666. BuyVolume += Liq_change * -1
  667. ShortPower += Liq_change * -1
  668. ShortVolumeTotal += f_Vol
  669. ShortMoney += Money_Flow
  670. ShortCount += 1
  671. ShortLiquidity += abs(Liq_change)
  672. S_Price += HLCC
  673.  
  674. PULQ = True
  675. elif Close_Price <= Open_Price and Liq_change > 0:
  676. Price_Tick = -1
  677. Liq_Tick = 0
  678. ShortPower += Liq_change
  679. BuyPower += Liq_change
  680. SellPower += Liq_change
  681. CoverVolumeTotal += f_Vol
  682. CoverMoney += Money_Flow
  683. CoverCount += 1
  684. CoverLiquidity += Liq_change
  685. C_Price += HLCC
  686.  
  687.  
  688. PULQ = False
  689. elif Close_Price <= Open_Price and Liq_change < 0:
  690. Price_Tick = -1
  691. Liq_Tick = -1
  692. SellVolume += f_Vol
  693. SellPower += abs(Liq_change)
  694. BuyPower += Liq_change
  695.  
  696.  
  697.  
  698. PULQ = False
  699. Tick = Liq_Tick + Price_Tick
  700. Strength += Tick
  701. percent_Strength = round(Strength / ref_Num, 4)
  702. new_Strength = round(100-(100*abs(percent_Strength- -.3153) / .8794), 2)
  703. SS = str(new_Strength)
  704. abs_Liq = abs(Liq_change)
  705. counter += 1
  706.  
  707.  
  708. if ShortCount >= 1:
  709. ShortPrice = round(S_Price / ShortCount, 2)
  710.  
  711. if CoverCount >= 1:
  712. CoverPrice = round(C_Price / CoverCount, 2)
  713.  
  714.  
  715. if ref_Num < 10:
  716. AvgStrengthReference += new_Strength
  717. if ref_Num == 20:
  718. AvgStrengthReference = StrengthReference / ref_Num
  719. StrengthReference = AvgStrengthReference
  720. counter = 1
  721. if ref_Num >= 20:
  722. counter += 1
  723. AvgStrengthReference = AvgStrengthReference + new_Strength
  724.  
  725. if counter < 20 and counter >= 1:
  726. AvgStrengthReference = AvgStrengthReference / counter
  727. StrengthReference = (AvgStrengthReference + new_Strength) / counter
  728.  
  729. if counter == 20:
  730. counter = counter * 0
  731. AvgStrengthReference = AvgStrengthReference * 0 + StrengthReference
  732. StrengthReference = StrengthReference
  733.  
  734.  
  735. if M_Price > lastMPrice:
  736. mticksymbol = Fore.GREEN+'∆'
  737.  
  738. if M_Price < lastMPrice:
  739. mticksymbol = Fore.RED+'◊'
  740.  
  741.  
  742.  
  743.  
  744.  
  745. if M_Price == lastMPrice:
  746. WarningString = '!!!'
  747. mticksymbol = Fore.YELLOW+'≈'
  748. else:
  749. WarningString = ''
  750. if OC_Range >= avg_HL_Range:
  751. if Liq_change > avg_Liq_change:
  752. if Close_Price > Open_Price:
  753. WarningString = Fore.CYAN+'[xxx]'+Style.RESET_ALL
  754. if Close_Price < Open_Price:
  755. WarningString = Fore.RED+'[xxx]'+Style.RESET_ALL
  756. else:
  757. WarningString = Fore.YELLOW+'[xxx]'
  758.  
  759. else:
  760. WarningString = ''
  761.  
  762.  
  763. if PULQ == True and OC_Range <= avg_OC_Range *.3:
  764. if abs(Liq_change) < 500 and Liq_change < 0:
  765. if abs(Liq_change) < avg_Liq_change * .05:
  766. WarningString = '[*]'
  767. else:
  768. WarningString = ''
  769.  
  770.  
  771.  
  772. if ref_Num >= 5:
  773. OC_RangePct = round(OC_Range / avg_OC_Range * 100, 2)
  774. HL_RangePct = round(HL_Range / avg_HL_Range * 100, 2)
  775.  
  776. if abs(OC_Range) > 0 and abs(HL_Range) > 0:
  777. RangePct = round(OC_Range / (HL_Range / avg_HL_Range) * 1000, 4)
  778. OCHL_RangePct = round(OC_Range / HL_Range * 100, 4)
  779. OC_HL_RangePctStr = str(OC_HL_RangePct)+'%'
  780. OCHL_RangePctStr = str(OC_HL_RangePct)+'%'
  781. else:
  782. OCHL_RangePctStr = ''
  783. OC_HL_RangePctStr = ''
  784.  
  785.  
  786. Tick_String = ''
  787. # if LFP < 100 and LFPC >= .001:
  788. # est_diff = round(.01*(100 - LFP), 2)
  789. # if Liq_change > 0:
  790. # est_price = round(est_diff + Close_Price, 2)
  791. # if Liq_change < 0:
  792. # est_price = round(Close_Price - est_diff, 2)
  793.  
  794. if LFPC > 0:
  795. est_diff = round(LFPC * Close_Price, 2)
  796. if Liq_change > 0 and Liquidity > 0:
  797. est_price = round(est_diff + Close_Price, 2)
  798. if Liq_change < 0 and Liquidity < 0:
  799. est_price = round(est_diff + Close_Price, 2)
  800. if Liquidity > 0 and Liq_change < 0:
  801. est_price = round(Close_Price - est_diff, 2)
  802.  
  803. else:
  804. est_price = M_Price
  805.  
  806.  
  807.  
  808.  
  809. if Liq_change > 0:
  810. if M_Price < Close_Price:
  811. Tick_String = Fore.WHITE+Back.GREEN+'ALGO UPTICK'+Style.RESET_ALL+WarningString+' '
  812. if M_Price >= Close_Price and M_Price < High_Price + .01:
  813. if Close_Price >= Open_Price:
  814. Tick_String = Fore.BLUE+Back.GREEN+'UPTICK'+Style.RESET_ALL+WarningString+' '
  815.  
  816. if M_Price == High_Price or M_Price == lastHPrice:
  817. Tick_String = colored('SHORTING HIGH', 'yellow', attrs=['blink'])+Style.RESET_ALL+WarningString+' '
  818.  
  819. if Liq_change < 0:
  820.  
  821. if Close_Price > Open_Price and M_Price < Close_Price:
  822. if M_Price < lastMPrice:
  823. Tick_String = colored('EXTENDO SHORT', 'blue')+Style.RESET_ALL+WarningString+' '
  824. else:
  825. Tick_String = Fore.WHITE+'PRICE UP LIQ DOWN'+WarningString+' '
  826. else:
  827. pass
  828.  
  829.  
  830. if Liquidity < 0:
  831. if Liq_change <= avg_Liq_change and Liq_change > 0: #################
  832. Tick_String = Fore.RED+'PIRANAHS BITING'+Style.RESET_ALL+WarningString+' ' #################
  833. if Liq_change > avg_Liq_change * 2 and Liq_change > 0:
  834. Tick_String = Fore.RED+Back.BLUE+'BEARISH BUYING'+Style.RESET_ALL+WarningString+' ' ##############
  835. else:
  836. pass
  837.  
  838.  
  839.  
  840. if mRatio < .25 and sneakR < 6.5: ############## THIS IS GOOD
  841. if M_Price > High_Price or M_Price >= lastHPrice: ##################### THIS IS GOOD
  842. Tick_String = colored('DUMP COMING', 'yellow', 'on_red') ####################### THIS IS GOOD
  843. bearTS = True
  844.  
  845. if mRatio < .15 and sneakR < 6.5:
  846. Tick_String = colored('MAX VOLATILITY PUMP & DUMP', 'red', attrs=['bold', 'blink'])
  847. bullTS = True
  848.  
  849. else:
  850. pass
  851.  
  852.  
  853.  
  854.  
  855.  
  856. else:
  857. bearTS = False
  858. pass
  859.  
  860.  
  861.  
  862. if M_Price > High_Price and M_Price > lastHPrice:
  863. if LFPC >= .0013 and LFPC < .002:
  864. bullTS = False
  865. Tick_String = colored('TRADING ABOVE', 'cyan', 'on_grey')+WarningString+' '
  866. if LFPC >= .002:
  867. bullTS = False
  868. Tick_String = colored('TRADING ABOVE', 'grey', 'on_cyan')+WarningString+' '
  869. else:
  870. pass
  871. if M_Price < Low_Price and M_Price < lastLPrice:
  872. if LFPC >= .0013 and LFPC < .002:
  873. Tick_String = colored('TRADING BELOW', 'red', 'on_grey')+WarningString+' '
  874. if LFPC >= .002:
  875. Tick_String = colored('TRADING BELOW', 'grey', 'on_red')+WarningString+' '
  876. else:
  877. pass
  878.  
  879.  
  880. if mRatio >= 2 and Range_Clause == False:
  881. if mRatio >= 5:
  882. if MIV_Index < 0 and abs(MIV_Index) > Avg_MIV_Spike:
  883. if Liq_change > 0:
  884. if Liquidity < 0:
  885. Tick_String = Fore.WHITE+Style.BRIGHT+'MASSIVE FKN DUMPING'+Style.RESET_ALL+WarningString+' '
  886. elif Liquidity > 0:
  887. Tick_String = Fore.CYAN+Style.BRIGHT+'MASSIVE FKN BUYING'+Style.RESET_ALL+WarningString+' '
  888. if Liq_change < 0:
  889. Tick_String = Fore.WHITE+Style.BRIGHT+Back.RED+'MASSIVE FKN DUMPING'+Style.RESET_ALL+WarningString+' '
  890. bearTS = True
  891.  
  892. else:
  893. bearTS = False
  894. pass
  895.  
  896.  
  897. if MIV_Index > 0 and MIV_Index > Avg_MIV_Spike:
  898. if Liq_change < 0:
  899. Tick_String = Fore.WHITE+Style.BRIGHT+'MASSIVE FKN DUMPING'+Style.RESET_ALL+WarningString+' '
  900. bearTS = True
  901. else:
  902. bearTS = False
  903. pass
  904.  
  905.  
  906. if abs(MIV_Index) < Avg_MIV_Spike:
  907. Tick_String = Style.BRIGHT+'MASSIVE FLOW NO MIV'+Style.RESET_ALL+WarningString+' '
  908.  
  909. else:
  910.  
  911. pass
  912.  
  913.  
  914. if abs(Liq_change) < .05 * avg_Liq_change:
  915. if Open_Price > Last:
  916. Tick_String = Fore.CYAN+Style.BRIGHT+'ALGOS DOIN SUMBULLSHIT'+Style.RESET_ALL+WarningString+' '
  917.  
  918.  
  919. if Open_Price < Last:
  920. if M_Price > lastMPrice and Liq_change < 0:
  921. Tick_String = Fore.RED+Style.BRIGHT+Back.WHITE+'ALGOS DOIN SUMBEARSHIT'+Style.RESET_ALL+WarningString+' '
  922.  
  923. else:
  924. pass
  925.  
  926. else:
  927. bearTS = False
  928. bullTS = False
  929. pass
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936. if Liq_change > 0:
  937. if Liq_change > avg_Liq_change * 2 and M_Price >= Close_Price + (.75 * avg_HL_Range):
  938. if sneakR < 10:
  939. bullTS = True
  940. if MIV_Index < -.25:
  941. Tick_String = colored('BULL EXHAUSTION SETUP', 'cyan', 'on_red')
  942. bearTS = True
  943.  
  944. else:
  945. Tick_String = colored('BEAR EXHAUSTION SETUP', 'red', 'on_cyan')
  946. else:
  947. pass
  948. else:
  949. bullTS = False
  950. pass
  951.  
  952.  
  953. if mRatio >= 1 and sneakR > 100:
  954. if M_Price > lastMPrice and Close_Price < Last:
  955. Tick_String = colored('LARGE DUMPING', 'white', 'on_red')+WarningString+' '
  956.  
  957. if mRatio < .25 and sneakR < 5:
  958. if mRatio < .2 and LFP < 100:
  959. if Liq_change > 0:
  960. Tick_String = Fore.BLUE+Style.BRIGHT+'BREAKOUT'+Style.RESET_ALL+WarningString+' '
  961. bullTS = True
  962.  
  963. if Liq_change < 0:
  964. Tick_String = Fore.YELLOW+Style.BRIGHT+'BREAKDOWN'+Style.RESET_ALL+WarningString+' '
  965. bearTS = True
  966. else:
  967. Tick_String = Fore.RED+Back.YELLOW+Style.BRIGHT+'VOLATILITY COMING'+Style.RESET_ALL+WarningString+' '
  968. nTS = True
  969.  
  970.  
  971. else:
  972. bearTS = False
  973. bullTS = False
  974. nTS = False
  975. pass
  976.  
  977. else:
  978. nTS = False
  979. bearTS = False
  980. bullTS = False
  981. pass
  982.  
  983.  
  984.  
  985.  
  986. # if Open_Price > Last and mRatio < .15:
  987. # Tick_String = colored('PUMP N DUMP V2', 'yellow', attrs=['blink'])
  988. # bearTS = True
  989. #
  990. # else:
  991. # pass
  992.  
  993. if sneakR >= 20 and mRatio < 1:
  994. if Liq_change < 0 and mRatio >= .6:
  995. if LFP < 500:
  996. if est_price < Close_Price:
  997. price_str = str(est_price)
  998. Tick_String = 'PROBABLY TRADING BELOW'+' ($%s )' % price_str
  999. bearTS = True
  1000. if est_price > Close_Price:
  1001. price_str = str(est_price)
  1002. Tick_String = 'PROBABLY TRADING ABOVE'+' ($%s )' % price_str
  1003. bullTS = True
  1004.  
  1005.  
  1006. else:
  1007. pass
  1008. else:
  1009. pass
  1010.  
  1011. else:
  1012. bearTS = False
  1013. bullTS = False
  1014. pass
  1015.  
  1016.  
  1017. if mRatio < .35 and sneakR < 8:
  1018. if LFP < 100 and Liq_change > 0:
  1019. if M_Price > High_Price:
  1020. if Liq_change < avg_Liq_change:
  1021. est_price_str = str(est_price)
  1022. Tick_String = Fore.BLUE+Back.YELLOW+'SHORT THE SHIT ($%s)' % est_price_str
  1023.  
  1024. if Liq_change > avg_Liq_change:
  1025. est_price_str = str(est_price)
  1026. Tick_String = Fore.YELLOW+'GET THE FUCK OUT ($%s)' % est_price_str
  1027. bearTS = True
  1028.  
  1029.  
  1030. else:
  1031. bearTS = False
  1032. pass
  1033. else:
  1034. bearTS = False
  1035. pass
  1036.  
  1037.  
  1038. else:
  1039. bearTS = False
  1040. pass
  1041.  
  1042.  
  1043. if Liq_change < 0 and M_Price > Close_Price:
  1044. if mRatio < .5 and sneakR < 10:
  1045. Tick_String = colored('DOWNTICK', 'yellow', 'on_red', attrs=['bold'])
  1046. bearTS = True
  1047.  
  1048. else:
  1049. pass
  1050.  
  1051. else:
  1052. bearTS = False
  1053.  
  1054.  
  1055. if sneakR >= 100 and mRatio >= 3:
  1056. if MIV_Index < -0.01:
  1057. Tick_String = colored('SERIOUSLY BEARISH', 'grey', 'on_red')
  1058. bearTS = True
  1059.  
  1060. if MIV_Index > 0.01:
  1061. Tick_String = colored('SERIOUSLY BULLISH', 'grey', 'on_cyan')
  1062. bullTS = True
  1063. else:
  1064. bullTS = False
  1065. bearTS = False
  1066. pass
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078. Range_List[ref_Num] = Range_Found
  1079. # else:
  1080. # Tick_String = Fore.WHITE+'PRICE UP LIQ DOWN'+Style.RESET_ALL+WarningString+' '+Fore.WHITE+str(Strength)
  1081.  
  1082.  
  1083. # if abs(Liq_change) <= avg_Liq_change:
  1084. # Tick_String = Fore.RED+'SHORT RALLY'+Style.RESET_ALL+WarningString+' '+Fore.RED+str(Strength)
  1085. # # else:
  1086. # Tick_String = Fore.WHITE+'PRICE UP LIQ DOWN'+Style.RESET_ALL+WarningString+' '+Fore.WHITE+str(Strength)
  1087.  
  1088. # if Tick == -1 and Liq_Tick == 0:
  1089. # if Liquidity < 0:
  1090. # if abs(Liq_change) > avg_Liq_change*2:
  1091. # Tick_String = Fore.RED+'MM\'s BEARISH'+Style.RESET_ALL+WarningString+' '+Fore.YELLOW+str(Strength)
  1092. # else:
  1093. # Tick_String = Fore.RED+'SHORT COVERING'+Style.RESET_ALL+WarningString+' '+Fore.YELLOW+Back.BLUE+Style.BRIGHT+str(Strength)
  1094.  
  1095. Range_List[ref_Num] = Range_Found
  1096. else:
  1097.  
  1098. # if Range_Clause == True:
  1099. # if range_ref_String == "HIGH TARGET" and Money_Flow < 300000000:
  1100. # if Liq_change > 1000000:
  1101. # print("MARKET MAKER HIGH TARGET")
  1102. # if range_ref_String == "LOW TARGET" and Money_Flow > 300000000:
  1103. # if Liq_change < 1000000:
  1104. # print("MARKET MAKER LOW TARGET")
  1105.  
  1106. if lr_filled == False:
  1107. if filled == False:
  1108. if range_ref_String == "LOW TARGET" and Low_Price <= Low_Range:
  1109. filled_Price = Low_Price
  1110. time.sleep(.5)
  1111. print(Fore.WHITE + Back.RED + "LOW RANGE FILLED" + Style.RESET_ALL)
  1112. time.sleep(1)
  1113. lr_filled = True
  1114. lt_filled = False
  1115. lrf = 1
  1116. low_Ranges_Filled += lrf
  1117. if lt_filled == False and lr_filled == True:
  1118. if Close_Price <= Low_Target:
  1119. filled_target_price = Close_Price
  1120. time.sleep(.5)
  1121. print(Fore.RED + Back.YELLOW + 'LOW TARGET FILLED' + Style.RESET_ALL)
  1122. time.sleep(1)
  1123. lt_filled = True
  1124. filled = True
  1125. low_Targets_Filled += 1
  1126. if hr_filled == False:
  1127. if filled == False:
  1128. if range_ref_String == "HIGH TARGET" and High_Price >= High_Range:
  1129. filled_range_price = High_Price
  1130. time.sleep(.5)
  1131. print(Fore.CYAN + "HIGH RANGE FILLED" + Style.RESET_ALL)
  1132. time.sleep(1)
  1133. hr_filled = True
  1134. ht_filled = False
  1135. hrf = 1
  1136. high_Ranges_Filled += hrf
  1137. if ht_filled == False and hr_filled == True:
  1138. if Close_Price >= High_Target:
  1139. filled_target_price = High_Price
  1140. print(Fore.CYAN + "HIGH TARGET FILLED")
  1141. time.sleep(1)
  1142. ht_filled = True
  1143. filled = True
  1144. high_Targets_Filled += 1
  1145.  
  1146.  
  1147. if menu_ans == 'y' or menu_ans == '1':
  1148. if rFound == True:
  1149. if tHigh == True:
  1150. HRS = str(High_Range)
  1151. HRT = str(High_Target)
  1152. LRS = str(Low_Range)
  1153. LRT = str(Low_Target)
  1154. MIV_Index_String = str(MIV_Index)
  1155.  
  1156. 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+ticksymbolo+mticksymbol+ticksymbolc+' ]'+Style.RESET_ALL+Tick_String+Style.RESET_ALL+Fore.GREEN+Back.BLUE+Style.BRIGHT+' NEW HIGH RANGE FOUND:[$'+HRS+']'+' NEW HIGH TARGET FOUND: [$'+HRT+']'+Fore.WHITE+' '+MIV_Index_String+'%'+Style.RESET_ALL+Fore.CYAN+' Avg High Flow: $'+'{:20,.2f}'.format(AvgHighRangeFlow), 'MoneyFlow: $','{:20,.2f}'.format(Money_Flow)+Style.RESET_ALL+Fore.WHITE+'Volume: '+'{:20,.2f}'.format(f_Vol))
  1157. time.sleep(2)
  1158.  
  1159.  
  1160. else:
  1161. tHigh = False
  1162. else:
  1163. rFound = False
  1164. Close_Price = Close_Price
  1165.  
  1166. if rFound == True:
  1167. if tLow == True:
  1168. HRS = str(High_Range)
  1169. HRT = str(High_Target)
  1170. LRS = str(Low_Range)
  1171. LRT = str(Low_Target)
  1172. lowFlow = str(AvgLowRangeFlow)
  1173. flow = str(Money_Flow)
  1174. MIV_Index_String = str(MIV_Index)
  1175.  
  1176. Low_Prices = {'LOW RANGE: $': Low_Range, 'LOW TARGET: $': Low_Target} ##### May not need this line
  1177. 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+ticksymbolo+mticksymbol+ticksymbolc+Style.RESET_ALL+' '+Tick_String+Style.RESET_ALL+Fore.CYAN+Back.RED+Style.BRIGHT+' NEW LOW RANGE FOUND:[$'+LRS+']'+' NEW LOW TARGET FOUND: [$'+LRT+']'+Fore.WHITE+' '+MIV_Index_String+'%'+Style.RESET_ALL+Fore.RED+' Avg Low Flow: $','{:20,.2f}'.format(AvgLowRangeFlow),'MoneyFlow: $','{:20,.2f}'.format(Money_Flow)+Style.RESET_ALL+Fore.WHITE+'Volume: '+'{:20,.2f}'.format(f_Vol))
  1178. time.sleep(2)
  1179.  
  1180. else:
  1181. tLow = False
  1182. else:
  1183. rFound = False
  1184.  
  1185. if bullTS == True:
  1186. print(Fore.CYAN+ '[' + Date + ']', military_time,PCT_Range_Str,Style.RESET_ALL + Fore.WHITE + Back.BLUE + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity) + Style.RESET_ALL + Fore.WHITE + Back.BLUE + ' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + Style.RESET_ALL, Fore.WHITE + Back.BLUE + Style.BRIGHT,'Last Price: [$' + str(Close_Price) + ']'+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+ Style.RESET_ALL + ' '+Tick_String + Style.RESET_ALL + Fore.YELLOW + Back.RED + Style.BRIGHT + Style.RESET_ALL, M_Price)
  1187. time.sleep(.5)
  1188.  
  1189.  
  1190. if bearTS == True:
  1191. print(Fore.RED+ '[' + Date + ']', military_time,PCT_Range_Str,Style.RESET_ALL + Fore.WHITE + Back.RED + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity) + Style.RESET_ALL + Fore.WHITE + Back.RED + ' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + Style.RESET_ALL, Fore.WHITE + Back.RED + Style.BRIGHT,'Last Price: [$' + str(Close_Price) + ']'+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+ Style.RESET_ALL + ' '+Tick_String + Style.RESET_ALL + Fore.YELLOW + Back.RED + Style.BRIGHT + Style.RESET_ALL, M_Price)
  1192. time.sleep(.5)
  1193.  
  1194. if nTS == True:
  1195. print(Fore.YELLOW+Style.BRIGHT+ '[' + Date + ']', military_time,PCT_Range_Str,Style.RESET_ALL + Fore.YELLOW + Style.BRIGHT+ 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity) + Style.RESET_ALL + Fore.YELLOW + Style.BRIGHT+ ' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + Style.RESET_ALL, Fore.YELLOW + Style.BRIGHT,'Last Price: [$' + str(Close_Price) + ']'+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+ Style.RESET_ALL + ' '+Tick_String + Style.RESET_ALL + Fore.YELLOW + Back.RED + Style.BRIGHT + Style.RESET_ALL, M_Price)
  1196. time.sleep(.5)
  1197.  
  1198.  
  1199.  
  1200. if bearTS == False and bullTS == False:
  1201. if nTS == False:
  1202. if Liq_change < -1000000:
  1203. print(Fore.YELLOW + '[' + Date + ']', military_time,PCT_Range_Str,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+ticksymbolo+mticksymbol+ticksymbolc+ Style.RESET_ALL + ' '+Tick_String + Style.RESET_ALL + Fore.YELLOW + Back.RED + Style.BRIGHT + '**SELL SIGNAL**' + Style.RESET_ALL, M_Price)
  1204. time.sleep(1)
  1205. if abs(Liq_change) > 500000:
  1206. time.sleep(.02)
  1207. print(Fore.CYAN + '[' + Date + ']', military_time,PCT_Range_Str,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) +']'+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+ ' '+ Tick_String + Style.RESET_ALL + ' ' + Fore.WHITE+SS+'%'+Style.RESET_ALL, M_Price, PivotStr)
  1208. elif Liquidity > 0:
  1209. if Liq_change > 0:
  1210. time.sleep(.02)
  1211. print(Fore.YELLOW + '[' + Date + ']', military_time,PCT_Range_Str,
  1212. Fore.GREEN + 'Current Liquidity:' + '{:20,.2f}'.format(
  1213. Liquidity) + Fore.GREEN + ' Liq Change: ' + '{:20,.2f}'.format(Liq_change) + ' ' + Fore.YELLOW + Back.BLUE,'Last Price [$' + str(Close_Price) +']'+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+ Style.RESET_ALL+ ' '+Tick_String + Style.RESET_ALL+Fore.WHITE+' '+SS+'%'+Style.RESET_ALL, M_Price, PivotStr)
  1214. if Liq_change < 0:
  1215. time.sleep(.02)
  1216. print(Fore.YELLOW + '[' + Date + ']', military_time,PCT_Range_Str,
  1217. Fore.GREEN + 'Current Liquidity:' + '{:20,.2f}'.format(
  1218. 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) +']'+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+ Style.RESET_ALL+ ' '+Tick_String + Style.RESET_ALL+Fore.WHITE+' '+SS+'%'+Style.RESET_ALL, M_Price, PivotStr)
  1219. elif Liq_change > 0:
  1220. time.sleep(.02)
  1221. print(Fore.YELLOW + '[' + Date + ']', military_time,PCT_Range_Str,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) +']'+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+Style.RESET_ALL + ' '+Tick_String + Style.RESET_ALL + ' ' + Fore.WHITE+SS+'%'+Style.RESET_ALL, M_Price, PivotStr)
  1222. elif Liq_change < 0:
  1223. time.sleep(.02)
  1224. print(Fore.YELLOW + '[' + Date + ']', military_time,PCT_Range_Str,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) +']'+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+Style.RESET_ALL + ' '+Tick_String+ Style.RESET_ALL + ' ' + Fore.WHITE+SS+'%'+Style.RESET_ALL, M_Price, PivotStr)
  1225.  
  1226.  
  1227.  
  1228.  
  1229. '''if runningValueIndex > 0 and MIV_Index > 0:
  1230. print(' '+Fore.BLACK+Back.WHITE+'MIV_Index:+'+MIV_Index_String+'% '+Style.RESET_ALL+' '+Fore.BLACK+Back.GREEN+'Running Value:+'+runningValueIndex_String+'%'+Style.RESET_ALL)
  1231. if MIV_Index < 0 and runningValueIndex > 0:
  1232. print(' '+Fore.RED+Back.YELLOW+'MIV_Index:'+MIV_Index_String+'% '+Style.RESET_ALL+' '+Fore.BLACK+Back.GREEN+'Running Value:+'+runningValueIndex_String+'%'+Style.RESET_ALL)
  1233. if MIV_Index > 0 and runningValueIndex < 0:
  1234. print(' '+Fore.WHITE+'MIV_Index:+'+MIV_Index_String+'% '+Style.RESET_ALL+' '+Fore.RED+Back.YELLOW+'Running Value:'+runningValueIndex_String+'%'+Style.RESET_ALL)
  1235. if MIV_Index < 0 and runningValueIndex < 0:
  1236. print(' '+Fore.RED+'MIV_Index:'+MIV_Index_String+'% '+Style.RESET_ALL+' '+Fore.RED+'Running Value:'+runningValueIndex_String+'%'+Style.RESET_ALL)'''
  1237.  
  1238. '''else:
  1239. runningValueIndex += MIV_Index
  1240. runningValueIndex_String = str(round(runningValueIndex, 2))
  1241. if runningValueIndex > 0:
  1242. print(Fore.GREEN+'MIV_Index: '+runningValueIndex_String, '%')
  1243. else:
  1244. runningValueIndex_String = str(round(runningValueIndex, 2))
  1245. print(Fore.RED+'MIV_Index: '+runningValueIndex_String, '%')'''
  1246.  
  1247.  
  1248. if menu_ans == '3':
  1249. import tcopy
  1250.  
  1251. if menu_ans == '5':
  1252. import analyze4
  1253.  
  1254. if menu_ans == '4':
  1255. labels = ' Date Time Last LiqChange Liquidity $Flow | $Price | LFP | LFPC | Est(T)Price'
  1256. underline = '---------------------------------------------------------------------------------------------------------------------------------------'
  1257. if M_Price > High_Price or M_Price < Low_Price:
  1258. if Money_Flow > 0 and abs(Liq_change) > 0:
  1259. LFP = round(Money_Flow / abs(Liq_change) *.01, 3)
  1260. est_diff = round(.01*(100 - LFP), 2)
  1261. if Liq_change > 0:
  1262. est_price = round(est_diff + Close_Price, 2)
  1263. if Liq_change < 0:
  1264. est_price = round(Close_Price - est_diff, 2)
  1265. LFPC = round(1000 * (abs(Liq_change) / Money_Flow) * .01, 4)
  1266. mf_Str = '{:20,.2f}'.format(Money_Flow)
  1267. liqstr = '{:20,.2f}'.format(Liquidity)
  1268. liqchgstr = '{:20,.2f}'.format(Liq_change)
  1269. rawdatalist = [Date, military_time, Close_Price, liqchgstr, liqstr, mf_Str, M_Price, LFP, LFPC, est_price]
  1270. if LFPC >= .0013:
  1271. rawdatalist1.append(rawdatalist)
  1272. if menu_ans == '6':
  1273. if Money_Flow > 0 and abs(Liq_change) > 0:
  1274. LFP = round(Money_Flow / abs(Liq_change) *.01, 3)
  1275. est_diff = round(.01*(100 - LFP), 2)
  1276. if Liq_change > 0:
  1277. est_price = round(est_diff + Close_Price, 2)
  1278. if Liq_change < 0:
  1279. est_price = round(Close_Price - est_diff, 2)
  1280. LFPC = round(1000 * (abs(Liq_change) / Money_Flow) * .01, 4)
  1281. mf_Str = '{:20,.2f}'.format(Money_Flow)
  1282. liqstr = '{:20,.2f}'.format(Liquidity)
  1283. liqchgstr = '{:20,.2f}'.format(Liq_change)
  1284. OC_Range = round(OC_Range, 2)
  1285. HL_Range = round(HL_Range, 2)
  1286. rawdatalist = [Date, military_time, Close_Price, liqchgstr, liqstr, mf_Str, M_Price, LFP, LFPC, est_price, mRatio, sneakR, OC_Range, HL_Range, MIV_Index]
  1287. rawdatalist2.append(rawdatalist)
  1288. # if LFPC >= .0013 and LFP < 60:
  1289. # rawdatalist2.append(rawdatalist)
  1290. print(labels)
  1291. print(underline)
  1292. for i in rawdatalist1:
  1293. countitems += 1
  1294. print(i)
  1295.  
  1296. if menu_ans == '6':
  1297. for i in rawdatalist2:
  1298. print(i)
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304. print('MIV Spike Count: ',MIV_Spike_Count)
  1305. print('Avg MIV Spike',Avg_MIV_Spike,'%')
  1306. print(Fore.CYAN + 'REF#:', ref_Num)
  1307. time.sleep(.25)
  1308. print(Fore.WHITE + Time)
  1309. time.sleep(.25)
  1310. print("Last:", "$" + str(Close_Price))
  1311. time.sleep(.25)
  1312. print("HLCC:", "$" + str(HLCC))
  1313. time.sleep(.25)
  1314. if HLCC >= M_Price:
  1315. print(Fore.CYAN+"Money Price: "+" $" + str(round(M_Price, 2))+Style.RESET_ALL)
  1316. time.sleep(.25)
  1317. print(Fore.CYAN+'Price Diff: ' + '$' + str(Diff)+Style.RESET_ALL)
  1318.  
  1319. if HLCC < M_Price:
  1320. print(Fore.RED+"Money Price: "+Fore.RED+" $" + str(round(M_Price, 2))+Style.RESET_ALL)
  1321. time.sleep(.25)
  1322. print(Fore.RED+'Price Diff: ' + '$' + str(Diff)+Style.RESET_ALL)
  1323.  
  1324. print('Support: $',support)
  1325. print('Resistance: $', resistance)
  1326.  
  1327. time.sleep(.25)
  1328. if f_Vol > 1000000:
  1329. print(Fore.YELLOW + 'Volume:' + '{:20,.2f}'.format(f_Vol))
  1330. else:
  1331. print(Fore.WHITE + 'Volume:' + '{:20,.2f}'.format(f_Vol))
  1332. time.sleep(.25)
  1333. if Money_Flow > 350000000:
  1334. print(Fore.YELLOW + '$Flow:' + '{:20,.2f}'.format(Money_Flow))
  1335. else:
  1336. print(Fore.WHITE + '$Flow:' + '{:20,.2f}'.format(Money_Flow))
  1337. time.sleep(.25)
  1338. if Liq_change < 0:
  1339. print(Fore.RED + 'Liq Change:', '{:20,.2f}'.format(Liq_change), Style.RESET_ALL)
  1340. else:
  1341. print(Fore.CYAN + 'Liq Change:', '{:20,.2f}'.format(Liq_change))
  1342. time.sleep(.25)
  1343. if Liquidity < 0:
  1344. print(Fore.RED + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity), Style.RESET_ALL)
  1345. else:
  1346. print(Fore.CYAN + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity), Style.RESET_ALL)
  1347. time.sleep(.25)
  1348. print('Avg MIV Spike: ',Avg_MIV_Spike,'%')
  1349. if percent_Strength >= -.68:
  1350. percent_Strength_String = Fore.GREEN+'Current Strength: '+str(percent_Strength)+'%'
  1351. print(percent_Strength_String)
  1352. if percent_Strength <-.68:
  1353. percent_Strength_String = Fore.RED+'Current Strength: '+str(percent_Strength)+'%'
  1354. print(percent_Strength_String)
  1355.  
  1356. new_Strength = 100-(100*abs(percent_Strength- -.3153) / .8794)
  1357. if new_Strength > 70:
  1358. new_Strength_String = Fore.CYAN+'Bullishness Percentile: '+str(round(new_Strength, 2))+'%'+Style.RESET_ALL
  1359. else:
  1360. new_Strength_String = Fore.RED+'Bullishness Percentile: '+str(round(new_Strength, 2))+'%'+Style.RESET_ALL
  1361. print(new_Strength_String)
  1362. pctShortBuying = round(BuyPower / ShortPower, 4)*100
  1363. pctNetSelling = round(SellPower / ShortPower, 4)*100
  1364. pctNetBuying = round(BuyPower / SellPower, 4)*100
  1365. pctNetBuyingStr = str(pctNetBuying)
  1366. pctNetSellingStr = str(pctNetSelling)
  1367. pctShortBuyingStr = str(pctShortBuying)
  1368. print('Buy Power', '{:5,.2f}'.format(BuyPower), 'Short Power:','{:5,.2f}'.format(ShortPower))
  1369. print('Buy Power as % of Short Selling: ['+pctShortBuyingStr+'%]')
  1370. print('Sell Power as % of Short Selling: ['+pctNetSellingStr+'%]')
  1371. BullBearRatio = abs(round(float(pctShortBuying / pctNetSelling), 4))
  1372. print('Bull Bear Ratio: ',BullBearRatio)
  1373. print('Avg Cover Price: $%s' % CoverPrice)
  1374.  
  1375. if lows_found >= 1 or highs_found >= 1:
  1376. print('\nLow Ranges/Targets Found|Filled:',lows_found, '| ', low_Ranges_Filled)
  1377. print('\nHigh Ranges/Targets Found|Filled: ',highs_found, '| ', high_Ranges_Filled)
  1378. print('Total found: ',found)
  1379.  
  1380. '''if found >0:
  1381. tList = tList
  1382. if tList[1] == 'High':
  1383. print(Fore.GREEN+'LAST RANGE FOUND: [$' + str(Low_Range)+']','[$' + str(High_Range)+']', ' [' + range_ref_String + ': $' + str(Target)+']'+Style.RESET_ALL)
  1384. print(Fore.GREEN+'POTENTIAL TARGETS: [$' + str(Low_Target)+']', '[$' + str(High_Target)+']'+Style.RESET_ALL)
  1385. print(Fore.GREEN+'Found price: [$' + found_price + ']', 'Target implies a move of [' + implied_move + '%]'+'from current price ['+str(Close_Price)+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+' ]'+Style.RESET_ALL)
  1386. else:
  1387. tList = tList
  1388. if tList[1] == 'Low':
  1389. print(Fore.RED+'LAST RANGE FOUND: [$' + str(Low_Range)+']','$' + str(High_Range) + ' [' + range_ref_String + ': $' + str(Target)+Style.RESET_ALL)
  1390. print(Fore.RED+'POTENTIAL TARGETS: [$' + str(Low_Target)+']', '$' + str(High_Target)+Style.RESET_ALL)
  1391. print(Fore.RED+'Found price: [$' + (found_price) + ']', 'Target implies a move of [' + implied_move + '%]' + 'from current price [' + str(Close_Price) + ticksymbol +']'+Style.RESET_ALL)'''
  1392.  
  1393. '''input = input('Would you like to see other found ranges?: [y/n]')
  1394. if input == 'y':
  1395. with open('/Users/King/Desktop/RangeTargets.csv' 'r') as csv_file:
  1396. csv_reader = csv.reader(csv_file)
  1397. for row in csv_file:
  1398. row[0] = Date
  1399. row[1] = Time
  1400. row[2] = range_ref_String
  1401. row[3] = Close_Price
  1402. row[4] = M_Price
  1403. row[5] = TargetPrice
  1404. print('\nLow Ranges/Targets Found|Filled: ', lows_found, '| ', low_Ranges_Filled, str(round(low_range_Accuracy, 2)), '%')
  1405. low_range_Accuracy = low_Ranges_Filled / lows_found
  1406.  
  1407. row[6] = Money_Flow
  1408. row[7] = f_Vol
  1409. row[8] = OppRange
  1410. row[9] = OppTarget'''
  1411.  
  1412. '''if abs(Liq_change) > 500000:
  1413. time.sleep(.005)
  1414. 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)+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+' ]'+Tick_String+Style.RESET_ALL)
  1415. else if Liquidity > 0:
  1416. if Liq_change > 0:
  1417. time.sleep(.005)
  1418. 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)+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+' ]'+Tick_String+Style.RESET_ALL)
  1419. if Liq_change < 0:
  1420. time.sleep(.005)
  1421. 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)+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+' ]'+Tick_String+Style.RESET_ALL)
  1422. else if Liq_change > 0:
  1423. time.sleep(.005)
  1424. 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)+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+' ]'+Tick_String+Style.RESET_ALL)
  1425. else if Liq_change < 0:
  1426. time.sleep(.005)
  1427. 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)+Style.RESET_ALL+ticksymbolo+mticksymbol+ticksymbolc+' ]'+Tick_String+Style.RESET_ALL)'''
  1428.  
  1429. '''if menu_ans == '1' and Liquidity_Data == 'list':
  1430. print(Fore.CYAN + 'REF#:', ref_Num)
  1431. time.sleep(.05)
  1432. print(Fore.WHITE + Time)
  1433. time.sleep(.05)
  1434. print("Last:", "$" + str(Close_Price))
  1435. time.sleep(.05)
  1436. print("HLCC:", "$" + str(HLCC))
  1437. time.sleep(.05)
  1438. print("Money Price: ", "$" + str(round(M_Price, 2)))
  1439. time.sleep(.05)
  1440. print('Price Diff: ' + '$' + str(Diff))
  1441. time.sleep(.05)
  1442. if f_Vol > 1000000:
  1443. print(Fore.YELLOW + 'Volume:' + '{:20,.2f}'.format(f_Vol))
  1444. else:
  1445. print(Fore.WHITE + 'Volume:' + '{:20,.2f}'.format(f_Vol))
  1446. time.sleep(.05)
  1447. if Money_Flow > 350000000:
  1448. print(Fore.YELLOW + '$Flow:' + '{:20,.2f}'.format(Money_Flow))
  1449. else:
  1450. print(Fore.WHITE + '$Flow:' + '{:20,.2f}'.format(Money_Flow))
  1451. time.sleep(.05)
  1452. if Liq_change < 0:
  1453. print(Fore.RED + 'Liq Change:', '{:20,.2f}'.format(Liq_change), Style.RESET_ALL)
  1454. else:
  1455. print(Fore.CYAN + 'Liq Change:', '{:20,.2f}'.format(Liq_change))
  1456. time.sleep(.05)
  1457. if Liquidity < 0:
  1458. print(Fore.RED + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity), Style.RESET_ALL)
  1459. else:
  1460. print(Fore.CYAN + 'Current Liquidity:' + '{:20,.2f}'.format(Liquidity), Style.RESET_ALL)
  1461. time.sleep(.1)
  1462. if NoStop == True:
  1463. with open('/Users/King/Desktop/SPY_RangeTargets/NoStop.csv', 'r') as csv_file:
  1464. csv_reader = csv.reader(csv_file)
  1465. for row in csv_reader:
  1466. Date = row[0]
  1467. Time = row[1]
  1468. range_ref_String = row[2]
  1469. Close_Price = float(row[3])
  1470. M_Price = float(row[4])
  1471. TargetPrice = row[5]
  1472. Money_Flow = float(row[6])
  1473. f_Vol = float(row[7])
  1474. OppRange = row[8]
  1475. OppTarget = row[9]
  1476. Liquidity = float(row[10])
  1477. Liq_change = float(row[11])
  1478. LFP = round(float(row[12]), 3)
  1479. MIVI = float(row[13])
  1480. ref_Num = int(row[14])
  1481. list = [Date, Time, range_ref_String]
  1482. Targets = [M_Price, TargetPrice]
  1483. MIV_Index = str(MIVI)+str('%')
  1484. LFP = str(round(LFP, 3))
  1485. oppositePrices = [OppRange, OppTarget]
  1486. Liq_change_String = str('$'+'{:20,.2f}'.format(Liq_change))
  1487. listlist = [MIV_Index, Liq_change, ref_Num]
  1488. dict = {'':list, 'Targets: ':Targets, 'Found price: ':Close_Price, 'Opposite Ranges/Targets':oppositePrices}
  1489. range_info = {'MIV Index: ':MIV_Index, ' Liq Change:':Liq_change_String, 'REF#':ref_Num}
  1490. if MIVI < 0 and Liq_change > 0:
  1491. infotext = colored(str(range_info), 'grey', 'on_cyan', attrs=['reverse', 'underline'])
  1492. else:
  1493. infotext = colored(str(range_info), 'grey', 'on_white', attrs=['reverse', 'underline'])
  1494. for k,v in dict.items():
  1495. time.sleep(.001)
  1496. print(Fore.YELLOW, k,v)
  1497.  
  1498. cprint(infotext)
  1499. print('\n')'''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement