I hereby claim:
- I am lvthillo on github.
- I am lorenzvanthillo (https://keybase.io/lorenzvanthillo) on keybase.
- I have a public key ASCxoQXt1LCgXLl4AZou66Kl5EfUbtSlFcZD27JrJRa2kQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| signal = stock_data['macds'] # Your signal line | |
| macd = stock_data['macd'] # The MACD that need to cross the signal line | |
| advice = ["No data"] # Since you need at least two hours in the for loop | |
| for i in range(1, len(signal)): | |
| # If the MACD crosses the signal line upward | |
| if macd[i] > signal[i] and macd[i - 1] <= signal[i - 1]: | |
| advice.append("BUY") | |
| # The other way around | |
| elif macd[i] < signal[i] and macd[i - 1] >= signal[i - 1]: |
| # Calculate RSI | |
| stock_data['rsi_14'] | |
| print(stock_data) | |
| # Get most recent RSI value of our data frame | |
| # In our case this represents the RSI of the last 15 min | |
| last_rsi = stock_data['rsi_14'].iloc[-1] | |
| print(last_rsi) |
| # stock_data contains historical data of ETH/BTC with a period of 1 hhour | |
| # the volume is calculated by using historical data | |
| # run this as close to each 1h interval (e.g. 7.59h or 9.59m) | |
| last_items = stock_data.tail(24) | |
| print(last_items) | |
| day_volume_self_calculated = last_items['volume'].sum() | |
| print(day_volume_self_calculated) | |
| # better way to do it | |
| ticker = exchange.fetch_ticker(coin_pair) |
| import ccxt | |
| import os | |
| import re | |
| import time | |
| import pandas as pd | |
| from stockstats import StockDataFrame as Sdf | |
| def get_historical_data(coin_pair, timeframe): | |
| """Get Historical data (ohlcv) from a coin_pair |
| import ccxt | |
| import os | |
| import re | |
| # configure exchange | |
| exchange = getattr(ccxt, 'binance')({ | |
| 'apiKey': os.environ['APIKEY'], | |
| 'secret': os.environ['SECRET'], | |
| 'timeout': 10000, | |
| 'enableRateLimit': True |
| import ccxt | |
| import os | |
| # configure exchange | |
| exchange = getattr(ccxt, 'binance')({ | |
| 'apiKey': os.environ['APIKEY'], | |
| 'secret': os.environ['SECRET'], | |
| 'timeout': 10000, | |
| 'enableRateLimit': True | |
| }) |
| import json | |
| import boto3 | |
| client = boto3.client('sns') | |
| mesg = json.dumps({ | |
| "default": "default", | |
| "body": "this is a test" | |
| }) | |
| response = client.publish( |
| GreenHighQueueSubscription: | |
| Type: AWS::SNS::Subscription | |
| Properties: | |
| Endpoint: !GetAtt GreenHighQueue.Arn | |
| Protocol: sqs | |
| FilterPolicy: | |
| color: | |
| - green | |
| number: | |
| - numeric: |
| BlueYellowQueueSubscription: | |
| Type: AWS::SNS::Subscription | |
| Properties: | |
| Endpoint: !GetAtt BlueYellowQueue.Arn | |
| Protocol: sqs | |
| FilterPolicy: | |
| color: | |
| - blue | |
| - yellow | |
| RawMessageDelivery: True |