Some notes from today

We’ve all been here, creating an algorithm, testing it on paper, and then encountering a minor market change that disrupts our system’s performance.

Well, I’ve been diligently testing everything, and I must say, I might be onto something. I never gave up.

Today, amidst the market correction, I want to share some notes as I continue perfecting my algorithmic trading platform. As I start to observe market corrections, I see an opportunity to mitigate losses and potentially profit from short positions. More on that later.

The idea I want to highlight is the ability to reduce exposure to the markets by adjusting positions according to an index value. Here’s a glimpse of what I do, expected to be ready by November:

  • SPY VALUE… OK -0.64
  • DIA VALUE… OK -0.62
  • IWM VALUES… OK -1.14

NSPY_INDEX: 3
DSPY_INDEX: -2.4
Overall Index: -0.8

The -0.8 index value provides a broad perspective on the market and is used to determine risk sizing direction. For instance, if the market index is above 0.5, it triggers regular order flow. If it’s below, it adjusts the order flow to initiate short positions (selling first to buy back later).

These are just notes on my current approach. Feel free to ask any questions.

How do you plan to mitigate Alpaca’s shorting fees? Just shorting a couple shares a day leads to $50-$100 in fees every month.

i believe that’s only if you go over margin there would be a fee

"Please note that if you hold short positions as of a Friday settlement date, you will incur stock borrow fees for 3 days (Friday, Saturday and Sunday).

Stock borrow fees are charged in the nearest round lot (100 shares) regardless of how many shares were actually shorted. This is because stocks are borrowed in round lots."

Margin and Short Selling.

Thank you for the insight. I’m open to any comments and will be implementing programming development changes on our end as we see fit. Like this one, sorry for the oversight on that.

@kris @grathan is correct regarding short borrow fees. They can add up and aren’t simulated in paper trading. When you migrate to live they may come as a shock/surprise.

The biggest issue is one must borrow shares in round lots of 100 on Alpaca (other brokers may not impose that constraint). So, even if you short 1 share, you need to borrow 100 shares first. That effectively would increase your borrow fees for that single share x100. if one is paying a typical annual borrow fee of 2.5% that effectively becomes 250%. Another cost which isn’t simulated in paper trading are dividends paid when shorting. If a dividend is paid while one holds a short position in that symbol, then one owes the lender of the shares that dividend.

To minimize borrow fees, one should trade in round lots of 100. Note that borrow fees are only assessed if a short position is held overnight. If one opens and closes a short position the same day then there are no borrow fees. Of course opening and closing a position in the same day is ‘day trading’ and one needs to maintain an account equity of $25,000 to day trade.