Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement CTA transaction system and Strategy in My language

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the My language how to achieve CTA trading system and strategy related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this My language how to achieve CTA trading system and strategy article will have a harvest, let's take a look.

The first Generation CTA Trading system and Strategy

The first generation of CTA trading system appeared in the 1960s and 1970s. Due to the strong trend of the commodity market at that time, the CTA strategy made considerable gains at that time. The strong trend in commodity markets during this period can be attributed to sustained economic growth and rising economic inflation after the second World War. A strong trend market allows a simple trend tracking system to achieve better returns. The first generation CTA system deals with less basic markets and varieties, and the trading system is relatively simple, usually a trading system that tracks multiple trading targets. Due to the trend of the commodity market at that time, this strategy worked well.

The strategies used in the first generation of trading systems are those that are now familiar with trend tracking strategies, such as moving average systems (plus some simple filtering conditions, for example, when the short-term moving average exceeds the long-term moving average or vice versa), a simple trend tracking strategy can effectively take advantage of the continuous trends of the trading target fundamentals. Sustained economic growth, inflation and the oil crisis are the reasons behind this persistence. However, when many traders use the same strategy and the persistence of fundamentals no longer exists, the first generation of trading strategies need to be developed to adapt to the new environment.

The second Generation CTA Trading system and Strategy

Due to the decoupling of the US dollar from gold, the financial futures market developed rapidly between 1970 and 1980, allowing futures management funds to participate in many futures markets, including money markets, bond markets, stock index futures and stock financial derivatives. In addition, the development of information technology and low cost make it easy to obtain data during the day. The increase of the scale of funds entering the CTA fund and the intensification of competition make the CTA strategy more complex and adaptable.

Based on the above market characteristics, the second generation CTA trading system and strategy have the following characteristics compared with the first generation CTA strategy:

The themes of the deal are more diverse. The entry of the financial futures market makes the trading varieties and markets more diversified.

On the trading strategy, the strategy of the second generation CTA trading system is not limited to pure trend tracking and price breakthrough. Apply more mathematical models to monitor multiple markets. Whether trend tracking is used according to different market conditions or average response strategies. As many institutions participate in the liquidity of the futures market, a period of sustained low volatility in the futures market has also emerged. In this case, the traditional first-generation CTA system is difficult to make a profit and adapt to market changes. The strategy has become important.

The second generation CTA strategy can make short-term transactions in the trading window and hold time. Unlike the first-generation CTA strategy, the second-generation strategy has begun to monitor intra-day trading patterns of short-term and high-frequency trading. This feature stems from the development of computer technology, which makes the provision of financial data more timely and frequent.

The third Generation CTA Trading system and Strategy

The third generation CTA trading system is the further diversification, decentralization and more adaptability of the second generation trading system. The third generation of CTA uses more trading systems to trade more markets and varieties. Strategically, use a more profitable market model. All of this is based on a combination of running multiple models in multiple markets.

In view of the wide application of CTA strategy, and the precipitation over time, it is a classic strategy model (especially for novices) that the majority of quantitative traders widely contact and want to know. The inventor quantitative platform developed the standard CTA strategy class library a long time ago. If readers want to apply CTA strategy in the inventor quantitative platform, they simply copy the code or directly refer to this library.

Extensibility is also very convenient, the comments of the code are very clear and easy to understand, and if you want to make in-depth customization or extension, you only need to proceed directly under the existing framework.

Partial source code (JavaScript version):

Function main () {$.CTA (exchanges [0], 0.01, function (r, mp, pair) {/ / the first parameter is the exchange object, the second parameter is the minimum order quantity required by the exchange, the third anonymous function function () {...} is the callback function, the transaction logic is written in this function, and the first parameter r of the callback function receives the latest K-line data. The second parameter receives the number of positions, and the third parameter receives the trading pair name if (r.length

< 20) { // 判断K线柱数量 return } var emaSlow = TA.EMA(r, 20) var emaFast = TA.EMA(r, 5) var cross = _Cross(emaFast, emaSlow); // 判断指标相交状态,_Cross参看:https://www.fmz.com/bbs-topic/1140 if (mp 1) { Log(pair, "买, 金叉周期", cross, "mp:", mp); return 0.1 * (mp < 0 ? 2 : 1) // 返回的数值就是要开仓的数量,正数是 开多,负数是开空,0是全部平掉。 } else if (mp >

= 0 & & cross

< -1) { Log(pair, "卖, 死叉周期", cross, "mp:", mp); return -0.1 * (mp >

0? 2: 1)}})}

This is the end of the article on "how to implement CTA trading system and strategy in My language". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to implement CTA trading system and strategy in My language". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report