VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Strategy generation

Algo trading: what it is, what it costs and why most rules lose

Algo trading is trading where exact written rules, run by a computer, decide every entry and exit. Its value is one thing: it rejects bad rules cheaply. In a measured run, one plain breakout rule finished above zero on only 5 of 17 futures markets after costs.

By · Published · updated · Editorial policy

Contents
  1. What is algo trading?
  2. How does algorithmic trading work?
  3. What kinds of trading algorithms are there?
  4. What is automated trading?
  5. Is algo trading profitable?
  6. How much does algo trading cost?
  7. Can you do algo trading without coding?
  8. Do trading bots work?
  9. Is algo trading better than manual trading?
  10. Frequently asked questions
  11. References

What is algo trading?

Algo trading is trading where exact written rules, run by a computer, decide every entry and exit. Its value is one thing: it rejects bad rules cheaply. In a measured run, one plain breakout rule finished above zero on only 5 of 17 futures markets after costs, so plan to throw out most of what you test.

Algo trading and algorithmic trading are the same thing; one name is shorter. In Taiwan the usual term is 程式交易 (program trading). All three names describe the same practice: the trader writes the rules once, and the rules are applied in the same way on every bar, without a daily opinion.

A trading algorithm works like a recipe. The same ingredients and the same steps give the same dish every time, whoever is in the kitchen. "Buy when the market looks strong" is not a recipe, because two people read it differently. "Buy at the next bar's open when the close is above the highest high of the last 20 bars" is a recipe, because any person or any computer would act the same way at the same moment.

The cheap part is the losing. A rule that would cost real money in a live account costs only computer time in a backtest. A backtest is a simulation that runs the rules over historical prices and records every trade they would have made, including the commission and slippage of each trade. Before computers, a trader found out that a rule loses by trading it. Now the trader finds out by running it over several years of past bars, then moves on to the next idea. Most ideas go into the bin at this step, and that is the point of the method: the losers are removed before they touch an account.

Two words are often mixed up. Algorithmic trading means the rules decide. Automated trading means the computer sends the orders. The section on automated trading separates them; the short version is that the rules are the important part and automation only removes delay and hesitation.

This article uses futures examples because contract rolls, sessions and per-contract costs make the data and cost questions easy to see. The same steps apply to stocks and other markets, with different data details.

How does algorithmic trading work?

Every algorithm passes the same six steps from a one-sentence idea to the review of a small live trial, and each step can send the idea back to the start. The steps are the same whether you write the code yourself or use software that writes it, so a first-time reader can follow the full path in the guide to algorithmic trading for beginners and come back here for the reasons behind each step.

The path of a trading algorithm in six steps: idea, exact rules, backtest with costs, validation on unseen data, trading small, and review, with a dashed arrow from review back to the idea From idea to live trading Six steps, and a way back Idea Exact rules Backtest Validate Trade small Review Each step can send it back. So: fail early, before real money.
The path of a trading algorithm. Each step can send the idea back to the start.
  1. Write the idea in one sentence. For example: "After a quiet period, a breakout from the range tends to keep going." The sentence says what pattern you expect and why. An idea without a reason is harder to judge later when it stops working.
  2. Turn it into exact rules. Define the entry, the exit, the stop, the position size and the trading hours. Remove every word that needs judgement, such as "strong" or "clearly". A rule is exact when two people reading it would place the same order at the same bar.
  3. Backtest with costs. Start with the data. A bar is one row of open, high, low and close prices, usually with volume, for a fixed period such as 5 minutes or one day. Choose the market, the bar size and the history. Check how contract rolls are joined (a contract roll is the switch from an expiring futures contract to the next contract month), which sessions the bars include, and that the time zone matches the session times. The guide to backtest data quality: gaps, bad ticks, time zones and rolls covers each check. Then put commission, exchange fees and slippage in from the first run, and fill every order at the next bar's open. A rule that decides at a bar's close cannot fill at that same close, because the close is known only when the bar has ended.
  4. Validate. Test the rules on data that was not used to build them, and test the neighbours of every setting. Walk-forward analysis is a check that tunes the rules on one window of history, tests them unchanged on the window that follows, moves forward and repeats, so the joined test windows come only from unseen data. The guide to walk-forward analysis and window choice covers the details.
  5. Trade small. The rules must first be written in the platform's language. AlphaPrime (Valynox) exports strategy source code to MultiCharts (PowerLanguage), TradingView (Pine Script v6), TradeStation (EasyLanguage), NinjaTrader (NinjaScript), MetaTrader 4 (MQL4) and MetaTrader 5 (MQL5); the supported platform export list has the details for each one. Start on a simulated account, which most platforms offer, or with one contract.
  6. Review. Compare every live fill with the price the backtest assumed. If the live fills are consistently worse, raise the slippage in the backtest and run it again.

