Detrend

Removes, inverts, or randomizes trend in historic price data. Can be set up for removing bias from the parameters, the trades, the indicators, or the whole price curve. Backtesting with detrended, inverted, or randomizied price curves is also a quick method to verify the robustness of a strategy. For removing trend, the curve or parts of it are "tilted" until the start and end prices have the same value.

Range:

The following flags can be set or combined with '+' or '|':
TRADES Detrend trade results. This removes trend bias from a backtest while keeping the properties of the price curve.
PRICES Detrend trade results and price functions; for detrending indicators and signals based on series generated with price() calls.
CURVE Detrend the historical price data on loading. This also affects the displayed price curve in the chart.
INVERT Invert the price curve by replacing prices with their reciprocal values. This reverses all trends in the curve, and can be used for a reality check of a system that is symmetric in long and short positions.
SHUFFLE Randomize the price curve by shuffling the price ticks. Keeps its overall trend and price range, but removes any short-term trends and correlations between the prices. Used for reality checks.
NOPRICE Do not subscribe the asset and do not detect gaps or fix outliers on loading; for data files that contain no prices, but other types of data.

Type:

int
 

Remarks:

Example:

if(Train) Detrend = CURVE; // detrend the whole price curve for training

See also:

mode, WFO, DataSlope, randomize

 

► latest version online