Skip to content

Release note

A rule can now sell a share short

3 min read
agentbacktestnew

Selling short means selling shares you have borrowed and buying them back later. It makes money when the share falls and loses when it rises. From 15 October the Strategy Agent can test rules that do this. Until now every such request was turned away.

What you can ask. Four kinds of rule run:

- One share sold short while a rule holds, and bought back when it ends: "Short TSLA when its 50-day average is below its 200-day average." - One share that is always held one way or the other: bought while a rule holds and sold short while it does not. - A ranking that buys its strongest shares and sells short its weakest. - A pair, with one share bought and another sold short: "Long KO, short PEP."

"Short TSLA" on its own gives no rule for when. The agent asks which you mean: a short held for the whole test, or a short only while a rule holds.

What the test assumes.

- A borrow fee of 1% a year on the value of the shares sold short, charged every trading day. This is an assumption. There is no record of what each share really cost to borrow, and a share that is hard to borrow can cost many times more. Say "borrow fee 3%" to change it. - In a pair, each side is 100% of the account: for every 100 in the account, 100 bought and 100 sold short. Say "half the account each side" for 50 and 50. - A share sold short pays its dividends out of the account, in full. - The money from a short sale earns no interest. Only the account's own spare cash does. - A short sale and a buy-back pay the same trading costs as any sale and purchase.

A short can lose more than the money put in. A share can only fall to zero, but it can rise without limit. If the loss on a short ever takes the whole account, the test stops on that day and says so, with the date. It shows no result, and tokens taken for the run are refunded.

What the result says. Every result with a short says what a short is, how large the short side was at its largest, and about how much the borrow fee took off the return each year. It also lists what the test leaves out: a lender asking for the shares back early, shares that could not be borrowed at all, a broker closing the position, and days when short selling was restricted. Any of these would have made the real result worse or the trade impossible. The comparison beside the result is the same shares bought and held, not a short.

What is not run yet.

- A stop-loss, a profit target or a set holding time on a short. The agent says so and runs nothing. It does not drop the stop and run the rest. - A pair that opens and closes on the gap between two prices, often called trading the spread. The fixed pair above is offered in its place. - More than 100% of the account on a side, such as 130/30. - A short in an ISA or a pension, or with a broker account that holds only shares you own. A short needs a margin account that allows short selling.

Watching, pretend money and public records. These follow rules that buy. A rule that sells short cannot be watched, tracked with pretend money or given a public record yet. The block under the result says so.

A test describes the past. It is not a forecast and it is not advice.