Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ on:
push:
branches: [staging, main]

# Serialize deploys per branch. Two pushes in quick succession would otherwise
# run concurrent `aws s3 sync --delete` jobs into the same R2 prefix, where each
# build's --delete removes the other's freshly-uploaded chunks, producing a
# deploy with one build's HTML and another's assets (404'd JS).
concurrency:
group: deploy-docs-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -124,4 +132,9 @@ jobs:
SLACK_NOTIFY_TOKEN: ${{ secrets.SLACK_NOTIFY_TOKEN }}
run: |
curl -s -d "" \
"${SLACK_NOTIFY_URL}?token=${SLACK_NOTIFY_TOKEN}&type=ci_failure&channel=alerts&workflow=${GITHUB_WORKFLOW}&repo=${GITHUB_REPOSITORY}&branch=${GITHUB_REF_NAME}&sha=${GITHUB_SHA:0:7}&run_id=${GITHUB_RUN_ID}"
-H "X-workflow: ${GITHUB_WORKFLOW}" \
-H "X-repo: ${GITHUB_REPOSITORY}" \
-H "X-branch: ${GITHUB_REF_NAME}" \
-H "X-sha: ${GITHUB_SHA:0:7}" \
-H "X-run_id: ${GITHUB_RUN_ID}" \
"${SLACK_NOTIFY_URL}?token=${SLACK_NOTIFY_TOKEN}&type=ci_failure&channel=alerts"
7 changes: 6 additions & 1 deletion .github/workflows/post-deploy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ jobs:
SLACK_NOTIFY_TOKEN: ${{ secrets.SLACK_NOTIFY_TOKEN }}
run: |
curl -s -d "" \
"${SLACK_NOTIFY_URL}?token=${SLACK_NOTIFY_TOKEN}&type=ci_failure&channel=alerts&workflow=${GITHUB_WORKFLOW}&repo=${GITHUB_REPOSITORY}&branch=${GITHUB_REF_NAME}&sha=${GITHUB_SHA:0:7}&run_id=${GITHUB_RUN_ID}"
-H "X-workflow: ${GITHUB_WORKFLOW}" \
-H "X-repo: ${GITHUB_REPOSITORY}" \
-H "X-branch: ${GITHUB_REF_NAME}" \
-H "X-sha: ${GITHUB_SHA:0:7}" \
-H "X-run_id: ${GITHUB_RUN_ID}" \
"${SLACK_NOTIFY_URL}?token=${SLACK_NOTIFY_TOKEN}&type=ci_failure&channel=alerts"
14 changes: 12 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ jobs:
SLACK_NOTIFY_TOKEN: ${{ secrets.SLACK_NOTIFY_TOKEN }}
run: |
curl -s -d "" \
"${SLACK_NOTIFY_URL}?token=${SLACK_NOTIFY_TOKEN}&type=ci_failure&channel=alerts&workflow=${GITHUB_WORKFLOW}&repo=${GITHUB_REPOSITORY}&branch=${GITHUB_REF_NAME}&sha=${GITHUB_SHA:0:7}&run_id=${GITHUB_RUN_ID}"
-H "X-workflow: ${GITHUB_WORKFLOW}" \
-H "X-repo: ${GITHUB_REPOSITORY}" \
-H "X-branch: ${GITHUB_REF_NAME}" \
-H "X-sha: ${GITHUB_SHA:0:7}" \
-H "X-run_id: ${GITHUB_RUN_ID}" \
"${SLACK_NOTIFY_URL}?token=${SLACK_NOTIFY_TOKEN}&type=ci_failure&channel=alerts"

staging-e2e-tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -89,4 +94,9 @@ jobs:
SLACK_NOTIFY_TOKEN: ${{ secrets.SLACK_NOTIFY_TOKEN }}
run: |
curl -s -d "" \
"${SLACK_NOTIFY_URL}?token=${SLACK_NOTIFY_TOKEN}&type=ci_failure&channel=alerts&workflow=${GITHUB_WORKFLOW}&repo=${GITHUB_REPOSITORY}&branch=${GITHUB_REF_NAME}&sha=${GITHUB_SHA:0:7}&run_id=${GITHUB_RUN_ID}"
-H "X-workflow: ${GITHUB_WORKFLOW}" \
-H "X-repo: ${GITHUB_REPOSITORY}" \
-H "X-branch: ${GITHUB_REF_NAME}" \
-H "X-sha: ${GITHUB_SHA:0:7}" \
-H "X-run_id: ${GITHUB_RUN_ID}" \
"${SLACK_NOTIFY_URL}?token=${SLACK_NOTIFY_TOKEN}&type=ci_failure&channel=alerts"
7 changes: 4 additions & 3 deletions .github/workflows/sync-sdk-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ on:
branches: [staging]
paths:
- 'sdk/js/**'
- 'sdk/java/**'
- 'lib/mdx-to-md.js'
- 'scripts/export-sdk-docs.js'
- '.github/workflows/sync-sdk-docs.yml'
workflow_dispatch:
inputs:
sdk:
description: 'Which SDK to sync (pilot: js only)'
description: 'Which SDK to sync'
required: true
default: 'js'
type: choice
options: [js]
options: [js, java]

