w1ld3r / crypto-signal

The #1 Automated Technical Analysis (TA) & Algo. Trading tool for Coinbase, Bittrex, Binance, and more! (Track over 500+ coins)
http://cryptosignal.dev
MIT License
76 stars 37 forks source link

[FEATURE] Request Binance Futures Api #31

Closed velajos closed 3 years ago

velajos commented 3 years ago

Could the BINANCE Futures Api be added as an option? (which only works with USDT pairs)

w1ld3r commented 3 years ago

You can pull the new push and change your config file with the option future to true:

exchanges:
    binance:
        required:
            enabled: true
        all_pairs:
            - USDT
        future: true

Please, @Juanjacinto123, let me know if you are satisfied with the result. You'll have 118 pairs on binance futures.

Hackmole commented 3 years ago

How can I make use of this?

w1ld3r commented 3 years ago

How can I make use of this?

Please, if you face an issue create your own ticket.

Majenunez commented 3 years ago
future: true

So far I am testing it and it works as expected.

But when I use the "top_pairs" option, I get the following error:

_" File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\concurrent\futures_base.py", line 428, in result return self.get_result() File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\concurrent\futures_base.py", line 384, in get_result raise self._exception File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\tenacity__init.py", line 433, in call__ result = fn(*args, **kwargs) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\exchange.py", line 151, in get_topmarkets values, dtype=[('market', 'U10'), ('volume', int)]) OverflowError: Python int too large to convert to C long"

Majenunez commented 3 years ago

I am currently using this settings :

_"update_interval: 260 start_worker_interval: 20 market_data_chunksize: 10"

And eventually I get this error:

Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner self.run() File "app.py", line 100, in run self.behaviour.run(self.market_data, self.settings['output_mode']) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\behaviour.py", line 74, in run self.notifier.notify_all(new_result) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\notification.py", line 157, in notify_all messages = self.get_indicator_messages(new_analysis) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\notification.py", line 671, in get_indicator_messages '/') ValueError: not enough values to unpack (expected 2, got 1)

velajos commented 3 years ago
future: true

So far I am testing it and it works as expected.

But when I use the "top_pairs" option, I get the following error:

_" File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\concurrent\futures_base.py", line 428, in result return self.get_result() File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\concurrent\futures_base.py", line 384, in get_result raise self._exception File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\tenacityinit.py", line 433, in call result = fn(*args, **kwargs) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\exchange.py", line 151, in get_topmarkets values, dtype=[('market', 'U10'), ('volume', int)]) OverflowError: Python int too large to convert to C long"

Same thing happens to me @w1ld3r

velajos commented 3 years ago

I am currently using this settings :

_"update_interval: 260 start_worker_interval: 20 market_data_chunksize: 10"

And eventually I get this error:

Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner self.run() File "app.py", line 100, in run self.behaviour.run(self.market_data, self.settings['output_mode']) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\behaviour.py", line 74, in run self.notifier.notify_all(new_result) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\notification.py", line 157, in notify_all messages = self.get_indicator_messages(new_analysis) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\notification.py", line 671, in get_indicator_messages '/') ValueError: not enough values to unpack (expected 2, got 1)

Hi @w1ld3r ,

Same error with default settings:

update_interval: 300

Traceback (most recent call last):

File "C:\Users\flia\Documents\GitHub\crypto-signal\app\notification.py", line 157, in notify_all messages = self.get_indicator_messages(new_analysis) File "C:\Users\flia\Documents\GitHub\crypto-signal\app\notification.py", line 671, in get_indicator_messages '/') ValueError: not enough values to unpack (expected 2, got 1)

w1ld3r commented 3 years ago

Sorry, I'll only be available this weekend to resolve the issue.

velajos commented 3 years ago

Sorry, I'll only be available this weekend to resolve the issue.

No problem, thanks for taking the time to help.

w1ld3r commented 3 years ago

Can you check the new push ?

velajos commented 3 years ago

Can you check the new push ?

Yes.

Now, the "Top pairs" feature is working fine.

velajos commented 3 years ago

@w1ld3r Please check the other question I told you about a few days ago.

Regarding this: [FEATURE] Avoiding Spam in Notifications from Conditionals #34

velajos commented 3 years ago

Can you check the new push ?

Yes.

Now, the "Top pairs" feature is working fine.

@w1ld3r I made a mistake when I answered this, the mistake was that I did not have the "future: true" option and the "top_pairs" option active.