The step that rejects the most ideas is step 4, because it is the first time the rules meet prices they were not shaped on. The example below shows the normal pattern.

Hypothetical example

A trader tests a breakout idea on eight years of 60-minute futures bars. Rules: buy at the next bar's open when the close is above the highest high of the previous 20 bars; exit at the next bar's open when the close falls below the lowest low of the previous 10 bars; the short side is the mirror image; one contract. The rules are built on the first six years and show 180 trades with an average trade of $90 before costs. With a round-trip cost of $25 (commission, fees and slippage), the average trade is $65. On the last two years, which were not used during building, the same rules show 60 trades with an average trade of $20 after costs. The drop tells the trader that part of the first result was fitted to the past. The trader keeps the idea only if $20 is still clearly larger than the cost uncertainty.

Hypothetical breakout example: the average trade after costs is 65 dollars in the in-sample years 1 to 6 but only 20 dollars in the out-of-sample years 7 to 8, which were not used to build the rules Unseen years: the real edge Average trade after costs, hypothetical In-sample Years 1–6 $65 Out-of-sample Years 7–8 $20 Not used to build rules The edge fell from $65 to $20. So: judge it on the unseen years.
The hypothetical example: the result on unseen years is the one that counts, and it is usually lower.

A drop like this is not a failure of the method. It is the method working. The build years always flatter the rules, because the settings were chosen by looking at them. The unseen years show what is left after that advantage is removed. A trader who reads only the first number trades the flattered version.

What kinds of trading algorithms are there?

Trend following, mean reversion and breakout rules on bars of minutes or hours are the families a retail futures trader can run; spread trading, market making and execution algorithms need speed or capital that retail accounts rarely have. The families differ in what they try to capture and in how fast they must act.

Two indicators appear in the examples below. A moving average is the average close of the last N bars, redrawn on every bar, and the moving averages page covers its variants. The RSI (relative strength index) is an indicator from 0 to 100 that shows how strongly prices have risen or fallen over recent bars; the RSI page has the formula and the usual levels.

TypeWhat it doesExample rule ideaSpeed it needs
Trend followingBuys after prices rise and stays in while the move continues. It sells short after prices fall.Hold long while the price is above a moving average.Low: minutes, hours or days
Mean reversionBets that a price stretched far from its average will move back toward it.Buy when the RSI is very low and exit when it returns to the middle.Low to medium
BreakoutEnters when the price leaves a recent range.Buy when the close is above the highest high of the last 20 bars.Low to medium
Spread or statistical arbitrageTrades the gap between two related markets when the gap is unusually wide.Buy one contract month and sell another when their difference is extreme.Medium to high
Market makingPosts both a bid and an offer and aims to earn the difference between them.Keep quotes on both sides and adjust them as orders arrive.Very high: milliseconds or less
Execution algorithmsSplit one large order into many small ones to reduce the effect on the price. They do not decide direction.VWAP (volume-weighted average price) or TWAP (time-weighted average price) orders.Medium
Six algorithm families split by the speed they need: trend following, mean reversion and breakout run on bars of minutes or more and suit retail accounts, while market making, spread trading and execution algorithms need speed or size Slow rules suit retail Six algorithm families by speed needed Minutes or more Fast or large Trend following Mean reversion Breakout Market making Spread trading Execution algos Bar rules need no race to be first. So: build on bars of minutes+.
Algorithm families by the speed they need. The three slow families run on ordinary platforms; the fast ones need infrastructure near the exchange.

