I have some questions regarding the rules surrounding pattern day trading, margin, and day trade buying power and how they interact with each other. Assume to following scenario:

• The account is a margin account.
• The account has \$30,000 USD in cash.
• The account has been flagged as a pattern day trading account.
• The account will be flat at market open and market close every day.

Initially I was under the impression that day trade buying power was simply the equity of the account at previous day close multiplied by 4, and this is reflected as my "Day Trade Buying Power" in my trading software (\$120,000). Moreover, I was under the impression that this number is the maximum value of stocks I am allowed to purchase between my equity and my margin. However, I tried to purchase ~\$100,000 of SPXL and it was rejected (`REJECTED: Your buying power will be below zero (\$60,501.87) if this order is accepted.`). Since then I have been trying find what exactly is the amount of stock I can purchase and what I have found is rather unclear.

FINRA says this:

The rules permit a pattern day trader to trade up to four times the maintenance margin excess in the account as of the close of business of the previous day.

My broker (TD Ameritrade) gives this in their Margin Handbook (PDF):

Example: An account that has a cash balance of \$40,000 and no positions in the account could have access to \$160,000 in day trade buying power (\$40,000 x 4 = \$160,000). - page 6, top of first column

and later on the same page gives this as an example:

FINRA also has this to say:

In general, under Federal Reserve Board Regulation T, firms can lend a customer up to 50 percent of the total purchase price of a margin security for new, or initial, purchases.

I'm not sure how these all fit together. Questions I have specifically in addition to any extra insights:

• Stock XYZ is trading at \$100/share. What is the maximum number of shares I can purchase XYZ at this price?
• How is the above number calculated?
• Does this calculation apply to purchasing multiple different stocks at the same time (eg buying x shares of XYZ and y shares of ABC)?
• What is day trade buying power actually referring to and how do I utilize it?
• What is FINRA referring to when they talk about "four times the maintenance margin excess"?