Now that I have it active, I keep getting the following error:

_File "C:\Users\flia\AppData\Local\Programs\Python\Python37\lib\concurrent\futures_base.py", line 428, in result return self.get_result() File "C:\Users\flia\AppData\Local\Programs\Python\Python37\lib\concurrent\futures_base.py", line 384, in get_result raise self._exception File "C:\Users\flia\AppData\Local\Programs\Python\Python37\lib\site-packages\tenacity__init.py", line 433, in call__ result = fn(*args, **kwargs) File "C:\Users\flia\Documents\GitHub\crypto-signal-wilder-condit\crypto-signal\app\exchange.py", line 151, in get_topmarkets values, dtype=[('market', 'U10'), ('volume', int)]) OverflowError: Python int too large to convert to C long

This is my config regarding the exchange:

exchanges:

    binance:
        required:
            enabled: true
        all_pairs:
            - USDT
            #- BTC
        future: true            
        exclude:
            - USDC
            - PAX
            - BUSD
            - TUSD
            - EUR
            - SUSD
            - GBP
            - UTK
            - BTC
        top_pairs: 100
velajos commented 3 years ago

I am currently using this settings : _"update_interval: 260 start_worker_interval: 20 market_data_chunksize: 10" And eventually I get this error: Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner self.run() File "app.py", line 100, in run self.behaviour.run(self.market_data, self.settings['output_mode']) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\behaviour.py", line 74, in run self.notifier.notify_all(new_result) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\notification.py", line 157, in notify_all messages = self.get_indicator_messages(new_analysis) File "C:\Users\user\Documents\GitHub\crypto-signal-futures\app\notification.py", line 671, in get_indicator_messages '/') ValueError: not enough values to unpack (expected 2, got 1)

Hi @w1ld3r ,

Same error with default settings:

update_interval: 300

Traceback (most recent call last):

File "C:\Users\flia\Documents\GitHub\crypto-signal\app\notification.py", line 157, in notify_all messages = self.get_indicator_messages(new_analysis) File "C:\Users\flia\Documents\GitHub\crypto-signal\app\notification.py", line 671, in get_indicator_messages '/') ValueError: not enough values to unpack (expected 2, got 1)

@w1ld3r This error was fixed successfully.

w1ld3r commented 3 years ago

Can you try without top_pairs: 100 option ?

velajos commented 3 years ago

Can you try without top_pairs: 100 option ?

Yes, without the "top_pairs: 100` option, Error does not occur

w1ld3r commented 3 years ago

Ì didn't get any error using this config file:

settings:
    log_level: INFO
    update_interval: 10
    start_worker_interval: 2
    market_data_chunk_size: 1

exchanges:
    binance:
        required:
            enabled: true
        all_pairs:
            - USDT
            #- BTC
        future: true            
        exclude:
            - USDC
            - PAX
            - BUSD
            - TUSD
            - EUR
            - SUSD
            - GBP
            - UTK
            - BTC
        top_pairs: 100

indicators:
    bbp:
        - enabled: false
    ma_crossover:
        - enabled: false
    rsi:
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 100
          cold: 0
          candle_period: 15m 
          period_count: 14
          mute_cold: false
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 100
          cold: 0
          candle_period: 1h
          period_count: 14
          mute_cold: false
    ma_ribbon:
        - enabled: false     
    macd:
        - enabled: false
    iiv:
        - enabled: false
    stoch_rsi:
        - enabled: false
    momentum:
        - enabled: false
    obv:
        - enabled: false
    mfi:
        - enabled: false
    ichimoku:
        - enabled: false

informants:
    lrsi:
        - enabled: false
    sma:
        - enabled: false       
    ema:
        - enabled: false
    vwap:
        - enabled: false
    bollinger_bands:
        - enabled: false
    ohlcv:
        - enabled: true
          signal:
            - high
            - low
            - close
          candle_period: 1h
          period_count: 14
        - enabled: true
          signal:
            - high
            - low
            - close
          candle_period: 15m
          period_count: 14  

conditionals:
  - label: "Buy"
    hot:
      - rsi: 0
      - rsi: 1
  - label: "Sell"
    cold:
      - rsi: 0
      - rsi: 1

notifiers:
    telegram_01:
        required:
            token: XXX
            chat_id: YYY
        optional:
            parse_mode: html
            template: "{{ market }} 
            BUY {{ price_value['1h'].close }} 
            SL: {{ decimal_format|format(price_value['1h'].low * 0.9) }} 
            TP: {{ decimal_format|format(price_value['1h'].close * 1.02) }} {{ decimal_format|format(price_value['1h'].close * 1.04) }} "