Speed is the dividing line. Market making and high-frequency trading depend on connections measured in fractions of a millisecond and on servers placed next to the exchange. A retail account connected through a broker's gateway from home is slower by a wide margin, so a rule that depends on being first will lose that race. The guide to high-frequency trading vs retail algo trading explains where the line sits and why it does not matter for bar-based rules.

Trend, mean-reversion and breakout strategies on bars of a few minutes or longer do not need that speed. A signal that forms at the close of a 60-minute bar and fills at the next bar's open does not care whether the order arrived in two milliseconds or two seconds. That is where individual futures traders have room to work, and the five rule types in the guide to futures algo trading strategies are all of this slow kind. When a trend, mean-reversion or breakout idea is written as indicators, parameter ranges and entry and exit conditions, it becomes a search space that AlphaPrime's strategy generation can fill with testable rule variants instead of one hand-written rule.

Execution algorithms are a different animal. They do not decide whether to buy; they decide how to buy what someone else already decided. A retail futures trader with one or a few contracts rarely needs them, because a small market order does not move the price enough to be worth splitting.

What is automated trading?

Automated trading is trading where a computer sends the orders to the broker without a person clicking a button; algorithmic trading means the rules decide, and the two are separate switches. You can turn either one on without the other, and most of the confusion around "automated trading" comes from treating them as one thing.

A two-by-two grid: rules or judgement decide, a person or a computer sends the orders, giving four combinations: rules followed by hand, the fully automated algo, discretionary trading, and judgement with automated bracket orders Who decides, who sends? Person sends Computer sends Rules decide Judgement decide By hand Daily bars ok Full algo No clicks Discretion Plain manual Assisted Auto brackets
Who decides and who sends the order are two separate questions. Algo trading is about the rows; automation is about the columns.

The four combinations all exist in practice:

  • Judgement decides, person sends orders: ordinary discretionary trading.
  • Rules decide, person sends orders: the trader follows a written system and places each order by hand. This is algorithmic but not automated. It works for rules on daily bars; it breaks down on 5-minute bars, because a person cannot keep up.
  • Judgement decides, computer sends orders: click-trading with automation tools, such as a bracket order that places the stop and target the moment the entry fills. The decision is still human.
  • Rules decide, computer sends orders: the fully automated algo. The platform reads each new bar, evaluates the rules and sends the order itself.

Automation changes execution, not the quality of the rule. Two pieces of research make that point from opposite directions. Hendershott, Jones and Menkveld (2011) studied algorithmic order flow on the New York Stock Exchange and found that more algorithmic trading went together with narrower spreads, especially in large stocks; the computers improved how orders met, not what the orders were betting on. The joint CFTC and SEC report on 6 May 2010 describes a large sell order in E-mini S&P 500 futures that was handed to an automated execution algorithm set to follow a share of trading volume without regard to price or time, in a market that was already under stress. The algorithm did exactly what it was told. The instruction, not the automation, was the problem.

For a retail trader the lesson is practical. Automation is worth having because it removes the delay between a signal and an order and because it never hesitates on the tenth losing trade in a row. It adds a few duties of its own: check every trading day that the platform's position matches the broker's position, know how to flatten every position by hand, and know what the platform does when the data feed drops. None of those duties makes a losing rule win, and none of them makes a winning rule lose. They keep the execution equal to what the backtest assumed.

Is algo trading profitable?

