Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api historical trigger occurrencies #984

Merged
merged 28 commits into from Feb 22, 2019
Merged

Conversation

tspenov
Copy link
Contributor

@tspenov tspenov commented Feb 12, 2019

daily_active_addresses

 {
  historicalTriggerPoints(
    cooldown:"2d"
    settings: "{\"channel\":\"telegram\",\"percent_threshold\":200.0,\"repeating\":false,\"target\":\"naga\",\"time_window\":\"30d\",\"type\":\"daily_active_addresses\"}"
  )
}
...
      {
        "active_addresses": 17,
        "datetime": "2019-01-10T00:00:00Z",
        "percent_change": -30,
        "price": 0.07062305541440246,
        "triggered?": false
      },
      {
        "active_addresses": 12,
        "datetime": "2019-01-11T00:00:00Z",
        "percent_change": -50,
        "price": 0.0656760396585122,
        "triggered?": false
      },
      {
        "active_addresses": 193,
        "datetime": "2019-01-12T00:00:00Z",
        "percent_change": 718,
        "price": 0.07118857891523572,
        "triggered?": true
      },

price_absolute_change

 {
  historicalTriggerPoints(
    cooldown: "1h"
    settings: "{\"channel\":\"telegram\",\"above\":0.400417,\"repeating\":false,\"target\":\"santiment\",\"type\":\"price_absolute_change\"}"
  )
}
      {
        "datetime": "2019-02-20T07:00:00Z",
        "price": 0.5267121707551666,
        "triggered?": true
      },
      {
        "datetime": "2019-02-20T08:00:00Z",
        "price": 0.5307551205455,
        "triggered?": false
      },
      {
        "datetime": "2019-02-20T09:00:00Z",
        "price": 0.5335671901080714,
        "triggered?": true
      },
      {
        "datetime": "2019-02-20T10:00:00Z",
        "price": 0.5369475239806667,
        "triggered?": false
      }

price_percent_change

 {
  historicalTriggerPoints(
    cooldown:"1h"
    settings: "{\"channel\":\"telegram\",\"percent_threshold\":5.0,\"repeating\":false,\"target\":\"santiment\",\"time_window\":\"1h\",\"type\":\"price_percent_change\"}"
  )
}
{
      {
        "datetime": "2018-11-25T11:00:00Z",
        "percent_change": 6.0,
        "price": 0.2235804541695652,
        "triggered?": true
      },
      {
        "datetime": "2018-11-25T12:00:00Z",
        "percent_change": 1.0,
        "price": 0.22570803848636364,
        "triggered?": false
      },
      {
        "datetime": "2018-11-25T13:00:00Z",
        "percent_change": 0.0,
        "price": 0.22634788076956525,
        "triggered?": false
      },
...

@tspenov tspenov added the WIP label Feb 12, 2019
@IvanIvanoff
Copy link
Member

@tspenov maybe we need to start separating the functions into modules, i.e. one for current and one for historical calculations

@tspenov tspenov force-pushed the api-historical-trigger-occurencies branch from 74a70a4 to b97ba8c Compare February 14, 2019 12:30
@tspenov tspenov removed the WIP label Feb 15, 2019
@IvanIvanoff
Copy link
Member

One crucial part that I see missing is the cooldown. IMO it should be implemented in the evaluator - if a point is triggered, you need to jump over time_window interval of points, otherwise it is not understandable when it will trigger

@tspenov tspenov force-pushed the api-historical-trigger-occurencies branch from 02feb27 to 8a09e10 Compare February 20, 2019 07:49
@tspenov tspenov force-pushed the api-historical-trigger-occurencies branch from 5cc5c16 to e9f9db0 Compare February 22, 2019 09:25
@tspenov tspenov merged commit f08e227 into master Feb 22, 2019
@tspenov tspenov deleted the api-historical-trigger-occurencies branch February 22, 2019 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants