Control AI context and attachments
Context determines what the assistant can use in AI Pine editing in Algo Lab. Before sending a request, check the chips above the message box and confirm that the active strategy and Case Study are the ones you intend to discuss.
Context Algo Lab adds automatically
Section titled “Context Algo Lab adds automatically”Each request can include:
- the current source and name of the active strategy tab;
- the names and current contents of the other open strategy tabs;
- the ten most recent messages in the current chat, compacted when needed;
- the current symbol, timeframe, date range, and latest backtest summary;
- current optimization, regime, and market context when available; and
- the active Case Study, its mission, and linked-report summary when that Case Study is attached to the chat.
The active strategy remains the primary code context. Switch to the tab you want changed before sending an Agent request, and name the relevant function or line range in the prompt.
Add explicit context
Section titled “Add explicit context”Select + beside the message box:
| Menu item | What it adds |
|---|---|
| Add Image | An image for the next message only. It is removed from the composer after that message is captured. |
| Add Report | One saved Backtest vs Alerts or Alerts vs Fills report for the current chat. Selecting another report replaces the previous report attachment. |
| Share Active Tab | The current strategy as a managed code attachment. |
| A named tab | That open strategy as a managed code attachment. |
Code and report attachments appear as removable chips. Removing a chip does not delete the underlying strategy or report.
Attach a Case Study
Section titled “Attach a Case Study”The Case Study chip is separate from the + menu. Select a study when the request should use its hypothesis, mission, trials, or linked evidence. Choose No Case Study for an unrelated question; that removes Case Study and mission context from subsequent requests in that chat.
Do not leave an old Case Study attached for convenience. It can steer a research request toward a scope or objective that no longer applies.
Attach a report
Section titled “Attach a report”-
Select + → Add Report.
-
Choose the saved report that matches the strategy, symbol, timeframe, and review window.
-
Confirm its chip appears, then ask the assistant to distinguish observed report evidence from hypotheses about the Pine code.
The assistant receives a bounded report representation, not an unlimited export of every source row. An analysis handoff into Algo Lab can also seed the relevant report context. Temporary handoff data may not be available in a later session if the report itself was not saved.
Images and context size
Section titled “Images and context size”Use a cropped PNG or JPEG and explain what should be inspected. Do not attach credentials, webhook secrets, account identifiers, or unrelated personal data. An image accompanies only the next message, so attach it again if a later turn still depends on it.
Managed code attachments are selected within the chosen model’s context budget. Remove unrelated tabs and reports, keep the intended strategy active, and prefer one bounded question over a broad request that mixes several investigations.