A backtest cannot promise a profit, and the measured run below shows why: one breakout rule with one fixed setting loses on 12 of 17 futures markets, wins on 5, and reaches a profit factor of 1.3 on only 1, so the honest answer depends on the rule, the market and the costs. The profit factor is the sum of all winning trades divided by the sum of all losing trades; 1.0 is break-even, and a value below 1.0 means the losers outweigh the winners.

The rule was the plain breakout from earlier in this article, with a moving-average exit: enter long when the close crosses above the highest high of the previous 20 bars, exit when the close crosses below the 50-bar simple moving average, on 60-minute bars, one contract, long only, with each market's own commission and slippage, from September 2018 to October 2026.

Source: AlphaPrime hosted backtest (ap_backtest connector), run 2026-10-31

MarketNet profitProfit factorTrades
GC$230,1861.421678
NQ$137,1451.135709
SI$97,8641.115695
YM$47,1081.118705
ES$17,4011.030697
ZS−$27,8150.845517
CL−$28,3600.936725
6J−$33,1600.758627
6E−$36,9700.772667
NG−$50,6920.870692
6B−$51,9670.623703
ZC−$52,1440.537501
ZW−$56,4230.666533
RTY−$59,7800.849730
ZN−$80,2050.464668
HG−$83,3960.802718
ZB−$156,4900.508657

5 of 17 markets finished above zero after costs; only 1 reached a profit factor of 1.3.

The same rule and settings on every market, 2018-09 to 2026-10, one contract each.
The same rule and settings on every market, 2018-09 to 2026-10, one contract each. 17 futures markets · 60-minute · 2018-09-02 to 2026-10-14 · AlphaPrime backtest

Read the table from the profit factor column, not the dollar column. Each market has its own point value, so a dollar on gold (GC) and a dollar on a Treasury bond (ZB) come from different amounts of price movement; the sign and the profit factor are comparable across markets, the dollar totals are not. The five markets above zero are gold (GC), Nasdaq-100 (NQ), silver (SI), the Dow (YM) and the S&P 500 (ES). Only GC, at 1.421, is above 1.3. ES, at 1.030, is close enough to break-even that a slightly higher slippage estimate would move it below zero. The twelve losing markets include every bond, currency and grain contract in the list.

What this run can show: a plain rule with one setting is not universal; the same code that looks good on one market loses on most others; costs decide the close case, ES; and with 501 to 730 trades per market, the differences are not caused by a handful of trades. What it cannot show is more important. It is one backtest over the whole period, so even the five positive markets have not passed any test on unseen data, and their settings have not been checked against their neighbours. It is long only, so it says nothing about the short side. It does not say that the twelve losing markets cannot be traded; it says this rule, at this setting, does not trade them. And it says nothing about the next year on any of the 17.

So run every rule to reject it, not to confirm it. A trader who tests one rule on one market, sees a profit and trades it has learned very little. A trader who tests the same rule across many markets, keeps only the ones that survive costs, validates those on unseen years and sizes for the worst drawdown has learned a great deal, even if the final answer is "not this rule". The full set of numbers that decide it for a retail account, from the average trade to the account size, is worked through in is algo trading profitable.

How much does algo trading cost?

The costs are a platform, historical data, a running computer or server, broker commission and exchange fees on every entry and exit, and slippage, and the per-trade costs decide more than the fixed ones because they are subtracted from every trade. A fixed cost is paid once a month whether you trade or not; a per-trade cost grows with the number of trades the rule makes.

CostPaid whenWhat decides the amount
Trading platformMonthly, or once for a licenceThe platform; some brokers include it with an account
Historical bar dataMonthly, or once per marketMarkets, bar resolution and length of history
Computer or serverMonthlyWhether it runs at home or in a data centre, and how many hours a day it must be on
Commission and exchange feesEach entry and each exit, per contractBroker, exchange and contract; micro contracts have smaller fees and smaller point values
SlippageEach entry and each exitLiquidity of the market, order type and the time of day the rule trades
Fixed costs (platform, data, server) are paid each month, while per-trade costs (commission, fees, slippage) are paid on every trade and so repeat once per trade Per-trade costs multiply Fixed monthly vs paid on every trade Each month Each trade × trades Platform Data Server Commission Fees Slippage Per-trade costs grow with trades. So: add costs before the first run.
Fixed costs are paid once a month. Per-trade costs are paid on every entry and exit, so they grow with the trade count.

