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] Avoiding Spam in Notifications from Conditionals #34

Closed velajos closed 2 years ago

velajos commented 3 years ago

As is well known, you can mute the notification to the "frequency once" mode, which is excellent to avoid spam.

But could this feature be implemented from the conditional?

That is, if a pair analyzed at 15 minutes is notified from the conditional, it will be muted for at least 15 minutes or a time interval of the user's choice.

w1ld3r commented 3 years ago

You can already use alert_frequency: once on your indicators and informants to avoid SPAM. With this testing conf, I avoid SPAM:

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: false

conditionals:
  - label: "Buy"
    hot:
      - rsi: 0
      - rsi: 1
  - label: "Sell"
    cold:
      - rsi: 0
      - rsi: 1
velajos commented 3 years ago

Hi @w1ld3r,

But there is a problem when you mute the alerts from outside the conditional the way you show me. Because that way you override one of the conditions that I am expecting in the conditional form, so the alert is not generated.

An example to see if I am making myself clear:

I want a Conditional alert when the indicators have the following values A=5 and B=10.

Before the conditional: "A" may be equal to 5 many times, however "B" is not yet equal to 10, so I will not receive the alert yet. Now, suppose that "B" is already equal to 10 and "A" also meets the condition but "A" is muted. In this case I will not receive the Conditional alert.

This situation somehow makes the Conditional lose its essence.

That's why I say that the ideal would be that the silence is generated inside the Conditional, because that way the alerts are not lost.

Then, in order not to lose the Conditional Alerts I must configure the frequency in the Always mode, but it generates me Spam from inside the Conditional.

I hope you understand me. Thank you very much in advance.

Regards

w1ld3r commented 3 years ago

Ok, I understand. I'll implement this functionality ASAP.

velajos commented 3 years ago

Ok, I understand. I'll implement this functionality ASAP.

Great, let me know please

velajos commented 3 years ago

Is it possible to choose how long a notification can be silenced from within the conditional? For example, 1m, 5m, 15m, 30m, etc.

w1ld3r commented 3 years ago

Can you check the new push ?

velajos commented 3 years ago

Can you check the new push ?

How should I configure the config.yml file?

velajos commented 3 years ago

Is it possible to choose how long a notification can be silenced from within the conditional? For example, 1m, 5m, 15m, 30m, etc.

Have you configured anything regarding this functionality? @w1ld3r

w1ld3r commented 3 years ago

There is nothing to configure. I've implement the functionnality you had described here : "Before the conditional: "A" may be equal to 5 many times, however "B" is not yet equal to 10, so I will not receive the alert yet. Now, suppose that "B" is already equal to 10 and "A" also meets the condition but "A" is muted. In this case I will not receive the Conditional alert."

w1ld3r commented 3 years ago

Is it possible to choose how long a notification can be silenced from within the conditional? For example, 1m, 5m, 15m, 30m, etc.

Have you configured anything regarding this functionality? @w1ld3r

I'll use alert_frequency to define a silence time.

velajos commented 3 years ago

Is it possible to choose how long a notification can be silenced from within the conditional? For example, 1m, 5m, 15m, 30m, etc.

Have you configured anything regarding this functionality? @w1ld3r

I'll use alert_frequency to define a silence time.

Ok, let me know so I can try it please

velajos commented 3 years ago

There is nothing to configure. I've implement the functionnality you had described here : "Before the conditional: "A" may be equal to 5 many times, however "B" is not yet equal to 10, so I will not receive the alert yet. Now, suppose that "B" is already equal to 10 and "A" also meets the condition but "A" is muted. In this case I will not receive the Conditional alert."

I have already tested it and there is an error with the silence duration. For a 15m candlestick analysis the silence is supposed to be 15m, but in this case more than 2 hours elapsed and the alert remained silent.

However, I think that the best thing to do is to let the user decide the duration of the silence as I said before.

w1ld3r commented 3 years ago

For now an alert is silenced if the status (hot or cold) stay unchanged. I'll implement the functionality you suggest when I got time.

