We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,signal_index,signal_direction,signal_definition | |
1,0,positive,"macd histogram(12,26,9) > 0 and slope of macd histogram(12,26,9) over 1 period crosses below 0" | |
3,1,positive,"macd histogram(12,26,9) > 0 and slope of macd histogram(12,26,9) over 1 period crosses below 0" | |
5,2,positive,"macd histogram(12,26,9) > 0 and slope of macd histogram(12,26,9) over 1 period crosses below 0" | |
7,3,positive,"macd histogram(12,26,9) > 0 and slope of macd histogram(12,26,9) over 1 period crosses below 0" | |
9,4,negative,"macd histogram(12,26,9) < 0 and slope of macd histogram(12,26,9) over 1 period crosses above 0" | |
11,5,negative,"macd histogram(12,26,9) < 0 and slope of macd histogram(12,26,9) over 1 period crosses above 0" | |
13,6,negative,"macd histogram(12,26,9) < 0 and slope of macd histogram(12,26,9) over 1 period crosses above 0" | |
16,7,negative,"macd histogram(12,26,9) < 0 and slope of macd histogram(12,26,9) over 1 period crosses above 0" | |
17,8,negative,"macd histogram(12,26,9) < 0 and slope of macd histogram(12,26,9) over 1 perio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up the color scales | |
bupu = cl.scales['3']['seq']['BuPu'] | |
colorscale = cl.interp( bupu, 16 ) | |
colorscale.reverse() | |
# Create the data structure needed for plotly | |
i=0 | |
data = [] | |
while i < len(test_periods): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for p in test_periods: | |
# Print our progress | |
print('Running test period ' + str(p)); | |
# Create the condition | |
condition = 'price change percentage(1) < ' + str(p) | |
# Form the request | |
request_data = {'symbol':symbol,'condition_id':1,'condition':condition,"periods":periods,'from':usingdatafrom,'to':usingdatato} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
symbol = 'BTC:USD:daily' | |
test_periods = np.arange(-0.10,0,0.02) | |
periods = 45 | |
usingdatafrom = "2017-01-09" | |
usingdatato = "2018-01-09" | |
apikey = "<your_api_key>" # enter your own API key here (to request an API key visit gatsiva.com) | |
data_run_list = [] # List for mean return information | |
obs_num_list = [] # List for storing number of observations in each run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import utility libraries we will need | |
import requests | |
import json | |
import numpy as np | |
import pandas as pd | |
import warnings | |
import colorlover as cl | |
# Import plotly for graphing awesomeness | |
from plotly import __version__ |