Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 76 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,45 @@ Development branch to testing new features. This develop version has a lot of im
- New indicator StochRSI Cross
- New indicator Sqzmon - Squeeze Momentum Indicator
- New option to customize ichimoku strategies and added chikou span
- New indicator siiv (Signed Increase In Volume) It is a slightly revised version of iiv. It shows the direction of price chage also.


## Installing And Running
Because this is a development branch you need to build your custom Docker image. The commands listed below are intended to be run in a terminal.

Be sure you have git installed in your system.

1. Clone this repo `git clone https://github.com/CryptoSignal/crypto-signal.git`
1. Clone this repo `git clone https://github.com/ahmetax/Crypto-Signal.git`

1. Enter to cripto-signal folder `cd crypto-signal`
2. Enter to cripto-signal folder `cd Crypto-Signal`

1. Switch to develop branch `git checkout develop`
3. Switch to develop branch `git checkout newsiiv`

1. Create a config.yml file and put it into "app" folder.
4. Create a config.yml file and put it into "app" folder.

1. Build your own Docker image, for example, `docker build -t dev/crypto-signals:latest .`
5. Build your own Docker image, for example, `docker build -t dev/crypto-signals:latest .`

1. For testing and debugging run docker with "-t" option `docker run --rm -ti -v $PWD/app:/app dev/crypto-signals:latest`
6. For testing and debugging run docker with "-t" option `docker run --rm -ti -v $PWD/app:/app dev/crypto-signals:latest`

1. For production run in daemon mode using "-d" option `docker run --rm -di -v $PWD/app:/app dev/crypto-signals:latest`
7. For production run in daemon mode using "-d" option `docker run --rm -di -v $PWD/app:/app dev/crypto-signals:latest`

8. If you want to run the script without docker, do the following intesd of items 5, 6, and 7:

9. python3 -m venv env

10. source env/bin/activate

11. pip install --upgrade pip

12. cd app

13. pip install -r requirements-step-1.txt

14. pip install -r requirements-step-2.txt

15. In order to run: python app.py

(Note: Give enough permissions to the chart directory and the files in it. )


### Configuring config.yml
Expand Down Expand Up @@ -371,6 +390,50 @@ indicators:

Of course, this indicator can be used in other candle periods, 15m, 1h.. etc.

#### Signed Increase In Volume indicator - siiv

There is a new indicator called "siiv". It is a slightly revised version of "iiv" indicator. The hot value is 10 by default, and cold value is -10. The strength is calculated as IIV, then the direction of changes in price is added as the sign.

The main idea is to try to identify a possible pump or dump.

```
indicators:
siiv:
- enabled: false
alert_enabled: true
alert_frequency: always
signal:
- siiv
hot: 10
cold: -10
hot_label: ' Increase in Volume Uptrend'
cold_label: ' Increase in Volume Downtrend'
candle_period: 5m
chart: true
- enabled: true
alert_enabled: true
alert_frequency: always
signal:
- siiv
hot: 10
cold: -10
hot_label: ' Increase in Volume Uptrend'
cold_label: ' Increase in Volume Downtrend'
candle_period: 15m
chart: true
```

If you don't want to receive such notifications just disable the siiv indicator in your config file.

```
indicators:
siiv:
- enabled: false
candle_period: 15m
```

Of course, this indicator can be used in other candle periods, 5m, 1h.. etc.

#### Moving Average Ribbon