velajos commented 3 years ago

Ì didn't get any error using this config file:

settings:
    log_level: INFO
    update_interval: 10
    start_worker_interval: 2
    market_data_chunk_size: 1

exchanges:
    binance:
        required:
            enabled: true
        all_pairs:
            - USDT
            #- BTC
        future: true            
        exclude:
            - USDC
            - PAX
            - BUSD
            - TUSD
            - EUR
            - SUSD
            - GBP
            - UTK
            - BTC
        top_pairs: 100

indicators:
    bbp:
        - enabled: false
    ma_crossover:
        - enabled: false
    rsi:
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 100
          cold: 0
          candle_period: 15m 
          period_count: 14
          mute_cold: false
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 100
          cold: 0
          candle_period: 1h
          period_count: 14
          mute_cold: false
    ma_ribbon:
        - enabled: false     
    macd:
        - enabled: false
    iiv:
        - enabled: false
    stoch_rsi:
        - enabled: false
    momentum:
        - enabled: false
    obv:
        - enabled: false
    mfi:
        - enabled: false
    ichimoku:
        - enabled: false

informants:
    lrsi:
        - enabled: false
    sma:
        - enabled: false       
    ema:
        - enabled: false
    vwap:
        - enabled: false
    bollinger_bands:
        - enabled: false
    ohlcv:
        - enabled: true
          signal:
            - high
            - low
            - close
          candle_period: 1h
          period_count: 14
        - enabled: true
          signal:
            - high
            - low
            - close
          candle_period: 15m
          period_count: 14  

conditionals:
  - label: "Buy"
    hot:
      - rsi: 0
      - rsi: 1
  - label: "Sell"
    cold:
      - rsi: 0
      - rsi: 1

notifiers:
    telegram_01:
        required:
            token: XXX
            chat_id: YYY
        optional:
            parse_mode: html
            template: "{{ market }} 
            BUY {{ price_value['1h'].close }} 
            SL: {{ decimal_format|format(price_value['1h'].low * 0.9) }} 
            TP: {{ decimal_format|format(price_value['1h'].close * 1.02) }} {{ decimal_format|format(price_value['1h'].close * 1.04) }} "

I'm using this settings:

settings: log_level: INFO update_interval: 350 start_worker_interval: 15 market_data_chunk_size: 5

w1ld3r commented 3 years ago

Still not getting any errors.

velajos commented 3 years ago

Still not getting any errors.

This is the full configuration:

settings:
    log_level: INFO
    enable_charts: false
    update_interval: 350
    start_worker_interval: 15
    market_data_chunk_size: 5

exchanges:
    binance:
        required:
            enabled: true
        all_pairs:
            - USDT
            #- BTC
        future: true            
        exclude:
            - USDC
            - PAX
            - BUSD
            - TUSD
            - EUR
            - SUSD
            - GBP
            - UTK
            - BTC
        top_pairs: 100 

indicators:
    bbp:
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          candle_period: 15m
          period_count: 20
          hot: 0.5
          cold: 0.99
          std_dev: 2
          signal:
            - bbp
            - mfi
          hot_label: 'Lower Band'
          cold_label: 'Upper Band'
          indicator_label: 'bb inf 5m'
          mute_cold: false    
    rsi:
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 50
          cold: 60
          candle_period: 15m 
          period_count: 14
          hot_label: 'Uptrend is coming'
          cold_label: 'Downtred is coming'
          indicator_label: 'rsi'
          mute_cold: false
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 50
          cold: 60
          candle_period: 15m
          period_count: 14
          hot_label: 'Uptrend is coming'
          cold_label: 'Downtred is coming'
          indicator_label: 'rsi'
          mute_cold: false

    bollinger:
        - enabled: false
          candle_period: 15m
          alert_enabled: true
          alert_frequency: once
          period_count: 20
          std_dev: 2
          signal:
            - low_band
            - close
            - up_band
          hot_label: 'Lower Band'
          cold_label: 'Upper Band'
          indicator_label: 'Bollinger Crossing 15m'
          mute_cold: true         
    macd:
        - enabled: false
    stoch_rsi:
        - enabled: false
    momentum:
        - enabled: false
    obv:
        - enabled: false
    mfi:
        - enabled: false
    ichimoku:
        - enabled: false
    iiv:
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - iiv
          hot: 4
          cold: 0
          candle_period: 15m
          indicator_label: 'Unusual Volume 5min'  

