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 when running the script "The "path" argument must be of type string or an instance of Buffer or URL" #14

Closed zhengyangfeng00 closed 3 years ago

zhengyangfeng00 commented 3 years ago

Hey, I saw below error when trying to run the script:

~/add-tradingview-alerts-tool ❯❯❯ npm run add-alerts

> @alleyway/add-tradingview-alerts-tool@1.5.2 add-alerts
> npx tsc && node -r source-map-support/register lib/add-tradingview-alerts.js

Using config file:  config.yml
Press Ctrl-C to stop this script
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
    at Object.open (node:fs:473:10)
    at ReadStream._construct (node:internal/fs/streams:64:17)
    at constructNT (node:internal/streams/destroy:288:25)
    at processTicksAndRejections (node:internal/process/task_queues:80:21)

I was able to login to tradingview and the chart was loaded. Before it was able to add any alert, I got this error.

My config is as following:

files:
  input: software.csv
tradingview:
  # The chart which has the indicator you'd like to use
  chartUrl: https://www.tradingview.com/chart/xxxxx/ 
  # (optional) set the chart interval before adding pairs, otherwise interval of last saved chart is used
  # examples: 1s | 30s | 1m | 15m | 1h | 1D | 1M
  interval: 30min
alert:
  option: Once Per Bar Close
  actions:
    notifyOnApp: false
    showPopup: false
    sendEmail: false
    webhook:
      enabled: true
      url: "https://xxxxx"
  # alert name is optional - can override in csv if you add a "name" column. can use {{symbol|base|quote}}
  # name: "MI dev3 for {{base}} {{quote}}"
  # indentation matters! {{quote}} and {{base}} are swapped out for quote asset(eg. USDT) and the base (eg. BTC)
  # message: >
  #   {
  #        "message_type": "bot",
  #        "bot_id": 999999,
  #        "email_token": "fffffff-fffff-fffff-ffff-ffffffffff",
  #        "delay_seconds": 0,
  #        "pair": "{{quote}}_{{base}}"
  #   }

Is it because I commented out some optional fields? Thanks!!

zhengyangfeng00 commented 3 years ago

got it, the blacklist file is a required argument.