speed = (arctan(h/b)/90) * (h/b)
Scale
Slow 0 =< speed
High 1 =< speed
| $ git remote rm origin | |
| $ git remote add origin [email protected]:aplikacjainfo/proj1.git | |
| $ git config master.remote origin | |
| $ git config master.merge refs/heads/master |
| import talib | |
| import statsmodels.api as sm | |
| import pandas as pd | |
| def initialize(context): | |
| context.security = symbol('AAPL') | |
| #set_universe(universe.DollarVolumeUniverse(floor_percentile=98.0,ceiling_percentile=100.0)) | |
| def bar_data(OHLC_type, bars_nr): | |
| bar_data_func = (history((bars_nr + 1), '1d', OHLC_type).iloc[0]).astype('float') |
| endtime = time.time() + 60 | |
| while time.time() < endtime: | |
| value = datetime.utcnow().strftime("%S") | |
| entTime = int(value) | |
| print(60 - entTime) | |
| time.sleep(1) | |
| if entTime == 0: | |
| break | |
| ############ SAME THING ############# | |
| currentTime = datetime.utcnow().strftime("%M") |
| import datetime | |
| datetime.datetime.utcnow().strftime('%s.%f') | |
| #1526127635.078271 | |
| str(datetime.datetime.utcnow()) | |
| #2018-05-12 15:20:35.078341 | |
| datetime.strptime(str(datetime.utcnow()),"%Y-%m-%d %H:%M:%S.%f").strftime('%s.%f') | |
| #'1526189163.717260' |
| sd = [{'id': 'e270648a-d4c3-4c04-8bb8-65fbb304d6c8', 'price': '9060.00000000', 'size': '0.20000000', 'product_id': 'BTC-USD', 'side': 'sell', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': True, 'created_at': '2018-03-22T03:34:41.985706Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'open', 'settled': False}, | |
| {'id': '8c13b41f-2037-4a6a-b7e2-f02e06c3b10e', 'price': '9238.58000000', 'size': '0.50000000', 'product_id': 'BTC-USD', 'side': 'sell', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': True, 'created_at': '2018-03-14T04:03:01.41252Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'active', 'settled': False}, | |
| ] | |
| for i in range(len(sd)): | |
| if sd[i].get('price') and sd[i].get('status')=='active': | |
| entryPrice = sd[i].get('price') | |
| entryPrice = float(entryPrice) | |
| if entryPrice > 9100: | |
| fd = sd[i].get('id') |
speed = (arctan(h/b)/90) * (h/b)
Scale
Slow 0 =< speed
High 1 =< speed
| # Customize BASH PS1 prompt to show current GIT repository and branch. | |
| # by Mike Stewart - http://MediaDoneRight.com | |
| # SETUP CONSTANTS | |
| # Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
| # I don't remember where I found this. o_O | |
| # Reset | |
| Color_Off="\[\033[0m\]" # Text Reset |
| ####################### MODELS ########################## | |
| class ModelAuthor(models.Model): | |
| username = models.CharField(max_length=150, null=False, blank=False) | |
| def __str__(self): | |
| return self.username # This gets called for example when you create an user input, the text shown is the returned string | |
| class ModelPost(models.Model): | |
| title = models.CharField(max_length=200) |
| from django.contrib.auth.decorators import login_required | |
| from django.shortcuts import render, redirect | |
| from django.views.generic import TemplateView | |
| from django.utils.decorators import method_decorator | |
| from django.conf import settings | |
| from django.contrib.auth.mixins import LoginRequiredMixin | |
| from django.shortcuts import reverse | |
| def restricted_view_manual(request): |
This repository is created to save you from some of the common problems that occur during the development of a django app.
DEBUG = Trueto DEBUG = False in settings.py fileSome of the hacks you might not know