The fixed costs are easy to see because they arrive as invoices. The per-trade costs are easy to miss because they are hidden inside each fill. Slippage is the difference between the price the backtest assumed and the price you actually get; market orders and stop orders usually fill worse than the trigger price, especially at the open and around news. In the hypothetical example earlier, the round trip of $25 took $25 out of a $90 gross average trade before any market movement went against the trader. A rule that trades three times as often pays that $25 three times as often and must earn three times as much gross profit just to stand still.

This is why strategies with many small trades are the first to fail when costs are added: their profit per trade is the smallest, and the cost per trade is the same. The simplest test is to compare the gross average trade with the round-trip cost; the guide to trading costs in backtests and the average-trade test shows the comparison step by step and what a safe margin looks like.

Three practical points follow:

  1. Get the per-trade cost from your broker's fee schedule, per contract, per side, and add the exchange and clearing fees. Fee schedules change, so check the current one rather than an old statement.
  2. Estimate slippage from your own fills if you have any. Without live history, start with at least one tick per side for liquid futures with market or stop orders, and more for thin contracts or trades at volatile times.
  3. Put both into the backtest before the first run. A search that ranks rules without costs favours the rules that costs will remove first, and the time spent on those finalists is wasted.

Set costs before the first test, not after. The per-trade cost is subtracted from every trade, so it decides which rules survive far more than the monthly platform bill does.

One cost is often forgotten: the time to review. An automated rule still needs a daily look at positions, orders and fills, and a weekly comparison of live results with the backtest. That is not a money cost, but a trader who cannot spend it should pick rules on slower bars with fewer trades.

Can you do algo trading without coding?

Coding is not the first skill; writing rules a computer cannot misread is, and the choice between Python, a platform language and a no-code generator is a choice about who writes the code, not about whether the rule works. All three routes end with the same thing: a rule, in a language the platform understands, that fills orders at the next bar and pays costs on every trade.

Three routes into a trading platform: Python and platform code are written by you and test variants slowly, a no-code tool writes the code itself and tests fast, and all three need the same checks before trading Same checks, any route Three routes into a platform Route Writes code Speed Python You Slow Platform code You Slow No-code tool Software Fast Same checks, whoever writes it. So: read the code, match the costs.
Three ways to get a rule into a platform. The code is written by different hands, but the checks before trading are the same.
  1. Python yourself. You write the backtest engine, the data loader and the rule, then write the rule again in the platform's language for live trading. You control everything and must check everything, from the order of bars to the fill price. The guide to algo trading with Python lists what you need to install and where the work gets hard, which is usually the cost model and the roll handling, not the rule itself.
  2. A platform language yourself. You write the rule once in the platform's own language, such as PowerLanguage in MultiCharts or Pine Script in TradingView, and the platform backtests and trades it. The engine is built for you; the rule is still yours to write and debug.
  3. A no-code generator with export. You describe the rule as indicators, parameter ranges and conditions, the software tests many variants with costs, and it writes the platform code for the ones you keep. The page on algo trading without coding shows what that looks like from the first search to the exported file; AlphaPrime writes the chosen strategy in the languages of six platforms, so the same rule can be loaded into the platform you already use.

What stays the same in all three routes is the list of things you must check before trading:

  • The rule you read is the rule the code runs. Open the exported or written code and follow one trade through it by hand. A rule that says "next bar's open" must fill at the next bar's open in the code.
  • The platform's backtest of the same code gives a similar trade list. Differences in rolls, sessions or cost settings show up here as missing or extra trades.
  • The costs in the platform match the costs in the research. A rule that survived $25 per round trip in research and is run with $0 in the platform looks better live than it is.