informants:
    lrsi:
        - enabled: false
    sma:
        - enabled: false       
    ema:
        - enabled: false
    vwap:
        - enabled: false
    bollinger_bands:
        - enabled: false
    ohlcv:  
        - enabled: true
          signal:
            - high
            - low
            - close
          candle_period: 15m
          period_count: 14
        - enabled: false
          signal:
            - high
            - low
            - close
          candle_period: 1h
          period_count: 14

conditionals:
    - label: "ALERT \n bbp 0.5 rsi 50 "
      hot:       
        - rsi: 0
        - bbp: 0        
    - label: "ALERT \n iiv 4 rsi 50 "
      hot:     
        - rsi: 1
        - iiv: 0
notifiers:
    telegram_01:
        required:
            token: xxx
            chat_id: xxx 
        optional:
            parse_mode: html
            template: "{{status}}"
velajos commented 3 years ago

Does it have something to do with the version of python I'm using? Python 3.7.9

Update: I did some research and it may be related to the operating system I am using, Windows 10 64 bit.

https://kodlogs.com/33512/overflowerror-python-int-too-large-to-convert-to-c-long

w1ld3r commented 3 years ago

Then you should post a config file that will help me reproduce the issue. If you are on the latest commit it's an issue on the exange module.

w1ld3r commented 3 years ago

Does it have something to do with the version of python I'm using? Python 3.7.9

Update: I did some research and it may be related to the operating system I am using, Windows 10 64 bit.

https://kodlogs.com/33512/overflowerror-python-int-too-large-to-convert-to-c-long

I'll take a look using ur config.

velajos commented 3 years ago

Does it have something to do with the version of python I'm using? Python 3.7.9 Update: I did some research and it may be related to the operating system I am using, Windows 10 64 bit. https://kodlogs.com/33512/overflowerror-python-int-too-large-to-convert-to-c-long

I'll take a look using ur config.

Ok, let me know. Thanks

w1ld3r commented 3 years ago

I'm not getting errors using your configuration. I'm using Docker 20.10.5:

Client:
 Version:           20.10.5+dfsg1
 API version:       1.41
 Go version:        go1.15.9
 Git commit:        55c4c88
 Built:             Sun Jul 18 09:08:14 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.5+dfsg1
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.15.9
  Git commit:       363e9a8
  Built:            Sun Jul 18 09:08:14 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.5~ds1
  GitCommit:        1.4.5~ds1-2
 runc:
  Version:          1.0.0~rc93+ds1
  GitCommit:        1.0.0~rc93+ds1-5+b2
 docker-init:
  Version:          0.19.0
  GitCommit:  
velajos commented 3 years ago

I'm not getting errors using your configuration. I'm using Docker 20.10.5:

Client:
 Version:           20.10.5+dfsg1
 API version:       1.41
 Go version:        go1.15.9
 Git commit:        55c4c88
 Built:             Sun Jul 18 09:08:14 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.5+dfsg1
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.15.9
  Git commit:       363e9a8
  Built:            Sun Jul 18 09:08:14 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.5~ds1
  GitCommit:        1.4.5~ds1-2
 runc:
  Version:          1.0.0~rc93+ds1
  GitCommit:        1.0.0~rc93+ds1-5+b2
 docker-init:
  Version:          0.19.0
  GitCommit:  

Well I have always used it without Docker, only with Python and I followed the steps in the "DockerFile" file. And I have used it that way on both Windows and Ubuntu, only now is that I get the error only on Windows.

But I will try not to use the "top_pairs" option while on windows.

Please check the notifications issue from the conditional, I left you a message over there. Thanks

w1ld3r commented 3 years ago

Can you create a new ticket to track the issue ?

velajos commented 3 years ago

Can you create a new ticket to track the issue ?

For notifications issue?

w1ld3r commented 3 years ago

Regarding the issue I'm unable to reproduce

velajos commented 3 years ago

I have already created the new ticket

G0rdianKnot commented 3 years ago

Ì didn't get any error using this config file:

settings:
    log_level: INFO
    update_interval: 10
    start_worker_interval: 2
    market_data_chunk_size: 1

exchanges:
    binance:
        required:
            enabled: true
        all_pairs:
            - USDT
            #- BTC
        future: true            
        exclude:
            - USDC
            - PAX
            - BUSD
            - TUSD
            - EUR
            - SUSD
            - GBP
            - UTK
            - BTC
        top_pairs: 100

