# Alpaca (stocks/crypto)

### **!!! Alpaca does not return any data on crypto fees.**

**Fees are calculated based on Tier 1 of** [**this page**](https://docs.alpaca.markets/docs/crypto-fees)**.** **If your trading volume is above tier 1, you will end up with left over dust that the bot will not recognize and will not sell.**

***

## Stocks

Stock trading is supported through the [alpaca.markets](https://alpaca.markets) brokerage.

* Taking profit as crypto (or stock shares in this case) is not supported.
* Fractional shares are not supported so your size must be more than the cost of 1 share.
* Live data is required from Alpaca for accurate size and price calculations which currently costs $9/mo or $99/yr. If you use the bot without data, the initial price calculation could be incorrect resulting in an instant fill.
* It is recommended to only trade index funds and not individual stocks. Risk is significantly higher on single stocks.

<figure><img src="/files/YZmoqcP9rW5LBxcCJYzG" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/vU1BF16kBwSuPrYReMxy" alt=""><figcaption></figcaption></figure>

1. Copy the *API Key ID* and *Secret Key* into the `phBot.ini` file under `Alpaca`.
2. Set `Enabled` to `true`

If you do not have more than $25,000 in your account, you should block trade entries and exits to prevent becoming a pattern day trader.

**Symbol Example**

```
SPY
```

**Sandbox**

See below.

## Crypto

1. Copy the *API Key ID* and *Secret Key* into the `phBot.ini` file under `Alpaca Crypto`.
2. Set `Enabled` to `true`

**Symbol Example**

```
BTC/USD
```

**Sandbox**

* `https://paper-api.alpaca.markets`
* <https://docs.alpaca.markets/docs/paper-trading>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://crypto.phbot.org/exchanges/alpaca-stocks-crypto.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