env:
SOURCE_OWNER: MarketDataApp
Expand All @@ -56,7 +57,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: [js]
sdk: [js, java]
steps:
- name: Checkout documentation source
uses: actions/checkout@v4
Expand Down
38 changes: 38 additions & 0 deletions api/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,44 @@ func main() {
}
```

</TabItem>
<TabItem value="Java" label="Java">

```java title="App.java"
import com.marketdata.sdk.MarketDataClient;
import com.marketdata.sdk.stocks.StockQuoteRequest;

public class App {
public static void main(String[] args) {
// The no-arg constructor reads your token from the MARKETDATA_TOKEN
// environment variable (or a .env file in the working directory).
// Alternatively, pass it directly:
// new MarketDataClient("your_token_here", null, null, true)
try (MarketDataClient client = new MarketDataClient()) {
client.stocks().quote(StockQuoteRequest.of("SPY")).values().forEach(System.out::println);
}
}
}
```

</TabItem>
<TabItem value="Kotlin" label="Kotlin">

```kotlin title="App.kt"
import com.marketdata.sdk.MarketDataClient
import com.marketdata.sdk.stocks.StockQuoteRequest

fun main() {
// The no-arg constructor reads your token from the MARKETDATA_TOKEN
// environment variable (or a .env file in the working directory).
// Alternatively, pass it directly:
// MarketDataClient("your_token_here", null, null, true)
MarketDataClient().use { client ->
client.stocks().quote(StockQuoteRequest.of("SPY")).values().forEach(::println)
}
}
```

</TabItem>
</Tabs>

Expand Down
46 changes: 46 additions & 0 deletions api/funds/candles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,52 @@ $candles = $client->mutual_funds->candles(
// Display formatted candles summary
echo $candles;
```
</TabItem>
<TabItem value="Java" label="Java">

```java title="FundCandles.java"
import com.marketdata.sdk.MarketDataClient;
import com.marketdata.sdk.funds.FundCandlesRequest;
import com.marketdata.sdk.funds.FundResolution;

public class FundCandles {
public static void main(String[] args) {
try (MarketDataClient client = new MarketDataClient()) {
// VFINX is available without authentication (free test symbol).
client.funds()
.candles(FundCandlesRequest.builder(FundResolution.DAILY, "VFINX")
.countback(30)
.build())
.values()
.forEach(System.out::println);
}
}
}
```

</TabItem>
<TabItem value="Kotlin" label="Kotlin">

```kotlin title="FundCandles.kt"
import com.marketdata.sdk.MarketDataClient
import com.marketdata.sdk.funds.FundCandlesRequest
import com.marketdata.sdk.funds.FundResolution

fun main() {
MarketDataClient().use { client ->
// VFINX is available without authentication (free test symbol).
client.funds()
.candles(
FundCandlesRequest.builder(FundResolution.DAILY, "VFINX")
.countback(30)
.build()
)
.values()
.forEach(::println)
}
}
```

</TabItem>
</Tabs>

Expand Down
56 changes: 56 additions & 0 deletions api/markets/status.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,62 @@ $yesterday = $client->markets->status(
);
echo $yesterday;
```
</TabItem>
<TabItem value="Java" label="Java">

```java title="MarketStatusApp.java"
import com.marketdata.sdk.MarketDataClient;
import com.marketdata.sdk.markets.MarketStatusRequest;
import java.time.LocalDate;

public class MarketStatusApp {
public static void main(String[] args) {
try (MarketDataClient client = new MarketDataClient()) {
client.markets()
.status(MarketStatusRequest.builder()
.from(LocalDate.of(2020, 1, 1))
.to(LocalDate.of(2020, 12, 31))
.build())
.values()
.forEach(System.out::println);

client.markets()
.status(MarketStatusRequest.of())
.values()
.forEach(System.out::println);
}
}
}
```

</TabItem>
<TabItem value="Kotlin" label="Kotlin">

```kotlin title="MarketStatusApp.kt"
import com.marketdata.sdk.MarketDataClient
import com.marketdata.sdk.markets.MarketStatusRequest
import java.time.LocalDate

