A familiar indicator is often what keeps a trader on another platform more than anything else.
Give the agent the source code. It rewrites the logic for ATAS and lists separately what didn't carry over one to one.
Port an indicator from another platform to ATAS. This is my code. First tell me what will carry over as is and what will change or won't carry over. Then test it without saving on BTCUSDT 5m, save it and add it to this chart.
<paste the source code here>
As an example, take a small indicator written specifically for this page:
//@version=5
indicator("Range Position", overlay=false)
len = input.int(20, "Length")
hi = ta.highest(high, len)
lo = ta.lowest(low, len)
pos = hi == lo ? 50 : (close - lo) / (hi - lo) * 100
htf = request.security(syminfo.tickerid, "60", ta.ema(close, 21))
plot(pos, "Position", color=color.blue)
hline(80)
hline(20)
bgcolor(close > htf ? color.new(color.green, 90) : na)
What happens
The agent tests the code without saving and ports what can be ported. ATAS Script doesn't accept the line with higher-timeframe data directly, so in this example the agent saved the indicator without the hourly EMA and the highlight, and said so:
Port an indicator from another platform to ATAS. This is my code. First tell me what will carry over as is and what will change or won't carry over. Then test it without saving on BTCUSDT 5m, save it and add it to this chart.
<paste the source code here>
Saved and added to BTCUSDT Binance Futures 5m: Range Position (no HTF background), in a separate panel.
Kept: the Position calculation, Length=20, the blue line and the 80/20 levels. Removed: the hourly EMA(21) and the green background, because request.security is not supported in ATAS Script.
Before saving, I tested it on 18,112 bars with no errors. The display on the chart has been checked.
If this replacement doesn't work for you, tell the agent what to do instead:
Don't drop the hourly EMA: calculate it yourself from the 5-minute bars and bring back the green highlight. Test without saving, then save and add it to the chart. List the differences from the original.
Done: Range Position (manual H1 EMA) was tested without saving on 18,112 bars, then saved and added to BTCUSDT 5m in place of the previous version. The green highlight works.
Differences from the original:
- EMA(21) is calculated on hourly closes built from 5m, with a factor of 2/22 and UTC hour boundaries.
- The starting value is taken from the first available hourly close. History depth, missing bars and differences in quotes can affect the result.
- A provisional EMA of the current hour is used on the last ATAS bar. This approximates how
request.securitybehaves in real time; after a recalculation, the highlight within the hour can change. - In ATAS the background is colored across all chart panels; in the original, in the indicator panel.
The Position calculation and the 80/20 levels are kept.
