hackingthemarkets / fullstack-trading-app Goto Github PK
View Code? Open in Web Editor NEWA full stack Python app for trading using the Alpaca API
A full stack Python app for trading using the Alpaca API
If anyone is using MYSQL rather than SQLite I was able to get the new_closing_highs to work and grab the correct date by using the following command: ( to do the new_closing_lows version swap MAX with MIN )
elif stock_filter == 'new_closing_highs':
# The inner join here allows us to grab the whole row with the proper date for MAX(close)
cursor.execute("""
SELECT * FROM (
SELECT symbol, name, t1.stock_id, t1.close, t1.date
FROM stock_price t1
JOIN stock ON stock.id = t1.stock_id
INNER JOIN
(
SELECT stock_id, MAX(close) as max_close
FROM stock_price
GROUP BY stock_id
) t2
ON t1.stock_id = t2.stock_id AND t1.close = t2.max_close
) AS t
WHERE date = %s;
""", (date.today().isoformat(),))
I'm not sure, but I guess we shouldn't use date.today() to get current_date for "{current_date} 09:30:00-04:00"
date.today() will give you the local current date and at some time of the day (or night) it will be different with the US/Eastern date.
As long as we are using pytz for the is_dst hack, I would suggest to use it this way to sync with 'US/Eastern':
current_datetime = datetime.datetime.now(pytz.timezone('US/Eastern'))
utcoffset = str(current_datetime)[-6:]
current_date = current_datetime.date().isoformat()
start_minute_bar = f"{current_date} 09:30:00{utcoffset}"
if previous_candle.low equal current_candle.close it gets this error
Could not submit order stop price must not be greater than base price / 1.001
I've noticed, some of my orders got expired and wasn't sold by the end of the day.
I guess we need a way to prolongate the orders if they were not filled for some reason
Having issue populating prices on weekend as
if len(recent_closes) >= 50 and date.today().isoformat() == bar.t.date().isoformat():
is looking for today's date and not calculating any of the indicators
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.