First, read the following link to know about what it is:
Expand All @@ -391,7 +454,7 @@ indicators:
hot: 10
cold: -10
hot_label: 'Uptrend is coming'
cold_label: 'Downtred is coming'
cold_label: 'Downtrend is coming'
candle_period: 15m
pval_th: 20
ma_series: 5, 15, 25, 35, 45
Expand Down Expand Up @@ -421,7 +484,7 @@ indicators:
- open
- close
hot_label: 'Uptrend is coming'
cold_label: 'Downtred is coming'
cold_label: 'Downtrend is coming'
indicator_label: 'EMA 50/100 Cross'
```

Expand Down Expand Up @@ -496,7 +559,7 @@ indicators:
- macd
- signal
hot_label: 'Uptrend is coming'
cold_label: 'Downtred is coming'
cold_label: 'Downtrend is coming'
indicator_label: 'MACD Cross 4h'
mute_cold: false
```
Expand All @@ -518,7 +581,7 @@ indicators:
- smooth_k
- smooth_d
hot_label: 'Uptrend is coming'
cold_label: 'Downtred is coming'
cold_label: 'Downtrend is coming'
indicator_label: 'StochRSI Cross 4h'
mute_cold: false
```
Expand Down Expand Up @@ -604,7 +667,7 @@ indicators:
hot: true
cold: true
hot_label: 'Uptrend is coming'
cold_label: 'Downtred is coming'
cold_label: 'Downtrend is coming'
candle_period: 4h
indicator_label: 'Ichimoku'
```
Expand Down Expand Up @@ -645,7 +708,7 @@ indicators:
hot: true
cold: true
hot_label: 'Uptrend is coming'
cold_label: 'Downtred is coming'
cold_label: 'Downtrend is coming'
candle_period: 4h
indicator_label: 'Ichimoku'
```
Expand Down
2 changes: 2 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ config.json
__pycache__
*.pyc
venv
config.yml

1 change: 1 addition & 0 deletions app/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def indicator_dispatcher(self):
'stoch_rsi': stoch_rsi.StochasticRSI().analyze,
'obv': obv.OBV().analyze,
'iiv': iiv.IIV().analyze,
'siiv': siiv.SIIV().analyze,
'ma_ribbon': ma_ribbon.MARibbon().analyze,
'ma_crossover': ma_crossover.MACrossover().analyze,
'bollinger': bollinger.Bollinger().analyze,
Expand Down
1 change: 1 addition & 0 deletions app/analyzers/indicators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'mfi',
'obv',
'iiv',
'siiv',
'ma_ribbon',
'ma_crossover',
'bollinger',
Expand Down
47 changes: 47 additions & 0 deletions app/analyzers/indicators/siiv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
""" Custom Indicator Increase In Volume
"""

import numpy as np
from scipy import stats

from analyzers.utils import IndicatorUtils

"""
name: ahmet aksoy
date: 2022-11-20
siiv: Signed Increase In Volume
"""
class SIIV(IndicatorUtils):
def analyze(self, historical_data, signal=['siiv'], hot_thresh=10, cold_thresh=-10):
"""Performs an analysis about the increase in volumen on the historical data

Args:
historical_data (list): A matrix of historical OHCLV data.
signal (list, optional): Defaults to siiv. The indicator line to check hot against.
hot_thresh (float, optional): Defaults to 10.
cold_thresh: Unused


Returns:
pandas.DataFrame: A dataframe containing the indicator and hot/cold values.
"""

dataframe = self.convert_to_dataframe(historical_data)

z = np.abs(stats.zscore(dataframe['volume']))
filtered = dataframe.volume[(z < 3)]

previous_mean = filtered.mean()
price_change = dataframe.close[-1] - dataframe.close[-2]

if price_change>=0:
dataframe[signal[0]] = dataframe['volume'] / previous_mean
else:
dataframe[signal[0]] = -dataframe['volume'] / previous_mean

dataframe['is_hot'] = False
dataframe['is_cold'] = False
dataframe['is_hot'] = dataframe[signal[0]] >= hot_thresh
dataframe['is_cold'] = dataframe[signal[0]] <= cold_thresh

return dataframe
23 changes: 23 additions & 0 deletions app/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,29 @@ indicators:
hot: 5
cold: 0
candle_period: 5m
siiv: # working
- enabled: false
alert_enabled: true
alert_frequency: always
signal:
- siiv
hot: 10
cold: -10
hot_label: ' Increase in Volume Uptrend'
cold_label: ' Increase in Volume Downtrend'
candle_period: 5m
chart: true
- enabled: true
alert_enabled: true
alert_frequency: always
signal:
- siiv
hot: 10
cold: -10
hot_label: ' Increase in Volume Uptrend'
cold_label: ' Increase in Volume Downtrend'
candle_period: 15m
chart: true
informants:
lrsi:
- enabled: true
Expand Down
Loading