Strategy guide
Build a trend-following strategy with an AI agent
A trend-following strategy applies the same directional rule to completed market data at each review. With Fensory MCP, a connected agent can read Hyperliquid candles, calculate a signal, check the signed-in account and prepare a bounded perpetual-futures order for review.
The current workflow is client-run. Fensory supplies the market, account and order tools, while the connected client performs each calculation and decides when to call them. Fensory does not host the recurring evaluation in this workflow, so it stops checking new data when the client or external scheduler stops. Fensory is not available to US persons.
Copy this prompt
Use the Fensory tools to assess BTC perpetual futures with a transparent trend-following rule. Stay read-only first. Call get_perps_status, get_market and get_candles. Use the latest 100 completed one-hour candles and ignore the candle that is still forming.
Calculate the 20-period and 50-period exponential moving averages. Mark a long candidate only when the latest completed close is above both averages and EMA20 is above EMA50. Mark a short candidate only when the close is below both and EMA20 is below EMA50. Otherwise report no signal. Print the candle timestamp, close, both EMA values and the exact condition that passed or failed.
Then call get_account_state and get_open_orders. State the existing position, available balance, allowed markets, access expiry and per-order cap. If a candidate exists, prepare but do not submit a limit order worth no more than $25, without changing leverage or margin mode. For a long candidate, use the lowest low of the most recent ten completed candles as the proposed stop reference. For a short candidate, use the highest high of those candles. Show the exact order and stop arguments, current funding, estimated fees and liquidation risk. Do not place, cancel or replace anything until I confirm that exact action. Stop if candle history is incomplete, stale or contains a gap.Who this is for
This guide is for an eligible user who wants a transparent, repeatable way to test a directional rule with completed candles and a small supervised perpetual-futures order. The example uses EMA alignment because every input can be printed and checked.
What it is not
It is not a performance claim, a backtest or an unattended strategy. A moving-average rule can reverse late, trade repeatedly in a flat market and lose through fees, funding, slippage or liquidation. The agent should report a signal without presenting it as a recommendation.
What you need
One written rule
Choose the market, timeframe, lookback, entry condition and exit condition before the agent reads the chart. Changing the rule after seeing the latest candle makes the result hard to reproduce.
Enough completed candles
The longest lookback needs a stable history. This example requests 100 completed one-hour candles for a 20-period and 50-period EMA comparison and excludes the still-forming candle.
A bounded Fensory account
Set the access expiry, exact market allow-list and per-order cap in the app. Keep leverage unchanged and size the test below both your prompt ceiling and the account cap.
A client or scheduler you operate
The connected agent must run the same check again when a new candle closes. If that client, routine or scheduler stops, the strategy stops evaluating new data.
What the agent does
01
Resolve the perpetual-futures market
The agent verifies that perpetual-futures execution is available and that the requested symbol resolves to the intended Hyperliquid market. A familiar ticker is not enough because the same name may describe another instrument elsewhere in the app.
Tools: get_perps_status · get_market
02
Read only completed candles
The current candle can change before it closes. The agent removes it from the calculation, checks timestamps for gaps and prints the exact history window so another reader can reproduce the averages.
Tools: get_candles
03
Calculate and explain the signal
The client calculates both EMAs from the returned closes and reports which condition passed. It does not turn a borderline or incomplete result into a trade, and it does not claim that this rule has been backtested by Fensory.
04
Read exposure and account controls
A valid signal does not authorize an order. The agent checks the current position, resting orders, account balance, expiry, market allow-list and per-order cap before preparing anything new.
Tools: get_account_state · get_open_orders
05
Prepare one order and verify its state
The agent shows the complete limit order and proposed stop before submission. After a confirmed action it reads the venue state again, because a submitted order can rest, fill partly, fill completely or fail.
Tools: place_perps_order · get_order_status · get_fills · get_open_orders
Failure modes and limits
A flat market creates repeated reversals
Two averages can cross back and forth when price has no sustained direction. Each reversal can add fees and slippage even when the market finishes near its starting point.
The newest candle is incomplete
An intraperiod move can make the EMA alignment appear and disappear before the candle closes. The prompt uses completed candles so the same timestamp produces the same calculation.
The signal arrives after the move
Moving averages use past prices and can react late. The page does not imply that EMA alignment predicts the next move or that a faster setting is better.
Costs outlast the signal
Perpetual futures add venue fees, the Fensory builder fee, funding and execution spread. A short-lived signal can be smaller than those combined costs.
The client stops running
Fensory MCP does not keep this prompt running by itself. No new candle is evaluated after the connected client or the user-operated schedule stops, although existing positions and orders remain live at the venue.
Read the result in the terminal
- Position and liquidation price
- Confirm the market, side, size, entry price, mark price, margin mode and liquidation price. The calculated signal is not authoritative once the account holds a live position.
- Open orders and fills
- A limit order may remain open or fill only partly. Compare the remaining quantity with the fill records before the next evaluation prepares another order.
- Funding and fees
- Funding can change while a position is open, and the actual fill carries the fee record. These costs belong in every review of the strategy result.
Runs on
The client list comes from the same release record as the MCP page. Every verified client has its own setup guide.
Questions people ask
- Can Fensory run this trend-following strategy continuously today?
- The current guide is client-run. A connected agent can read candles, calculate the rule and use Fensory tools while the client or user-operated schedule is running. Fensory does not host the recurring evaluation in this workflow.
- Why use completed candles?
- The still-forming candle can change before the period ends and can make the EMA alignment appear temporarily. Completed candles make the input window and signal reproducible.
- Does EMA alignment predict that price will continue?
- No. It describes a relationship in past prices. It can react late or reverse repeatedly, especially in a flat market. Fensory does not publish a return claim for this example.
- Can the agent change the Fensory account limits?
- No. Access expiry, allowed markets, per-order cap and the trading kill-switch are account settings controlled in the app. The agent reads them and any order outside them is rejected.
- What happens if the client disconnects while a position is open?
- The calculation loop stops, but a filled position or resting order remains at the venue. Check the terminal, manage the position directly and disable agentic trading if no new agent action should be accepted.