The real difference between the routes is how many variants you can test in the same evening. Writing and running one rule by hand takes an evening. Testing the same rule across 17 markets, as in the measured run above, or across hundreds of neighbouring settings, is the kind of work a generator does while you sleep. That speed is useful and also dangerous, because the more variants you test, the more likely the best one is simply the luckiest one. The next section is about telling the two apart.

Do trading bots work?

A bot only follows its rules faithfully, so the question is whether the rule is usable or lucky, which is answered by out-of-sample data, neighbouring settings, doubled slippage and the number of variants tried before the rule was found. A trading bot is an automated algorithm with a friendlier name; everything in this article about rules applies to it, and nothing about the word "bot" adds an edge.

Overfitting is when rules fit the random noise in past prices instead of a pattern that repeats. An overfitted rule looks excellent on the data it was built on and ordinary, or worse, on anything else. In-sample data is the part of history used to build and tune the rules; out-of-sample data is the part held back and used only once, for the check. The four checks below each catch a different way a rule can be lucky.

  1. Out-of-sample data, used once. If the average trade on unseen years keeps a reasonable share of the in-sample average trade, as in the $65 to $20 example earlier, the rule has passed its first test. If it falls to zero or below, the in-sample result was mostly fit.
  2. Neighbouring settings. If a 20-bar breakout works but 18 and 22 bars fail, the result depends on one lucky number. A usable rule sits on a plateau where the settings around it give similar results.
  3. Doubled slippage. Rerun the backtest with twice the slippage. A rule that turns negative was depending on cheap execution, which the live market may not provide.
  4. The number of variants tried. The best of a hundred variants is expected to look good by chance alone. Harvey and Liu (2015) argue that a backtest result should be discounted according to how many strategies were tried before it was found; the more you searched, the higher the bar the winner must clear.
Illustration of result against breakout length: a usable rule gives similar results from 16 to 24 bars, a lucky rule peaks only at 20 bars with its neighbours near zero Plateau or spike? Illustration: result by breakout length Usable Lucky 16 20 24 16 20 24 A lucky rule is one number. So: test the settings around it.
A usable rule sits on a plateau of neighbouring settings. A lucky rule is a spike at one value.

The fourth check matters more as software tests more variants. AlphaPrime's published benchmark measured about 1.2 billion strategy evaluations in about 18 hours on one RTX 3090, with commission and slippage in every evaluation (measured 2026-10-05). Real speed depends on the graphics card, the data length and the research settings. A search of that size will always produce a top result that looks remarkable, and the trader's job is to treat it as the start of validation, not the end. AlphaPrime's strategy validation runs Basic, Standard or Extensive validation with walk-forward analysis and custom thresholds on every candidate, and stops the later checks when a candidate fails one, so the same standard is applied whether ten or ten million variants were searched.

A rule that passes all four checks has earned a small live trial, nothing more. Three habits make that trial informative:

  • Size for the largest drawdown in the test, then assume the live one will be larger. A drawdown is the fall in account equity from a peak to the lowest point that follows it. The position size calculator turns an account risk and a stop distance into a contract count, which keeps the first live trades small by design rather than by hope.
  • Write down in advance the drawdown or the number of losing months at which you stop and review. A number written before the trial is a rule; a number chosen during a losing streak is an emotion.
  • Compare live fills with backtest fills every week. The bot is only as good as the match between the two.

Is algo trading better than manual trading?

Algo trading is better at consistency, testing and record-keeping and no better at predicting the market, so the common myths fall away once the computer is seen as the follower of the rules rather than the source of the edge. The table shows where each approach has the advantage and where both face the same market.