velajos commented 3 years ago

For now an alert is silenced if the status (hot or cold) stay unchanged. I'll implement the functionality you suggest when I got time.

I do not understand very well. But for how long is it silenced?

w1ld3r commented 3 years ago

If the status stay the same indefinitely, you'll never receive a notification. For now the algo is: if the status is the same than the last time, don't alert. if the status is different than the last time, send alert. ( + all the conditional notification specifications) (the status is updated every x update_interval)

velajos commented 3 years ago

If the status stay the same indefinitely, you'll never receive a notification. For now the algo is: if the status is the same than the last time, don't alert. if the status is different than the last time, send alert. ( + all the conditional notification specifications) (the status is updated every x update_interval)

ok I understand. But in this new programming now more alerts are lost than before, because the status must first change from hot to cold and then change again from cold to hot so that it can notify again, so the silence time is very long, yesterday I tried and it was not until after 3-4 hours that it notified again, when the ideal would be a minimum time equivalent to the candle interval, for example a notification every 15m.

The idea of the silencing from inside the conditional is that it fulfills exactly the same function as in the original version, that is to say that the duration is the period of the candle. Or that the user can decide how long the notification will be muted, for this case I think it should be independent of the update_interval, because if the update_interval is very long or short, we would be in the same situation. That is to say, if update_interval is very short we would have a lot of spam, if update_interval is very long we would have loss of notifications. Then the best would be an independent variable like alert update_interval.

Hi @w1ld3r, were you able to check anything concerning this issue?

velajos commented 3 years ago

Hi @w1ld3r, any update here? Thanks

Majenunez commented 3 years ago

If the status stay the same indefinitely, you'll never receive a notification. For now the algo is: if the status is the same than the last time, don't alert. if the status is different than the last time, send alert. ( + all the conditional notification specifications) (the status is updated every x update_interval)

Hi, with this format I am only notified once. I tried it for a whole day and it only notified me the first time, I think it should not be like that.

Majenunez commented 3 years ago

If the status stay the same indefinitely, you'll never receive a notification. For now the algo is: if the status is the same than the last time, don't alert. if the status is different than the last time, send alert. ( + all the conditional notification specifications) (the status is updated every x update_interval)

Hi, with this format I am only notified once. I tried it for a whole day and it only notified me the first time, I think it should not be like that.

If the status stay the same indefinitely, you'll never receive a notification. For now the algo is: if the status is the same than the last time, don't alert. if the status is different than the last time, send alert. ( + all the conditional notification specifications) (the status is updated every x update_interval)

Hi, with this format I am only notified once. I tried it for a whole day and it only notified me the first time, I think it should not be like that.

In the previous version I had no problem with notifications

w1ld3r commented 3 years ago

Yes it's how it works. When you define alert_frequency: once, you get the notification when the status change. You don't get one notification every x candle_period or every x update_interval, it's the aim of alert_frequency: once. When I have time, I'm going to implement an alert_frequency definition in time period. It's the aim of this ticket. So please be patiente or implement it by yourselfe.

w1ld3r commented 3 years ago

I've looked to implement the alter_frequency time period definition but, it'll be to time consuming to implement it for basic mode. So if you want, I can implement it only for conditional notification. As a reminder this is a fork for contional notification.

velajos commented 3 years ago

I've looked to implement the alter_frequency time period definition but, it'll be to time consuming to implement it for basic mode. So if you want, I can implement it only for conditional notification. As a reminder this is a fork for contional notification.

If only for conditional notification it would be fine.

In that version will it be possible to choose the time of silence? As I told you before

w1ld3r commented 3 years ago

You will be able to choose the alert frequency. Like if alter_frequency: 15m you will receive an alert every 15 minutes.

w1ld3r commented 3 years ago

Done for normal mode and conditional mode. Hope it'll works on your side.

w1ld3r commented 2 years ago

@Juanjacinto123, are you satisfied with the new alert frequency implementation ?