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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
No connection concept |
|
Logic anywhere | Only assignments and |
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.