AlgoManual
Consistency of executionEvery signal is taken the same way, including the tenth loser in a rowDepends on the trader's state on the day
Ability to test on past dataAny rule can be run over years of bars before risking moneyJudgement cannot be backtested, only recorded going forward
Record of every tradeAutomatic: time, price, reason and cost for every fillOnly if the trader keeps a journal
Market riskUnchanged: the rules lose exactly as the market allowsUnchanged
Need for daily monitoringStill needed: positions, orders, fills, data feed, rollsNeeded by definition
Algo compared with manual trading: algo has the advantage in consistency, backtesting and trade records, while market risk and the need for daily monitoring are the same for both Better process, same risk Algo Manual Consistency Backtesting Trade record Market risk Monitoring Same Same Algo tests better; risk is equal. So: still check it every day.
What a computer running rules adds, and what it does not change, compared with trading by hand.

Three myths come from reading the first three rows and forgetting the last two:

  • "An algorithm removes risk." It removes hesitation and inconsistency. Losing trades and drawdowns happen exactly as the rules allow, and the measured run above lost on 12 of 17 markets with perfect consistency.
  • "More indicators make a smarter algorithm." Each extra rule or parameter gives more room to fit noise and makes the plateau check harder. Fewer parameters are easier to validate and easier to trust when they pass.
  • "Once it runs, it needs no attention." Connections drop, contracts roll and markets change. Automation removes the clicking, not the checking.

What algo trading does give a retail trader is three things manual trading cannot. First, a clear reason for every trade, written before the trade. Second, a known history of drawdowns and losing streaks, measured on past data with costs, so a live losing week can be compared with the test instead of felt. Third, a rule for when to stop, chosen while calm. A manual trader can have all three only by discipline; an algorithm has them by construction.

Use the cheap test first. Take one rule you already trade or believe in, write it so two people would place the same order at the same bar, and run it on every market you have data for, with each market's own commission and slippage. Reject it on every market where it does not finish above zero after costs, and send only the survivors to the out-of-sample check. If none survive, the rule has cost you computer time, not money.

Frequently asked questions

Is algorithmic trading the same as automated trading?

Not exactly. Algorithmic trading means exact rules decide the trades; automated trading means a computer sends the orders. Most algorithmic traders automate their orders, but you can follow rules by hand on daily bars, and an automated system is only as good as the rules it runs.

Can a beginner do algo trading without coding?

Yes, because the first skill is writing rules exactly enough that a computer cannot misread them, not writing code. Software can generate platform code from rules and test many variants with costs. You still need to read the exported code, follow one trade through it by hand and check that the platform's costs match the research before trading it.

How much historical data do I need for a backtest?

Enough to produce many trades and to cover different conditions, such as trending, ranging, calm and volatile periods. Many traders aim for several years of data and a hundred or more trades. Keep a part of that history aside for out-of-sample testing and use it only once.

Why does the same rule win on one futures market and lose on another?

Each market has its own trend behaviour, liquidity, tick size and costs, and a fixed setting such as a 20-bar breakout fits some of them and not others. In the measured run in this article, one rule finished above zero on 5 of 17 markets after costs. The result tells you to test a rule per market and to keep only the markets that survive costs and the unseen-data check.

Does algorithmic trading work for stocks as well as futures?

The same process works for stocks, futures and other markets. The details change: stocks have corporate actions such as splits and dividends in their data, while futures have contract rolls and per-contract fees. Set the data and the costs for the market you actually trade before the first test.

References

  • Hendershott, T., Jones, C. M., & Menkveld, A. J. (2011). Does Algorithmic Trading Improve Liquidity? The Journal of Finance, 66(1), 1–33.
  • Staffs of the CFTC and SEC (2010). Findings Regarding the Market Events of May 6, 2010. Report to the Joint Advisory Committee on Emerging Regulatory Issues, September 30, 2010.
  • Harvey, C. R., & Liu, Y. (2015). Backtesting. The Journal of Portfolio Management, 42(1), 13–28.