alleyway / add-tradingview-alerts-tool

Automated entry of TradingView alerts for bot trading tools such as 3Commas, Alertatron, CryptoHopper, etc.
MIT License
636 stars 141 forks source link

ERROR Cannot read property 'toLowerCase' of undefined #33

Closed Ajki-GH closed 3 years ago

Ajki-GH commented 3 years ago

Its working for a while then i receive error ERROR Cannot read property 'toLowerCase' of undefined

Last part of log file

ℹ Adding symbol: BINANCE:IOSTUSDT  ( IOST priced in USDT )
› ...waiting 1800ms = 2 x 900  let things settle from processing last alert
› ...selector: //div[@id="header-toolbar-symbol-search"]
› ...waiting 900ms = 1 x 900  
› ...selector: //input[@data-role='search']
› ...waiting 1800ms = 2 x 900  after navigating to ticker
› addAlert()...pressing shortcut key
› ...waiting 900ms = 1 x 900  after clicking shortcut for new alert dialog
› Processing primaryLeft: My Algo v12
› ...waiting 630ms = 0.7 x 900  
› Searching potential dropdown xpath of primaryLeft
› ...selector: //div[contains(@class, 'tv-alert-dialog__group-item--left ')]/span[@class='tv-control-select__wrap tv-dropdown-behavior tv-control-select--size_small']/span[@class='tv-control-select__control tv-dropdown-behavior__button']
› Found dropdown! Clicking element of primaryLeft
› ...waiting 450ms = 0.5 x 900  let dropdown populate
› searching menu for My Algo v12
› Found! Clicking My Algo v12 (80, 1.4, 200, 10, 5, Open​/​Close, 200, Dotted, 1)
› Processing primaryRight: null
› ...waiting 630ms = 0.7 x 900  
› Processing secondary: Smart Buy
› ...waiting 630ms = 0.7 x 900  
› Searching potential dropdown xpath of secondary
› ...selector: //*[@class='tv-control-fieldset__value tv-alert-dialog__fieldset-value js-condition-operator-input-wrap']/*[@class='tv-control-select__wrap tv-dropdown-behavior tv-control-select--size_small' and 1]/span[@class='tv-control-select__control tv-dropdown-behavior__button' and 1]
› Found dropdown! Clicking element of secondary
› ...waiting 450ms = 0.5 x 900  let dropdown populate
› searching menu for Smart Buy
› Found! Clicking Smart Buy Alert
› Processing tertiaryLeft: null
› ...waiting 630ms = 0.7 x 900  
› Processing tertiaryRight: null
› ...waiting 630ms = 0.7 x 900  
› ...waiting 450ms = 0.5 x 900  
› Selecting option: Once Per Bar Close
› ...selector: //*[text()='Once Per Bar Close']
› ...waiting 270ms = 0.3 x 900  
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='send-push']
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='show-popup']
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='send-email']
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='webhook-toggle']
› ...waiting 270ms = 0.3 x 900  
› typing webhook url: https://XXX.net
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='webhook-url']
› Setting Alert Name: AA5m
› ...selector: //input[@name='alert-name']
› ...waiting 450ms = 0.5 x 900  
› Setting message: {"secret":"XXX","market":"{{ticker}}","type":"buy","tf":"{{interval}}","price":"{{close}}"}
› ...selector: //textarea[@class='tv-control-textarea']
› ...waiting 450ms = 0.5 x 900  
› clickSubmit()
› ...selector: //div[contains(@class, 'tv-dialog')]/*/div[@data-name='submit']
› ...waiting 1800ms = 2 x 900  
› clickContinueIfWarning()
› ...selector: //div[@data-name='warning-modal']/*//button[@name='ok-button']
› ...waiting 2700ms = 3 x 900  waiting after clicking 'continue anyway' button
ℹ Adding symbol: BINANCE:ZENUSDT  ( ZEN priced in USDT )
› ...waiting 1800ms = 2 x 900  let things settle from processing last alert
› ...selector: //div[@id="header-toolbar-symbol-search"]
› ...waiting 900ms = 1 x 900  
› ...selector: //input[@data-role='search']
› ...waiting 1800ms = 2 x 900  after navigating to ticker
› addAlert()...pressing shortcut key
› ...waiting 900ms = 1 x 900  after clicking shortcut for new alert dialog
› Processing primaryLeft: My Algo v12
› ...waiting 630ms = 0.7 x 900  
› Searching potential dropdown xpath of primaryLeft
› ...selector: //div[contains(@class, 'tv-alert-dialog__group-item--left ')]/span[@class='tv-control-select__wrap tv-dropdown-behavior tv-control-select--size_small']/span[@class='tv-control-select__control tv-dropdown-behavior__button']
› Found dropdown! Clicking element of primaryLeft
› ...waiting 450ms = 0.5 x 900  let dropdown populate
› searching menu for My Algo v12
› Found! Clicking My Algo v12 (80, 1.4, 200, 10, 5, Open​/​Close, 200, Dotted, 1)
› Processing primaryRight: null
› ...waiting 630ms = 0.7 x 900  
› Processing secondary: Smart Buy
› ...waiting 630ms = 0.7 x 900  
› Searching potential dropdown xpath of secondary
› ...selector: //*[@class='tv-control-fieldset__value tv-alert-dialog__fieldset-value js-condition-operator-input-wrap']/*[@class='tv-control-select__wrap tv-dropdown-behavior tv-control-select--size_small' and 1]/span[@class='tv-control-select__control tv-dropdown-behavior__button' and 1]
› Found dropdown! Clicking element of secondary
› ...waiting 450ms = 0.5 x 900  let dropdown populate
› searching menu for Smart Buy
› Found! Clicking Smart Buy Alert
› Processing tertiaryLeft: null
› ...waiting 630ms = 0.7 x 900  
› Processing tertiaryRight: null
› ...waiting 630ms = 0.7 x 900  
› ...waiting 450ms = 0.5 x 900  
› Selecting option: Once Per Bar Close
› ...selector: //*[text()='Once Per Bar Close']
› ...waiting 270ms = 0.3 x 900  
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='send-push']
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='show-popup']
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='send-email']
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='webhook-toggle']
› ...waiting 270ms = 0.3 x 900  
› typing webhook url: https://XXX.net
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='webhook-url']
› Setting Alert Name: AA5m
› ...selector: //input[@name='alert-name']
› ...waiting 450ms = 0.5 x 900  
› Setting message: {"secret":"XXX","market":"{{ticker}}","type":"buy","tf":"{{interval}}","price":"{{close}}"}
› ...selector: //textarea[@class='tv-control-textarea']
› ...waiting 450ms = 0.5 x 900  
› clickSubmit()
› ...selector: //div[contains(@class, 'tv-dialog')]/*/div[@data-name='submit']
› ...waiting 1800ms = 2 x 900  
› clickContinueIfWarning()
› ...selector: //div[@data-name='warning-modal']/*//button[@name='ok-button']
› ...waiting 2700ms = 3 x 900  waiting after clicking 'continue anyway' button
ℹ Adding symbol: BINANCE:BNTUSDT  ( BNT priced in USDT )
› ...waiting 1800ms = 2 x 900  let things settle from processing last alert
› ...selector: //div[@id="header-toolbar-symbol-search"]
› ...waiting 900ms = 1 x 900  
› ...selector: //input[@data-role='search']
› ...waiting 1800ms = 2 x 900  after navigating to ticker
› addAlert()...pressing shortcut key
› ...waiting 900ms = 1 x 900  after clicking shortcut for new alert dialog
› Processing primaryLeft: My Algo v12
› ...waiting 630ms = 0.7 x 900  
› Searching potential dropdown xpath of primaryLeft
› ...selector: //div[contains(@class, 'tv-alert-dialog__group-item--left ')]/span[@class='tv-control-select__wrap tv-dropdown-behavior tv-control-select--size_small']/span[@class='tv-control-select__control tv-dropdown-behavior__button']
› Found dropdown! Clicking element of primaryLeft
› ...waiting 450ms = 0.5 x 900  let dropdown populate
› searching menu for My Algo v12
› Found! Clicking My Algo v12 (80, 1.4, 200, 10, 5, Open​/​Close, 200, Dotted, 1)
› Processing primaryRight: null
› ...waiting 630ms = 0.7 x 900  
› Processing secondary: Smart Buy
› ...waiting 630ms = 0.7 x 900  
› Searching potential dropdown xpath of secondary
› ...selector: //*[@class='tv-control-fieldset__value tv-alert-dialog__fieldset-value js-condition-operator-input-wrap']/*[@class='tv-control-select__wrap tv-dropdown-behavior tv-control-select--size_small' and 1]/span[@class='tv-control-select__control tv-dropdown-behavior__button' and 1]
› Found dropdown! Clicking element of secondary
› ...waiting 450ms = 0.5 x 900  let dropdown populate
› searching menu for Smart Buy
› Found! Clicking Smart Buy Alert
› Processing tertiaryLeft: null
› ...waiting 630ms = 0.7 x 900  
› Processing tertiaryRight: null
› ...waiting 630ms = 0.7 x 900  
› ...waiting 450ms = 0.5 x 900  
› Selecting option: Once Per Bar Close
› ...selector: //*[text()='Once Per Bar Close']
› ...waiting 270ms = 0.3 x 900  
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='send-push']
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='show-popup']
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='send-email']
› ...waiting 270ms = 0.3 x 900  
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='webhook-toggle']
› ...waiting 270ms = 0.3 x 900  
› typing webhook url: https://XXX.net
› ...selector: //div[contains(@class, 'tv-dialog')]//input[@name='webhook-url']
› Setting Alert Name: AA5m
› ...selector: //input[@name='alert-name']
› ...waiting 450ms = 0.5 x 900  
› Setting message: {"secret":"XXX","market":"{{ticker}}","type":"buy","tf":"{{interval}}","price":"{{close}}"}
› ...selector: //textarea[@class='tv-control-textarea']
› ...waiting 450ms = 0.5 x 900  
› clickSubmit()
› ...selector: //div[contains(@class, 'tv-dialog')]/*/div[@data-name='submit']
› ...waiting 1800ms = 2 x 900  
› clickContinueIfWarning()
› ...selector: //div[@data-name='warning-modal']/*//button[@name='ok-button']
› ...waiting 2700ms = 3 x 900  waiting after clicking 'continue anyway' button

 ERROR  Cannot read property 'toLowerCase' of undefined

  at isBlacklisted (src/add-alerts.ts:102:24)
  at src/add-alerts.ts:118:13
  at Generator.next (<anonymous>)
  at fulfilled (dist/add-alerts.js:4:58)
Ajki-GH commented 3 years ago

Found the error, it was empty line at the end of pair cvs file.