Skip to content
Permalink
Browse files

structuring

  • Loading branch information
ranaroussi committed Nov 12, 2019
1 parent 9584990 commit b7a805aa13eab10611a66b775e4fc699f7f2b513
@@ -0,0 +1 @@
pytrade/_version.py export-subst
@@ -10,10 +10,5 @@ dist
!/docs/build/epub/*.epub
pytrade.egg-info
PyTrade.egg-info
Icon
/sql-aggregate.txt
/tests
.vscode
nosy.py
Icon

@@ -3,4 +3,6 @@ include LICENSE.txt

# Include the data files
include qtpylib/schema.sql
recursive-include qtpylib/_webapp *
recursive-include qtpylib/_webapp *include versioneer.py
include pytrade/_version.py
include versioneer.py
@@ -0,0 +1,72 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
- partner with hosting
- create marketplace with monthly plans
- sell data (eodhistoricaldata.com whitelabel?)
- offer online research environment recipes for AWS/GCP
- offer web-based IDE?
- write core components in cython
framework = pytrade
saas = quantual.com
https://quantual.com/user/ranaroussi
https://quantual.com/research
https://quantual.com/posts/92b6b3693e4c4a4d86693ba57ec9b3fb
https://quantual.com/about
https://quantual.com/docs
https://quantopian.com/opensource
https://status.quantual.com
"""

from dataclasses import dataclass


from pytrade import Pipeline, Universe

# from pytrade.feeds import (
# ibgw, ibws, quandl, iex, yahoo, alpaca, iqfeed, bitmex
# )

from pytrade import feeds, brokers, portfolio
from pytrade.pipelines import SP500
from pytrade.calendars import earnings, splits, holidays
from pytrade.plugins import stocktwits

# custom contributors
from pytrade.contrib.pipelines import rans_daily_picks
from pytrade.contrib.plugins import portfolio


def make_pipeline():
universe = SP500(feeds.alpaca)

prices = universe.get_history(interval="1d", period=100, adjusted=True)
premarket = universe.get_premarket()

gap = premarket > prices['close']
bullish = prices['close'] > prices['close'].mean()

# Return Pipeline containing latest closing price
return Pipeline(
data={
'price': premarket,
'bullish': bullish
},
screen=gap
)

if __name__ == "__main__":
pass
@dataclass
class universe:
'''Class for keeping track of an item in inventory.'''
name: str
unit_price: float
quantity_on_hand: int = 0

def total_cost(self) -> float:
return self.unit_price * self.quantity_on_hand
@@ -19,5 +19,8 @@
# limitations under the License.
#

__version__ = '0.0.1'
__author__ = 'Ran Aroussi'

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

0 comments on commit b7a805a

Please sign in to comment.
You can’t perform that action at this time.