The Gap Momentum System
The Financial Hacker
by Petra Volkova
1M ago
Jerry Kaufman, known for his technical indicators bible, presented in TASC 1/24 a trading strategy based on upwards and downwards gaps. For his system, he invented the Gap Momentum Indicator (GAPM). Here I’m publishing the C version of his indicator, and a simple trading system based on it. The indicator is a straighforward conversion of Kaufman’s EasyLanguage code to C: var GAPM(int Period, int SignalPeriod) { var UpGaps = 0, DnGaps = 0; int ix; for(ix = 0; ix < Period; ix++) { var Gap = priceO(ix) - priceC(ix+1); if(Gap > 0) UpGaps += Gap; else if(G ..read more
Visit website
High-Conviction Trading
The Financial Hacker
by Petra Volkova
5M ago
In the TASC September issue, Alfred Tagher presented a new indicator based on the Commitment Of Traders (COT) report. This report is available on the NASDAQ website. It is released weekly by the Commodities Futures Trading Commission and reflects the activities of various groups of commercial and noncommercial traders. Evaluating this report allows trading systems to automatically follow the “smart money”. The Zorro platform offers indicators for evaluating the COT report, under the names COT_CommercialIndex and COT_CommercialPos. This makes the conversion of the author’s EasyLanguage code ver ..read more
Visit website
Undersampling
The Financial Hacker
by Petra Volkova
1y ago
All the popular ‘smoothing’ indicators, like SMA or lowpass filters, exchange more lag for more smoothing. In TASC 4/2023, John Ehlers suggested the undersampling of price curves for achieving a better compromise between smoothness and lag. We will check that by applying a Hann filter to the original price curve and to a 5-fold undersampled curve. The C code of the used Hann filter, straight from Ehler’s article: var Hann(vars Data,int Length) { var Filt = 0, Coeff = 0; int i; for(i=1; i<=Length; i++) { Filt += (1-cos(2*PI*i/(Length+1)))*Data[i-1]; Coeff += 1-cos(2*PI*i/(Length ..read more
Visit website
Open or Close? Why Not Both?
The Financial Hacker
by Petra Volkova
1y ago
In his TASC February 2023 article, John Ehlers proposed to use the average of open and close, rather than the close price, for technical indicators. The advantage is a certain amount of noise reduction. On intraday bars the open-close average is similar to an SMA(2). It makes the data a bit smoother, but at cost of additional lag by half a bar. The script below, in C for the Zorro platform, compares the standard RSI with the open-close average RSI on the S&P 500 index with 15-minute bars: void run() { BarPeriod = 15; StartDate = 20220629; EndDate = 20220712; asset("SPX500"); var ..read more
Visit website
Crypto-Trading with REST, part 1
The Financial Hacker
by jcl
1y ago
Many brokers and exchanges can nowadays be accessed online with a REST API. The days of awkward proprietary broker APIs are coming to an end. This article is a step by step instruction of implementating a REST API interface in plain C for connecting a trading system to the Bittrex cryptocurrency exchange. It’s for the Zorro platform, but the principles are also valid for other exchanges and platforms. Since we’re using available functions, we’ll need only a relatively short piece of C code for a basic REST API implementation.  For connecting the Zorro platform to a particular broker API ..read more
Visit website
The Linear Regression-Adjusted Exponential Moving Average
The Financial Hacker
by Petra Volkova
1y ago
There are already uncounted variants of moving averages. Vitali Apirine invented another one in his article in the Stocks&Commodities September issue. The LREMA is an EMA with a variable period derived from the distance of the current price and a linear regression line. This ensures an optimal EMA period at any point – at least in theory. Will this complex EMA variant beat the standard EMA for detecting trend changes?  The LR_EMA indicator can be directly converted from Apirine’s MetaStock to C: var LREMA(int Periods,int Pds,var Mltp) { var Mltp1 = 2./(Periods+1); var LR = Linear ..read more
Visit website
Ehlers Loops
The Financial Hacker
by Petra Volkova
2y ago
Price charts normally display price over time. Or in some special cases price over ranges or momentum. In his TASC articles in June and July 2022, John Ehlers proposed a different way of charting. The relation of two parameters, like price over momentum, or price A over price B, is displayed as a 2D curve in a scatter plot. The resulting closed or open loop is supposed to predict the future price development. Of course only if interpreted in the right way. For his loop chart, Ehlers filtered the low and high frequencies out of the two data series with a roofing filter. Its code in C for Zorro ..read more
Visit website
Never Sell in May!
The Financial Hacker
by Petra Volkova
2y ago
“Sell in May and go away” is an old stock trader’s wisdom. But in his TASC May 2022 article, Markos Katsanos examined that rule in detail and found that it should rather be “Sell in August and buy back in October”. Can trading be really this easy? Let’s have a look at the simple seasonal trading rule and a far more complex application of it. The trading algorithm “Sell in August and buy back in October” could have been realized with the Zorro software in just 5 lines of C: asset("SPY");if(month() == 8 && tdm() == 1) // sell 1st trading day of August exitLong();else if(month() == 10 ..read more
Visit website
Why 90% of Backtests Fail
The Financial Hacker
by jcl
2y ago
About 9 out of 10 backtests produce wrong or misleading results. This is the number one reason why carefully developed algorithmic trading systems often fail in live trading. Even with out-of-sample data and even with cross-validation or walk-forward analysis, backtest results are often way off to the optimistic side. The majority of trading systems with a positive backtest are in fact unprofitable. In this article I’ll discuss the cause of this phenomenon, and a way to fix it. Suppose you’re developing an algorithmic trading strategy, following all rules of proper system development. But you ..read more
Visit website
The Relative Vix Strength Exponential Moving Average
The Financial Hacker
by Petra Volkova
2y ago
The exponential moving average (EMA) and the Relative Strength Indicator (RSI) are both very popular and useful indicators for algorithmic trading. So why no glue both together to get an even better indicator? That was the basic idea of Vitali Apirine’s TASC 3/2022 article. We’re measuring the relative strength of a volatility index (VIX), and use the result as an EMA time period. Do we now have the ultimate indicator to beat them all? The algorithm from Vitali’s article, slightly reformulated for clarity: RSEMA[0] = Alpha * Price + (1-Alpha) * RSEMA[1] This is a classical EMA, but with a vola ..read more
Visit website

Follow The Financial Hacker on FeedSpot

Continue with Google
Continue with Apple
OR