indicators:
    bbp:
        - enabled: false
    ma_crossover:
        - enabled: false
    rsi:
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 100
          cold: 0
          candle_period: 15m 
          period_count: 14
          mute_cold: false
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 100
          cold: 0
          candle_period: 1h
          period_count: 14
          mute_cold: false
    ma_ribbon:
        - enabled: false     
    macd:
        - enabled: false
    iiv:
        - enabled: false
    stoch_rsi:
        - enabled: false
    momentum:
        - enabled: false
    obv:
        - enabled: false
    mfi:
        - enabled: false
    ichimoku:
        - enabled: false

informants:
    lrsi:
        - enabled: false
    sma:
        - enabled: false       
    ema:
        - enabled: false
    vwap:
        - enabled: false
    bollinger_bands:
        - enabled: false
    ohlcv:
        - enabled: true
          signal:
            - high
            - low
            - close
          candle_period: 1h
          period_count: 14
        - enabled: true
          signal:
            - high
            - low
            - close
          candle_period: 15m
          period_count: 14  

conditionals:
  - label: "Buy"
    hot:
      - rsi: 0
      - rsi: 1
  - label: "Sell"
    cold:
      - rsi: 0
      - rsi: 1

notifiers:
    telegram_01:
        required:
            token: XXX
            chat_id: YYY
        optional:
            parse_mode: html
            template: "{{ market }} 
            BUY {{ price_value['1h'].close }} 
            SL: {{ decimal_format|format(price_value['1h'].low * 0.9) }} 
            TP: {{ decimal_format|format(price_value['1h'].close * 1.02) }} {{ decimal_format|format(price_value['1h'].close * 1.04) }} "

Hello, why I by means of your config.yml receive only the offer on purchase. The signal on sale isn't present. How to use your remarkable program fully. I will be grateful.

babehdyo commented 2 years ago

Ì didn't get any error using this config file:

settings:
    log_level: INFO
    update_interval: 10
    start_worker_interval: 2
    market_data_chunk_size: 1

exchanges:
    binance:
        required:
            enabled: true
        all_pairs:
            - USDT
            #- BTC
        future: true            
        exclude:
            - USDC
            - PAX
            - BUSD
            - TUSD
            - EUR
            - SUSD
            - GBP
            - UTK
            - BTC
        top_pairs: 100

indicators:
    bbp:
        - enabled: false
    ma_crossover:
        - enabled: false
    rsi:
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 100
          cold: 0
          candle_period: 15m 
          period_count: 14
          mute_cold: false
        - enabled: true
          alert_enabled: true
          alert_frequency: once
          signal:
            - rsi
          hot: 100
          cold: 0
          candle_period: 1h
          period_count: 14
          mute_cold: false
    ma_ribbon:
        - enabled: false     
    macd:
        - enabled: false
    iiv:
        - enabled: false
    stoch_rsi:
        - enabled: false
    momentum:
        - enabled: false
    obv:
        - enabled: false
    mfi:
        - enabled: false
    ichimoku:
        - enabled: false

informants:
    lrsi:
        - enabled: false
    sma:
        - enabled: false       
    ema:
        - enabled: false
    vwap:
        - enabled: false
    bollinger_bands:
        - enabled: false
    ohlcv:
        - enabled: true
          signal:
            - high
            - low
            - close
          candle_period: 1h
          period_count: 14
        - enabled: true
          signal:
            - high
            - low
            - close
          candle_period: 15m
          period_count: 14  

conditionals:
  - label: "Buy"
    hot:
      - rsi: 0
      - rsi: 1
  - label: "Sell"
    cold:
      - rsi: 0
      - rsi: 1

notifiers:
    telegram_01:
        required:
            token: XXX
            chat_id: YYY
        optional:
            parse_mode: html
            template: "{{ market }} 
            BUY {{ price_value['1h'].close }} 
            SL: {{ decimal_format|format(price_value['1h'].low * 0.9) }} 
            TP: {{ decimal_format|format(price_value['1h'].close * 1.02) }} {{ decimal_format|format(price_value['1h'].close * 1.04) }} "

Hello, why I by means of your config.yml receive only the offer on purchase. The signal on sale isn't present. How to use your remarkable program fully. I will be grateful.

I also curious how to make different parameters in Take profit and stoploss since the config above is for buy only. How to do it with sell conditionals in futures. Thank you