Skip to main content

Moving from QuantScript v1 to v2

What changed between QuantScript v1 and v2, how to tell which version your strategy uses, a side-by-side API mapping, and what happens to existing v1 strategies (Convert or rebuild with the agent).

QuantScript v2 is a different API, not a new version of the same one. A script is either v1 or v2; the two cannot be mixed. The v2 validator rejects every v1 name and prints the v2 replacement next to it, for example:

'Orders.Buy' is V1 API; in V2 use 'market.place_order(symbol, side=Order.BUY, type=..., quantity=...)'

How do I know if my strategy is v1?

If your strategy uses Market.Ticker, Orders.Buy or TA.RSI, it is a v1 strategy. v2 strategies open a connection with Connection.get(...) at the top of the file and call methods on a market object such as spot.get_ticker(...).

What changed

The v1 examples below are shown only for comparison. They do not run in v2.

v1

v2

Market.Ticker(symbol="BTC/USDT")

spot.get_ticker("BTC/USDC") on a market obtained from a connection

Market.Candles(timeframe="1h", symbol=...)

spot.get_candles(symbol, timeframe="1h", limit=200)

Market.SymbolSpec(...), Market.SetLeverage(...)

perp.get_symbol_spec(...), perp.set_leverage(...)

Orders.Buy(...), Orders.Sell(...)

market.place_order(symbol, side=Order.BUY / Order.SELL, type=..., quantity=...)

Orders.Cancel, Orders.CancelAll

market.cancel_order, market.cancel_all_orders

Orders.Get, Orders.GetAllOpen, Orders.GetAllFinished

market.get_order, market.get_open_orders, market.get_closed_orders

Positions.Get(...)

market.get_position(symbol)

TA.RSI(candles, 14), TA.CrossAbove(...)

ta.rsi(candles, length=14), ta.cross_above(...) (lowercase module, snake_case names)

State["k"], State.Clear()

state["k"], state.clear() (lowercase)

No connection concept

Connection.get(...) then conn.get_market(...) at the top level

Logic anywhere

Only assignments and def at the top level; everything else inside Run()

Side by side

A minimal v1 tick, for comparison:

# QuantScript v1. Does not run in v2.
def Run():
candles = Market.Candles(timeframe="1h", symbol="BTC/USDT")
rsi = TA.RSI(candles, 14)
if rsi[0] < Decimal("30"):
Orders.Buy(symbol="BTC/USDT", quantity=Decimal("0.01"))

The same tick in v2:

conn = Connection.get(Connection.HYPERLIQUID, id="mock_hyperliquid")
spot = conn.get_market(Market.SPOT)

def Run():
candles = spot.get_candles("BTC/USDC", timeframe="1h", limit=200)
rsi = ta.rsi(candles, length=14)
if rsi[0] < Decimal("30"):
spot.place_order("BTC/USDC", side=Order.BUY, type=Order.MARKET, quantity=Decimal("0.01"))

Note the symbol change as well: Hyperliquid quotes everything in USDC, so BTC/USDT becomes BTC/USDC (spot) or BTC/USDC:USDC (perpetual).

What happens to my existing v1 strategies?

Once your account is on v2, a v1 strategy opens read-only. You can view it and its past results, but you cannot run, edit or deploy it. The editor shows a banner with two ways forward:

Convert. QuantPilot translates the saved version to v2 on the server and opens the result in a new v2 chat. The converter is deliberately strict: it only produces code whose behaviour it can guarantee is identical, and it refuses rather than guess, listing each construct it cannot translate. Not every v1 script can be converted.

Rebuild with the agent. Describe the strategy in a new chat and the agent writes it in v2. This route always works and is the right one when Convert refuses.

Converting the same v1 strategy twice creates two v2 copies. Once a strategy has been converted, the banner links to the existing v2 chat instead.

Did this answer your question?