December 2, 2026

How to Create a Custom Trading Indicator with AI

Contents

    Share

    ATAS offers two ways to get a custom indicator without a programmer: describe your idea to an AI agent or port an open-source indicator from TradingView to Script Editor. Below are the steps, ready-made prompts, and a way to check the result.

    When you need a custom indicator

    A custom trading indicator makes sense in two cases.

    1. You’ve long noticed a pattern, but there’s no ready-made indicator for it.
    For example, inside a candle there are cluster levels, and when we look at it in profile mode, we can spot “thin spots” or price imbalance zones. That is, places where little volume was traded. Searching for them by eye on the footprint takes a long time, and the standard settings may not be enough. Ordering an indicator from a developer is expensive and slow. This used to require programming skills; now you can describe your idea in words: the line between trader and developer is blurring, and a custom indicator without a programmer can become a routine task.
    2. Your favorite indicator is on TradingView, but you want to see it next to the footprint in ATAS.
    If the indicator has open-source code, it can be ported. A custom port requires a programmer, money, and waiting, but there’s a shorter path here (Method 2).

    Start now!

    Try ATAS free with no time limit

    What you’ll need

    Requirements in brief. Agent verification of the indicator against data is currently available on crypto exchanges. You pay for the AI agent subscription yourself. You only need the desktop version of ATAS. A browser-based AI chat won’t work: the agent needs to connect to the program on your computer.

    Indicator from a description (AI Connect)
    Ultra or Ultra trial (14 days) a desktop AI agent (e.g., Claude Desktop (Claude Code), Cursor, Codex)
    Porting to Script Editor
    Plus, Pro, Ultra the indicator’s open-source code
    Fixing errors with the agent
    Ultra or Ultra trial a connected AI agent

    Method 1. Describe your idea — the AI agent builds the indicator

    You describe the pattern in plain words. The agent writes the code in ATAS Script or C#, checks that it compiles, fixes errors, adds the indicator to the chart, and opens the code in Script Editor. You get an AI-built indicator: this is how you can write an indicator with AI without writing a single line of code yourself.

    Step 1. Connect an AI agent to ATAS

    You only need to connect the AI agent once; after that, it works with your ATAS on request. Beforehand, you’ll need the desktop version of ATAS on the Ultra plan or Ultra trial and an AI agent on the same computer, such as Claude Desktop (Claude Code), Cursor, or Codex.

    Where to find the connection wizard. The first time you launch AI Connect, ATAS opens the wizard automatically. If you closed it, find the AI agent connection item in the ATAS menu (Menu → Enable AI Connect).

    The wizard’s three steps

    1. Turn on the tunnel. The tunnel is an MCP server inside ATAS. It’s how the agent on your computer gets access to the program. While the tunnel is off, the agent can’t see ATAS.

    1. Enabling AI Connect in the ATAS menu

    2. Copy the prompt. The wizard provides ready-made text for the agent, so you don’t have to write it yourself. Once copied, the step is marked with a checkmark.

    2. ATAS MCP server enabled

    3. Paste the prompt into the agent’s chat and send it. Open the desktop agent, paste the text into the chat, and send it. A browser chat won’t work: it can’t communicate with a program on your computer.

    AI Connect setup prompt pasted into Claude Code to connect the agent to ATAS

    How to tell everything is connected

    • The agent will reply in the chat that it has connected to ATAS.
    • Test it with a request: “What do you see in ATAS? List the open tabs and charts.” If the agent lists your tabs, the connection works.
    • The next time you open AI Connect, ATAS will show that the agent is connected and let you go to the access settings. The agent doesn’t trade for you.
    4. AI agent connected to ATAS

    Experiment on a separate chart. The agent can change the chart: add and remove indicators, place and erase labels. So don’t start on your working chart.  

    Didn’t connect? Check in this order

    What’s wrong What to do
    The prompt was pasted into a browser chat, or the agent is on a different computer Install a desktop agent on the same computer where ATAS is running and paste the prompt there
    The agent says it can’t connect Check in the wizard that the tunnel is on, and send the prompt again
    ATAS shows an access error Check your plan: AI Connect works on Ultra and the Ultra trial

    Step 2. Describe the pattern in words

    Below, all the steps are shown on one real example: thin levels inside the candle body on BTCUSDT (Bybit, M5 chart, 7 days of history). This is a real walkthrough: what we asked, what the agent replied, where it hit the limits of the settings, and how we fixed it.

    A good description answers three questions: what to calculate, under what condition, and how to display it on the chart. Here’s how we described the idea the first time:

    I’m looking for zones of imbalance and accelerated price movement inside a candle. This is where the price wasn’t held by anyone and there wasn’t time to trade a large volume in this area. Such imbalances usually appear on several price levels in a row, so determine how many adjacent price levels would be optimal to get quality signals and filter out excess noise.
    
    Also, in these zones one side usually dominated the trading, that is, almost all market buyers or sellers. I need these gap signals only in the middle of the candle, in the body, not in the wicks, to see where the price was moving with such a gap in the middle of the move. Also, to strengthen the signals, filter out candles with a small body: I only need noticeable moves.
    
    Make 2 copies of the indicator: set one up to look for buyer dominance and the other for seller dominance.

    This is what a request looks like when you simply describe an indicator to AI: no formulas, just the essence of the pattern. The agent decides which settings and calculations are needed. If your request turns out long, that’s fine: you can ask the agent to restructure it (see the section on writing a request below).

    Tip. First, give the agent a chance to make do with standard ATAS indicators. In our example, it started with the built-in Cluster Search indicator and configured it to match the description. If the settings are enough, you won’t need to write any code at all.

    The numbers from the example don’t carry over to other instruments. The example was built on BTCUSDT with a price step of $10. Tell the agent your instrument and timeframe and ask it to calibrate the thresholds for it: on a crypto exchange, the agent will fit them on history (7 days in our example); on other markets, it will expose them as settings, and you’ll fine-tune them on the chart.

    Step 3. The agent writes the code and adds the indicator to the chart

    What the agent replied. In our example, it didn’t take the settings on faith: it checked on data what each one means and compared the indicator’s calculation with its own footprint-based calculation. Then it showed a “condition → setting → value” table, compared different numbers of adjacent levels, and explained why it chose three. Two instances of the indicator (buyers in light blue, sellers in purple) appeared on the chart, and one-sentence labels appeared next to candles with the pattern. The first threshold attempts produced either zero marks or too many, and the agent adjusted them.

    Cluster Search configured by the AI agent

    Where the settings fell short. Looking closer at the marks, we saw that some zones sat at the edge of the candle body or extended into the wick, while we needed zones entirely inside the body, closer to the middle. The agent flagged this itself: on some candles, the zone starts at the edge of the body and extends into the wick, and Cluster Search has no setting to exclude this. It checked each zone against the data: of 92 marks, 28 met the requirement. The reason is that the “position — body” setting only checks the price where the zone starts, not the entire zone. (Numbers from a single run; on another day they will be different.)

    So we asked it to check and, if the settings weren’t enough, to write its own indicator:

    Check each found zone against the data: all its prices must be entirely
    inside the candle body, closer to the middle, not near the open/close
    and not in the wicks.
     
    If the indicator’s built-in settings aren’t enough for this, first
    confirm it with a data check. Then write your own script
    indicator with the same logic:
    - two instances with the same colors;
    - all thresholds (number of levels, volume, side share, offset from body edges)
    must be exposed as settings and recalibrated on the data;
    - text labels must be drawn by the script itself so they appear
    on new candles too;
    - remove the old indicator instances and old labels.
    At the end, show a table of how many events are found at different values
    of the key thresholds, and explain your choice.

    Result. The agent confirmed that the settings weren’t enough and wrote its own indicator, Central Thin Imbalance. It described the search rules: all zone levels must be away from the candle’s open and close, the zone must contain little volume, and one side must clearly dominate; overlapping zones merge into one. On the chart, the indicator draws a box around the zone and a short label. All thresholds are exposed as settings, and the old instances and labels have been removed. The finished indicator appears in the indicator list, and its code opens in Script Editor, so you can see how it works.

    Tip. In this example, the agent verified the indicator against the data itself: it currently receives market data from crypto exchanges and can check the result on history. On futures, stocks, and options, the agent writes, compiles, and fixes the code the same way, but it’s up to you to see how the indicator fits the chart.

    Custom Central Thin Imbalance indicator written by the AI agent

    Important. The agent may suggest improvements and show numbers for the places it found. This is help with verification, not an assessment of trading results: you decide whether the zones found suit your trading.

    Step 4. Refine it in words

    The first version is rarely the last. Say you want to add a condition, remove something, or change the look. Just write it:

    • “Expose the thresholds as settings and show how many events are found at different values” (in our example, this produced a table instead of guesswork);
    • “Label on the chart why each candle is marked” (in our example, one-sentence labels helped verify the logic by eye);
    • “Add a condition: show the zone only if the candle closed in the direction of the side that dominated the zone” and other ideas.

    This is how a simple indicator is gradually brought to the form you need: for example, you can add a candle direction filter to the thin levels or a separate color for zones made up of more levels. To refine an indicator, you don’t need to rewrite the code: just tell the agent what to change.

    Didn’t work? What to tell the agent

    In a real walkthrough, there are always things that don’t work the first time. Here are the ones from our example and the phrases that solved them.

    What you see What happened in our example What to tell the agent
    No marks at all The default “minimum value” threshold (1000) is unreachable for BTC: zones contain a few BTC, so the agent disabled it “There are no marks. Check whether the default threshold is getting in the way, fit it to my instrument, and explain what you changed”
    Marks on almost every candle The literal “little volume — no more than 10 BTC” without a candle size filter produced 202 candles, mostly on quiet weekends “There are too many marks. Adjust the threshold, add a candle size condition, and explain what you changed”
    Standard settings aren’t enough The agent checked on data that some zones extend into the wick and suggested its own indicator “Check on data whether the settings are enough. If not, write your own indicator with the same logic”
    The agent installed an existing indicator instead of a new one In the Chandelier Exit example (below), there was already a version in the library, and the agent installed it “Write from scratch, don’t use existing files”
    Almost no marks on weekends That’s exactly what happened: there were almost no large candles This isn’t an error. Ask the agent what explains it and compare with the chart
    The agent says it hasn’t yet seen a live event on a new candle That’s exactly what happened in our example Check the next move before trusting the indicator in real time

    Method 2. Port an open-source indicator from TradingView

    The second path works if the indicator you need already exists. In ATAS, you can write in ATAS Script: a language for on-chart indicators with syntax similar to Pine Script v4–v6. To port an indicator from TradingView, just copy the open-source code and paste it into Script Editor. This works for TradingView indicators with open-source code. For some indicators, porting works right away. If not, the agent will fix the errors. The conversion in the program is planned to be improved.

    Note the limitation: ATAS Script doesn’t work with higher timeframes or data from other instruments. If a TradingView indicator uses them (in Pine Script, this is usually the request.security function), it won’t port directly.

    Step 1. Copy the open-source code

    You can only port indicators with open-source code: the source code must be available on the script page (Source code). Closed-source code can’t be ported. The license is chosen by the indicator’s author: by default, open-source scripts on TradingView are published under the Mozilla Public License 2.0, but the author may specify another one. MPL 2.0 imposes no restrictions on personal use; conditions apply when you distribute. Check the license in the code header before porting.

    Open-source indicator the Source code tab on the script page

    Step 2. Open Script Editor and paste the code

    The steps are below: after Run, the indicator appears on the chart. If you’re a developer, you can also write in C# in Script Editor, without Visual Studio.

    1. Open the editor — right-click the chart → Script Editor
    2. New indicator — New → ATAS Script indicator
    3. Paste the code — into the editor window
    4. Run — Run

    Step 3. Didn’t compile? Ask the agent to fix it

    Opening Script Editor from the ATAS chart context menu, with indicator code in the editor

    Sometimes a compilation error appears after Run. In that case, write to the connected agent:

    I ported an indicator to ATAS Script and got a compilation error: [paste the error text]. Fix the code and add the indicator to the chart.

    The agent will usually fix the code and add the indicator to the chart. This way, you can fix indicator errors without digging through compiler messages. This requires the Ultra plan or Ultra trial. AI Connect isn’t available on the Plus / Pro subscription, but you can work through the error by connecting the agent on the Ultra trial.

    Real example: Chandelier Exit

    We ported the Chandelier Exit indicator from TradingView (BNBUSDT, perpetual contract on the Binance crypto exchange). In our example, we went through the agent rather than pasting the code into Script Editor. The example showed three useful things.

    License. Before porting, we asked the agent to check the license. It found the most popular version of the indicator on TradingView (by Alex Orekhov, aka everget, GPL-3.0 license), read the header from a published copy of the code because the TradingView page doesn’t show the source, and warned: if we have a different version, the header needs to be checked in that version. By its reading, there are no conditions for personal use; they begin when you share the indicator: publish the file, sell it, or give it away. The agent itself noted that this was its reading of the license, not legal advice.

    It doesn’t always write from scratch. For the request “write an indicator based on Chuck LeBeau’s idea, using the TradingView version as a reference, code in C#,” the agent didn’t write it anew: the computer already had a version we had built earlier, and it put that one on the chart. This happens if you’ve already made a similar indicator: the agent checks existing files first. If you specifically need new code, say so directly: “write from scratch, don’t use existing files.” The chart showed a level line, a shaded area between the price and the line, and trend change marks, and the parameters could be changed in the settings.

    Tuning the settings. Next, we asked for two copies, one for short trends and one for positional use. The agent tested combinations on history and compared how often the trend changes and how long it lasts, meaning the settings were tuned not for trading results but for trend length and the number of unnecessary flips. It showed a table by period, multiplier, reversal frequency, and trend length, and noted on its own that if marks cluster within a single day, it gives the impression of frequent reversals, even though the data says otherwise.

    Whether the result matches the TradingView original is for you to check: compare the line on the same bars.

    Chandelier Exit ported to ATAS two copies with different settings on a BNBUSDT chart

    How to check that the indicator works

    The agent sees compilation errors on any market. It can compare the result with bars and a chart snapshot only on crypto exchanges. On futures, stocks, and options, you check the result yourself. How to check an indicator depends on the market:

    Market What the agent checks What you check
    Crypto exchanges the code compiles; the result is compared with bars and a chart snapshot the idea is implemented the way you meant it
    Futures, stocks, options the code compiles, compilation errors are fixed everything else: you compare the marks on the chart with bars and the footprint manually

    Checklist:

    1. Marks are where you expect them. Pick 3–5 marks and check each one manually on the footprint.
    2. No repainting. Ask the agent directly: does the indicator calculate only on closed bars, and can a mark on the current bar disappear or change? In our example, the agent reported that marks appear when a candle with the pattern closes and history doesn’t repaint; it also honestly added that it hadn’t yet seen a live event on a new candle. Such a caveat is worth checking on the next move.
    3. The indicator works on different timeframes, not just the one it was built on.
    4. The logic is clear: ask for labels on the chart explaining why each candle is marked.
    5. The result is robust to thresholds. Ask for a table of “how many events at different threshold values” (in our example, the agent showed it one setting at a time). If a single value turns ten marks into a hundred, the threshold was chosen blindly.
    6. Check on a stretch of history the agent hasn’t seen. It fitted the thresholds and checked the result on the same days, and marks found on history “after the fact” always look better than in real time. So a good picture on those days doesn’t prove anything yet.
    7. Check how the agent interpreted your instructions and which specific values it built into the calculation. Comparing with an independent copy confirms that the code works according to its interpretation. But that doesn’t yet mean it understood your task correctly. For example, the agent interpreted the phrase “closer to the middle” as a condition: each level of the zone must be at least 25% of the candle body away from the open and close. Consider whether a 25% threshold really matches what you meant.

    AI can make mistakes in code — check the result.

    Ready-made prompts: 6 volume analysis indicators

    This is the most practical part: six ready-made volume analysis indicators you can build with the agent. Each card: task → prompt you can copy → what you’ll get → how to refine → how to check this specific one. We show the examples on a crypto exchange (BTCUSDT) because there the agent can compare the result with bars itself. All six prompts only mark places on the chart: arrows, zones, labels. What to do with them is up to you.

    In each card, the volume indicator works together with price, delta, or the footprint: volume without context says little. The agent will expose parameters like the period or threshold as settings, and you can change them without new code.

    Cumulative delta divergence

    Task. A delta indicator that marks bars where price makes a new high while cumulative delta stays below its previous high, and vice versa for lows. Otherwise, you have to compare this delta divergence by eye across two windows.

    Add an indicator that marks bearish divergence when price makes a higher high while cumulative delta makes a lower high, and bullish divergence in the opposite case. Place arrows on the bar and expose the lookback period as a setting.

    What you’ll get. Arrows on bars with divergence.

    Cumulative delta divergence indicator

    How to refine. Ask for a “bearish” or “bullish” label next to the arrow and a minimum difference between highs so that small discrepancies aren’t marked.

    How to check this one. Pick 3 arrows and compare manually: price really made a higher high, and delta is lower there. Also ask the agent which bar the arrow appears on: identifying a high requires bars to its right, so the mark may arrive with a delay.

    Absorption at extremes

    Task. Highlight highs and lows with abnormally high volume after which price didn’t go any further. This is an absorption indicator.

    Highlight bars where there is abnormally high volume at the high or low, but price didn’t go further over the next 2 bars. Color the bar and display the volume at that level.

    What you’ll get. Highlighted absorption bars.

    Absorption indicator highlighted bars with abnormal volume at highs and lows

    How to refine. Ask to expose as settings what counts as “abnormally high” (e.g., how many times above the average over N bars) and how many bars to wait.

    How to check this one. Open the footprint on a highlighted candle and make sure the volume at that level is really high. Keep in mind: the prompt looks at the next 2 bars, so the highlight doesn’t appear right away but after them.

    Stacked imbalances in the footprint

    Task. Mark levels where several imbalances in a row pull in the same direction. This is an imbalance indicator in the footprint. Our running example above (thin levels in the candle body) is related to this idea.

    Mark levels where the footprint has 3 or more buy or sell imbalances in a row (3:1 ratio, configurable). Extend the zone to the right until price returns to it.

    What you’ll get. Stacked imbalances.

    Footprint imbalance indicator stacked buy and sell imbalance zones

    How to refine. Change the ratio (3:1 to 4:1, etc.) and see how the number of zones changes: this is how you find a threshold that gives neither an empty chart nor zones on every candle.

    How to check this one. Manually recount the imbalances in one zone on the footprint. Make sure the zone ends where price returned to it.

    VSA: volume rises, spread narrows

    Task. Arrows on bars where volume rises relative to the previous bar while the spread (bar range) narrows. This is the simplest VSA indicator (volume spread analysis).

    Add arrows on bars where volume rises relative to the previous bar while the spread (high − low) decreases. Optimize the logic at your discretion and explain what you changed.

    What you’ll get. Arrows on bars.

    VSA indicator arrows on bars where volume rises and the spread narrows

    How to refine. Ask to add a “volume above the average over N bars” condition; otherwise there will be too many arrows in a quiet market.

    How to check this one. Compare the volume and range of two adjacent bars at a chosen arrow. Read what the agent changed in the logic (the last sentence of the prompt asks it to explain) and make sure it doesn’t contradict your idea.

    Price reaction to the previous day’s POC

    Task. Show yesterday’s maximum volume level on the current chart and mark how price behaved on the first touch. This is a POC indicator based on the volume profile.

    Draw the previous day’s POC as a line on the current chart and label the first touch: bounce or breakout within the next 5 bars.

    What you’ll get. The POC line and touch labels.

    POC indicator previous day’s POC line and first-touch label on a BTCUSDT chart

    How to refine. Ask to expose “5 bars” as a setting and add the same line for the previous day’s high and low.

    How to check this one. Open the standard volume profile for the previous day and compare its POC with the indicator line. The “bounce or breakout” label is set based on the next 5 bars, so it won’t be there yet on the latest touch.

    Volume-confirmed breakout

    Task. Build a channel from the highs and lows of the last N bars and mark only the breakouts with above-average volume. This is a volume breakout.

    Build a channel from the highs and lows of the last N bars. Mark a breakout only if the breakout bar’s volume is above the average over N bars. Show the channel and the confirmed breakouts.

    What you’ll get. The channel and arrows for confirmed breakouts.

    Volume-confirmed breakout indicator

    How to refine. For example, ask to add volume-weighted channel strength or the share of volume inside the channel.

    How to check this one. Find 3–4 breakouts and calculate the average volume over N bars manually. Make sure unconfirmed breakouts aren’t marked on the chart.

    How to write a request the agent will understand

    The prompt formula: data (bars, delta, volume, footprint) → condition → how to display (arrows, color, zone, alert) → parameters you can change. This is the answer to how to write an indicator prompt the agent will understand the first time.

    Two tips we tested in practice:

    1. Ask the agent to explain the logic and expose the settings as parameters. This way, you see exactly what’s being calculated and can change thresholds without new code.
    2. If the request gets long, ask the agent to combine all the rules into one prompt. In our example, this turned short messages into two long but precise requests: the agent refined their wording itself.
    Bad request Good request
    “Make a thin levels indicator” “I’m looking for places where price accelerated and one side traded with almost no opposing volume, in the candle body, not in the wicks. I need several adjacent levels in a row. Expose the thresholds as settings”
    “Draw arrows on strong volume” “Place an arrow on a bar where volume is above the 20-bar average and the bar’s range is smaller than the previous one. Make the period and threshold settings”
    “Find divergence” “Mark bars where price made a new 20-bar high but cumulative delta didn’t. Label the mark so I can see which rule it was placed by”
    “Port the indicator” “Here’s the indicator’s open-source code. Port it to ATAS Script, compile it, fix the errors, and add it to the chart”

    The “bad / good” examples are illustrative; the real pair from our walkthrough is the short request in Step 2 and the long version the agent helped refine.

    ATAS Script or C#: when to go deeper

    ATAS Script is suited for on-chart indicators. Delta, buy and sell volumes, footprint, and POC are built into the language. Everything else is the extended C# API. Script Editor is just an editor: you can write in both languages in it.

    Task ATAS Script C# API
    On-chart indicator yes yes
    Order flow: delta, buy and sell volumes, footprint, POC yes, built into the language yes
    Porting an indicator from TradingView yes, syntax similar to Pine Script v4–v6 rewrite in C#
    Modules, columns, connectors no yes
    Higher timeframe and other instruments no yes
    Options: strikes, quotes, open interest no yes

    ATAS Script doesn’t replace C#: it’s an alternative for simple indicators. If your task goes beyond the chart, see the developer documentation. The C# API has its own section there.

    FAQ


    No. You describe the idea in words; the agent writes and checks the code. But whether the result suits you is your call.


    Desktop agents that can connect to a program on your computer: for example, Claude Desktop (Claude Code), Cursor, or Codex. Connecting takes a few steps in the wizard.


    No. A browser chat has no way to connect to ATAS on your computer. You need a desktop agent.


    Yes, the agent writes the code, compiles it, fixes errors, and adds the indicator to the chart. But it can make mistakes in code, so the result needs to be checked (see the “How to check” section).


    We haven’t compared models and won’t name a winner. What matters more than the model is a clear request and checking the result against the checklist above.


    No, only those with open-source code. Check the license terms with the indicator’s author. Porting doesn’t always work right away: if the code doesn’t compile, the agent will help. Indicators that use higher timeframe data or data from other instruments (in Pine Script, this is usually request.security) won’t port directly: ATAS Script doesn’t support such data.


    Check that the instrument, timeframe, and data exchange are the same on both charts: bars can differ between sources. If the discrepancy remains, ask the agent to compare the calculation with the source code on the same bars.


    No. ATAS Script syntax is similar to Pine Script v4–v6, but it’s a separate ATAS language.


    It will see that the code compiled and will fix errors. It can compare the result with bars and a chart snapshot only on crypto exchanges. On futures, stocks, and options, you check the result.


    The agent sends its AI provider charts, market data, and account and trade information. Before connecting, check whether your data providers allow this.


    No. You pay for the AI agent subscription yourself.


    Not through ATAS yet. We plan to make it possible to share your work with the ATAS community, and later to sell it on a marketplace; there’s no timeline yet. If your indicator is based on someone else’s open-source code, check the author’s license terms before passing it on to anyone.


    AI can make mistakes in code — check the result. You pay for the AI agent subscription yourself. ATAS performs technical functions; the decision is yours.

    TradingView® and Pine Script® are trademarks of TradingView, Inc. ATAS is not affiliated with TradingView.

    Subscribe

    Get the latest ATAS news delivered conveniently

    Master volume analysis with ATAS experts!

    Start using ATAS today to make more informed decisions!

    Get started for free