Execution costs: commission and slippage
The market does not fill you at the price you see. Between sending your order and getting filled, price moves —almost always against you—, and that difference is called slippage. In strategies that trade often it is the difference between a profitable system and one that is not. AniQuant accounts for it throughout the program, not just at the end.
Where you set it up
In the Quote Manager, which is where each contract's record lives. Slippage is a property of the symbol, not of the strategy: @ES does not slip the same way @GC does.
The contract's minimum price step. On @ES it is 0.25 points.
How many ticks you give up on each side on each side of the trade. With 1 tick on @ES, the cost is 0.25 points going in and another 0.25 coming out.
The commission per trade, separately. It is subtracted from the profit; it does not move prices.
Leave slippage at 0 and AniQuant behaves as always. Set it to 1 and every number drops — those are the good ones.
The grid sorts by clicking the header of any of its nine columns — symbol, description, file, point value, tick, cost, slippage, modified date and size—; a second click reverses the order and a small ▲▼ arrow marks the active sort column. Text starts A to Z and numbers largest first, which is what you expect when you ask it to «sort by size».
It sorts by value, not by how it looks: «1,000 KB» comes after «999 KB» and dates sort by date, not by the day of the month. Two handy uses: sorting by Modified or by Size groups in one go every symbol whose file no longer exists, and sorting by Cost or Slippage brings to light the ones still sitting at zero — which, now that the Survival Test crosses markets using each one's own costs, are no longer harmless.
The selected row does not change when you reorder: it stays the same row, not whichever one now sits in that position on screen. And the ↑↓ arrow keys move through the order you are looking at.
The Quote Manager, by instrument
The same instrument usually has several series: daily @ES, 90-minute, 5-minute… They used to be separate records that had to be kept up one by one. Now the Quote Manager groups them under their instrument, which holds what belongs to the contract (point value, tick, costs, exchange, session), while each series holds what belongs to the file.
At the bottom left you choose By instrument or List. By instrument, each instrument row shows its name, type, exchange and currency, point value, tick and how many series it has; the triangle folds it. Below it, its series with timeframe, from and to, bars, costs, the file's date and its size. The chosen view is remembered.
With the Instrument details button or a double click on its row: name, type, currency, exchange, session and regular session, point value and tick. From catalogue fills in the name, type, exchange, currency and session of known contracts; it never touches the point value, the tick or the costs. When you change the point value or the tick, they apply to all its series.
The instrument row shows its commission (round trip, in $) and its slippage (in ticks); the series that inherit them leave them blank. In the details, the Costs section changes them for every series that inherits; those with their own costs are left alone, unless you tick the box to apply it to them too.
If a series has a commission or slippage different from its instrument's, its costs appear in amber. When you edit it, a notice says so and the Use the instrument's button makes it inherit again. Shuffled-data series (AQ Market Shuffle) appear in orange.
Under the title, one button for each asset type you have (Futures, Indices, Forex, Stocks, ETFs, Crypto, CFD) with how many instruments there are of each, plus All. They switch on and off and combine: Futures + CFD shows both. It works in both views, the counters at the top count what is filtered, and it is remembered next time. With a single type, the row does not appear. Series that do not have an instrument yet only show with All.
Each series needs its own symbol. If you add or edit one with a symbol that already exists, the manager warns you and does not save it. The usual convention is to add the timeframe as a suffix: @ES, @ES_90, EURUSD, EURUSD_60.
All of this is stored in a small database inside the data folder. The first time, AniQuant creates it by itself from your records, after backing up the originals in Copias\.
Margin per contract: overnight and intraday
In the instrument card, next to the point value and the tick, there are two margins per contract. The Overnight margin ($) is what your broker asks to hold 1 contract overnight; it is set by the exchange and the grid shows it in the Margin column. The Intraday margin ($) is what your broker asks if you close before the session ends: each broker sets its own and it is usually much lower. If you leave it empty, the overnight one applies. Both belong to the contract, like the point value: all its series inherit them. Empty = no data.
In the shared account, intraday margin applies only within its window, as at Interactive Brokers: from 8:30 to 15:00 Chicago time (15:30 to 22:00 in Spain most of the year). Within the window, all positions in that contract use the intraday margin, including those carried from the night. Outside it, the overnight margin applies, also when entering in the early hours. When the window ends, whatever is still open switches to the overnight margin and, if it no longer fits in the account's maximum margin, the lowest-priority positions are closed at that price, as your broker would do. The window is translated to your data's time from the data itself: each day, the session close is the one at 16:00 Chicago time. That way it works with data in any time zone (Spain, Germany, Chicago, New York or UTC) and in the weeks when Europe and the US have not yet changed their clocks. With daily data there is no intraday margin: the overnight one always applies. IB only reduces the margin on index futures (ES, NQ, their micros and similar); for gold, crude or agricultural contracts leave intraday empty.
The Portfolio's shared account uses it to know how many positions fit at once with your capital. AniQuant does not ship factory margins: they change without notice and each broker asks its own, so enter your broker's (or the exchange's, which is the minimum).
It is taken as constant for the whole history, and it is not: in 2008 or 2020 exchanges raised it a lot. If you want to be prudent, enter a margin somewhat higher than today's.
Spread and swap (Forex and CFD)
Forex and CFDs have two costs that futures do not. They go in the instrument record, in the Forex / CFD: spread and swap block, which appears when the type is Forex, CFD or Crypto (or if it already has values). Like the commission, every series of the instrument inherits them.
What it costs to cross the bid-ask spread, per round trip. With the tick at 1 pip, it is in pips. It is charged in money, like the commission: spread × tick × point value, per contract.
Money per lot and per night, with the MetaTrader sign: negative, you pay it; positive, you receive it. In 5-decimal pairs against the dollar, MetaTrader 5 «points» are dollars per lot.
Every midnight the trade stays open counts, in the time of your data. One night of the week counts three times (Wednesday by default; you can pick another day or «Every night» for crypto). Saturday and Sunday do not count: a full week adds up to 7 nights.
Throughout the search: Genesis, Strategy Lab, Walk-Forward, Survival, Portfolio, Performance and the editor's «Test». With swap, the Strategy Lab computes on the CPU (spread stays on the GPU). It travels with the saved strategy, like slippage.
In Performance, the Summary adds «Spread paid» and «Swap (net)» for each period (already deducted from the profit) and the Trades tab adds a Swap column. In the Survival Test, the cost stress also multiplies the spread and worsens the swap by the same factor: if you pay it, you pay more; if you receive it, you receive less. The Seasonal Analysis and the Seasonal Optimizer do not apply it yet.
Where it applies, and where it does not
Not every order suffers the same way, and AniQuant tells them apart. What decides it is the order type, not the exit type.
The entry, the stop loss and the signal exit. You are asking for immediate execution and you get the price that is there, not the one you wanted. The stop is where it hurts most: it fires precisely during fast moves.
It is a limit order: if price touches your target, you get filled at your price or better. Its real risk is not getting filled, which is a different thing and is studied separately. Charging it slippage would be punishing it twice.
In the SEARCH too, which is what really matters
Discounting costs only when you open a strategy would be a consolation prize. The problem would be upstream: in how you chose it. If the sweep in the Strategy Lab or in AQ Genesis searches a world without costs, the ranking over-rewards the strategies that trade the most — which are exactly the ones that decay most in real trading. The selection comes out biased by construction.
That is why slippage also goes into the search engine, into the Walk-Forward and into the Survival Test. Measured on @ES with 2 ticks: out of thirty strategies, twenty-eight get worse and none improves, and the best one falls from 62.6 to 34.4. But the numbers are not the point: two strategies dropped out of the top 30 and two others came in. It does not just change how much you make — it changes which ones you pick.
How much can your strategy take?
In the Strategy Performance Report, the Slippage tab repeats the backtest with rising costs and draws the curve. What you are looking for there is the break-even point: how many ticks of slippage it takes for the strategy to stop making money.
A strategy that dies at half a tick is not a strategy: it is an artifact of the history. One that takes three or four has room to survive a fast market, a worse broker or a thin session.
AniQuant can be tried free for 14 days, with every module and no card. If you have the book, 30.