fun main() {
MarketDataClient().use { client ->
client.markets()
.status(
MarketStatusRequest.builder()
.from(LocalDate.of(2020, 1, 1))
.to(LocalDate.of(2020, 12, 31))
.build()
)
.values()
.forEach(::println)

client.markets()
.status(MarketStatusRequest.of())
.values()
.forEach(::println)
}
}
```

</TabItem>
</Tabs>

Expand Down
24 changes: 24 additions & 0 deletions api/options/chain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,30 @@ $calls = $chain->getCalls();
$puts = $chain->getPuts();
$strikes = $chain->getStrikes();
```
</TabItem>
<TabItem value="Java" label="Java">

```java title="OptionChain.java"
import com.marketdata.sdk.MarketDataClient;
import com.marketdata.sdk.options.OptionsChainRequest;

try (MarketDataClient client = new MarketDataClient()) {
client.options().chain(OptionsChainRequest.of("AAPL")).values().forEach(System.out::println);
}
```

</TabItem>
<TabItem value="Kotlin" label="Kotlin">

```kotlin title="OptionChain.kt"
import com.marketdata.sdk.MarketDataClient
import com.marketdata.sdk.options.OptionsChainRequest

MarketDataClient().use { client ->
client.options().chain(OptionsChainRequest.of("AAPL")).values().forEach(::println)
}
```

</TabItem>
</Tabs>

Expand Down
24 changes: 24 additions & 0 deletions api/options/expirations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,30 @@ $expirations = $client->options->expirations("AAPL");
// Display all expiration dates
echo $expirations;
```
</TabItem>
<TabItem value="Java" label="Java">

```java title="OptionExpirations.java"
import com.marketdata.sdk.MarketDataClient;
import com.marketdata.sdk.options.OptionsExpirationsRequest;

try (MarketDataClient client = new MarketDataClient()) {
client.options().expirations(OptionsExpirationsRequest.of("AAPL")).values().forEach(System.out::println);
}
```

</TabItem>
<TabItem value="Kotlin" label="Kotlin">

```kotlin title="OptionExpirations.kt"
import com.marketdata.sdk.MarketDataClient
import com.marketdata.sdk.options.OptionsExpirationsRequest

MarketDataClient().use { client ->
client.options().expirations(OptionsExpirationsRequest.of("AAPL")).values().forEach(::println)
}
```

</TabItem>
</Tabs>

Expand Down
26 changes: 26 additions & 0 deletions api/options/lookup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,32 @@ $lookup = $client->options->lookup("AAPL 7/28/2023 200 Call");
// Display the OCC symbol
echo $lookup;
```
</TabItem>
<TabItem value="Java" label="Java">

```java title="OptionLookup.java"
import com.marketdata.sdk.MarketDataClient;
import com.marketdata.sdk.options.OptionsLookupRequest;

try (MarketDataClient client = new MarketDataClient()) {
System.out.println(client.options().lookup(OptionsLookupRequest.of("AAPL 7/28/2023 200 Call")).values()); // "AAPL230728C00200000"
}
```

</TabItem>
<TabItem value="Kotlin" label="Kotlin">

```kotlin title="OptionLookup.kt"
import com.marketdata.sdk.MarketDataClient
import com.marketdata.sdk.options.OptionsLookupRequest

MarketDataClient().use { client ->
val optionSymbol =
client.options().lookup(OptionsLookupRequest.of("AAPL 7/28/2023 200 Call")).values()
println(optionSymbol) // "AAPL230728C00200000"
}
```

</TabItem>
</Tabs>

Expand Down
24 changes: 24 additions & 0 deletions api/options/quotes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,30 @@ $quotes = $client->options->quotes("AAPL271217C00250000");
// Display formatted quotes with Greeks
echo $quotes;
```
</TabItem>
<TabItem value="Java" label="Java">

```java title="OptionQuotes.java"
import com.marketdata.sdk.MarketDataClient;
import com.marketdata.sdk.options.OptionsQuoteRequest;

try (MarketDataClient client = new MarketDataClient()) {
client.options().quote(OptionsQuoteRequest.of("AAPL271217C00250000")).values().forEach(System.out::println);
}
```

</TabItem>
<TabItem value="Kotlin" label="Kotlin">

```kotlin title="OptionQuotes.kt"
import com.marketdata.sdk.MarketDataClient
import com.marketdata.sdk.options.OptionsQuoteRequest

MarketDataClient().use { client ->
client.options().quote(OptionsQuoteRequest.of("AAPL271217C00250000")).values().forEach(::println)
}
```

</TabItem>
</Tabs>

Expand Down
Loading
Loading