I want to help Noobs!

@oliver Yes, you could use an Alpaca to get access to market data.

Hi, I have a question around data - I look at 4 hour charts and the signals I’m looking to trade on are more in the 4 hour sets, vs looking at the 1 hour or greater resolution. I’m struggling with how to get that resolution; would I get hourly data and just filter out every 4th hour and filter that out? Not sure what the best strategy there is… and then, how to even call that via alpaca/polygon?

@nabeel, it all depends on what information you require at the end of the 4H Mark. If you only care for the price every 4h then you need to simply query every 4h for the price and take it from there.

If you need OHLC then you should probably write some sort of consolidator logic and query every 4 hours, asking for the last 4 hours and consolidate them into a single candle.

1 Like

I’d like to talk with you about my system if you are interested and available. I have a good system which is working but I’m not a programmer and don’t want to acquire that skill. Thank you in advance!

Doug Small

@joshcogburn Hiya from another Josh :slight_smile:
If you’re still helping noobs, I’m having a weird problem with the Momentum Trading Example script. It starts fine, but it randomly dies with this message:

File “D:\Josh\Work\Programming\Python\stock_picker\alpaca_momentum_script\main.py”, line 424, in
run(get_tickers(), market_open, market_close)
File “D:\Josh\Work\Programming\Python\stock_picker\alpaca_momentum_script\main.py”, line 383, in run
run_ws(conn, channels)
File “D:\Josh\Work\Programming\Python\stock_picker\alpaca_momentum_script\main.py”, line 389, in run_ws
conn.run(channels)
File “C:\Python38\lib\site-packages\alpaca_trade_api\stream2.py”, line 276, in run
loop.run_until_complete(self.consume())
File “C:\Python38\lib\asyncio\base_events.py”, line 616, in run_until_complete
return future.result()
asyncio.exceptions.CancelledError

Any idea what’s happening? I’m running it on Windows 10 with Python 3.8. I have a Task Scheduler thing auto-start it at 9:35 AM, then I leave it running to get streaming updates.

Thanks!

@joshcogburn - looking for some help coding or even pseudo-code .

My algo currently iterates through ten stocks, pulling the last 10 minutes of trades from api.polygon.historic_trades_v2. I then analyze the data for buy/sell signals.
It currently takes 15 to 30 seconds to iterate through, and I think I could gain a lot of efficiency by storing the last 10 minutes of trade data, then on the next iteration (that is 15 seconds later), calling the API for only the next 15 seconds worth of data.

I’m looking for help with:

  • Storing the 10 mins of trades in a dict (I think)
  • On the next iteration, pulling the most recent timestamp from that dict for that stock, so that I can use that as the _from timestamp in the next call
  • Append/update the dict with the new trades
  • Remove trades that are > 10 minutes old so that the dict doesn’t become too large over the course of a trading day

@joshcogburn I would love a little help with some basics on opening a stream. I would like to stream activity for a certain symbol. How do i do that in python? I have a bit of python experience. What is returned down the steam (an object?) and how do i use it?

Thanks for your willingness to help us newbies out!

Randy

were you able to figure this out? I am having the same issue.

Thanks

Hi Kris,
I am interested to know how well is your platform is doing after several months.
I am writing my own platform in Python and would be interested to know more about yours.

Thanks.

Hi guys, I am trying to figure out the formula for calculating the profit and loss, on the account level. Based on average price I guess.
I have a ledger based system - e.g. user buys 3 AMZN at $3.000, than buys 2.8 AMZN at $2.900 and than sells 1.4 AMZN at $3.005, it is all calculated and written into the same ledger. No positions.

Can anyone assist?

Thanks

i moved to a completely different system, steady gains…

Thanks for your reply, do you mind sharing?

Hi everybody!
I would like to run the famous Hitoshi’s HFT-ish algo in paper trading, but I only have a paper trading account and not a funded brokerage account and I’m no US resident, so I suppose I can’t access Polygon data, not even in paper trading, right?.
Is there a way to test an hft algorithm like this in paper trading?

Did you guys fix the integration with Zapier for paper accounts? I have some algo routines that I’ll like to tryout before going live. Getting “message”: “access key verification failed : access key not found (Code = 40110000)” error with Postman and “invalid authorization header value format” error in Zapier. Thanks!

@ldonny No sorry, Zapier currently only integrates live accounts and not paper accounts.

One workaround (which you may already have done) would be to use Zapier to interface to a Google sheet then have the Google sheet interact with a paper account. There is step by step info on getting Google sheets to talk to Alpaca here. It’s of course an extra step but it may help?

You’re really generous with your offer and I want you to know you’re appreciated.

I ran the Scalping algorithm written by Hitoshi Harada that you list and it seems to have an upper limit of about a dozen symbols. I would like to test this with a larger list (thinking that would help the win/loss rate) but can’t get it to run if I bog it down with too many.

Any thoughts on this issue?

I can’t buy any stocks. Please help me!!

@Bmoney There was a failure this morning with the systems which handle messaging (eg orders and responses from Alpaca’s execution partners). The systems restarted, but time was spent manually checking to ensure no orders which were ‘canceled’ actually were executed. It turned out to not be the case and all pending cancel orders were manually cleared. There will be a better summary updated on the status page later today.

sounds like your busy fixing a mess over there

Hi Friends,
Can you share Blog posts \ Videos that show how to build a simple stock quoting and, to lesser extent trading, app using PHP and React and Alpaca API? Please point me in the right direction. This is for a computer science college course.

MVP for this project is a page with an input box where a ticker symbol is submitted and using Alpaca API returns a ticker quote, super simple.

Thanks!