# Relentless: add a "Trade on Relentless" button to a website or app

Instructions for a developer or a coding assistant. Follow them as written; everything needed is on this page.

## What it does

A partner site shows trade ideas (a market, a side, an entry, a take profit, a stop loss). The button under each idea opens Relentless with that trade filled in. The reader signs up or logs in, tops up if needed, picks the amount and leverage, and places the order themselves. Nothing is ever placed automatically.

Every new account that signs up through the partner's button is the partner's: the partner earns 30% of Relentless's trading fee on that account's trades, for as long as it trades (approved Creators up to 60%). The trader pays the standard fee; the partner's share comes out of Relentless's. Existing accounts can use the button but are not counted.

## Before you start

You need the partner's Relentless referral code. The site owner finds it at https://app.relentless.trade/referrals (signed in). If you do not have it, ask the site owner for it; do not invent one. Below it is written YOURCODE.

## Websites: two steps

### 1. Add the script once

Put this in the site's shared layout (the `<head>`, or just before `</body>`), on every page that shows ideas:

```html
<script src="https://app.relentless.trade/embed.js" data-ref="YOURCODE" data-src="SITENAME" async></script>
```

- `data-ref`: the referral code.
- `data-src`: the site's name or domain, letters, digits, `.`, `-` or `_`, at most 40 characters (for example `trendiq.net`). Relentless shows it on the trade ticket ("trendiq.net's trade plan"; partners we know by name get their name) and counts its visits. If left out, the script uses the page's domain.

### 2. Add a button under each idea

```html
<a data-relentless-trade
   data-market="BTC" data-side="long"
   data-entry="65000" data-tp="70000" data-sl="62000"></a>
```

The script turns every element with `data-relentless-trade` into a styled button ("Trade on Relentless") that opens the trade in a new tab. Leave the element empty to get the default look; put your own text or markup inside it and set `data-theme="none"` to keep your own styling.

## Button attributes

| Attribute | Required | Value |
|---|---|---|
| `data-market` | yes | The market. Crypto by its ticker: `BTC`, `ETH`, `SOL`, `HYPE`, `XRP`, `DOGE`… US stocks, ETFs, indices, commodities and FX with the `xyz:` prefix: `xyz:NVDA`, `xyz:TSLA`, `xyz:AAPL`, `xyz:SP500`, `xyz:GOLD`, `xyz:CL` (oil), `xyz:EUR`. The full list is at https://relentless.trade/markets |
| `data-side` | for a plan | `long` or `short` |
| `data-entry` | for a plan | Entry price, a plain number (`65000`, `0.0041`) |
| `data-tp` | for a plan | Take profit |
| `data-sl` | for a plan | Stop loss |
| `data-tp1` | no | A first target to take part of the position at |
| `data-order` | no | `limit` (default: the order rests at the entry), `market` (go now), or `breakout` (wait for a close past the entry) |
| `data-tf` | no | The timeframe the idea was read on: `15m`, `1h`, `4h` or `1d` |
| `data-exp` | no | When the idea expires, in Unix seconds. Default: 24 hours after the click |
| `data-label` | no | The button's text |
| `data-theme` | no | `dark` (default), `light`, or `none` |
| `data-target` | no | `_blank` (default) or `_self` |
| `data-ref`, `data-src` | no | Per button, over the script tag's |

### Rules for a plan

A plan is used only when `data-side`, `data-entry`, `data-tp` and `data-sl` are all present, positive, and on the right sides:

- long: `data-sl` < `data-entry` < `data-tp` (and `data-tp1`, if given, between the entry and `data-tp`)
- short: `data-tp` < `data-entry` < `data-sl` (and `data-tp1` between `data-tp` and the entry)

Otherwise the button simply opens the market with no plan. Prices are plain numbers: no `$`, no thousands separators.

## Mapping your data

When the ideas come from a template, a CMS or an API, render one button per idea and fill the attributes from the idea's own fields. For example, in React:

```jsx
{ideas.map((idea) => (
  <a key={idea.id}
     data-relentless-trade=""
     data-market={idea.symbol}            // BTC, or xyz:NVDA for a stock
     data-side={idea.direction}           // "long" | "short"
     data-entry={idea.entry}
     data-tp={idea.takeProfit}
     data-sl={idea.stopLoss}
     data-tf={idea.timeframe} />
))}
```

Pages that add ideas after the page loads (single-page apps, infinite lists) call this once the new ideas are in the page:

```js
window.RelentlessTrade && window.RelentlessTrade.scan(container); // container: the element holding the new buttons
```

Map your symbols to Relentless markets: crypto stays as is (`BTCUSDT` → `BTC`, `ETH-USD` → `ETH`); a US stock or ETF ticker gets the `xyz:` prefix (`NVDA` → `xyz:NVDA`). If a symbol has no Relentless market, render no button for it.

## Without the script: a plain link

```
https://app.relentless.trade/trade?m=BTC&side=long&entry=65000&tp=70000&sl=62000&src=SITENAME&ref=YOURCODE
```

Stocks open on `/tradfi`: `https://app.relentless.trade/tradfi?m=xyz:NVDA&side=long&entry=150&tp=165&sl=144&ref=YOURCODE`. Optional parameters: `tp1`, `order`, `tf`, `exp`, as above. URL-encode values (`xyz:NVDA` → `xyz%3ANVDA` is fine either way).

In JavaScript, with the script on the page: `RelentlessTrade.url({ market: 'BTC', side: 'long', entry: 65000, tp: 70000, sl: 62000, ref: 'YOURCODE', src: 'SITENAME' })` returns the link.

## Mobile apps (iOS, Android)

Build the plain link above and open it with the system:

- iOS: `UIApplication.shared.open(url)` (Swift) or `Linking.openURL(url)` (React Native).
- Android: an `Intent(Intent.ACTION_VIEW, Uri.parse(url))`.

Do not open it inside your own web view (WKWebView, Android WebView): sign-in with Google does not work there. Opening it with the system opens Relentless in the browser.

## Check your work

1. A button appears under each idea, reading "Trade on Relentless".
2. Its link starts with `https://app.relentless.trade/trade?m=` (or `/tradfi?m=` for a stock) and carries `side`, `entry`, `tp`, `sl` and `ref=YOURCODE`.
3. Opening it shows the market on Relentless with the plan drawn on the chart and named for your site.

## Rules

- Never place, submit or automate orders for readers; the button only opens the trade.
- Do not promise profits. Show a risk line near the ideas, for example: "Leveraged trading is risky: you can lose all the money you put in. Not investment advice."
- Questions: support@relentless.trade. The page for people: https://relentless.trade/partners
