Bitcoin Forum
May 28, 2024, 05:49:10 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 5 [6]
101  Economy / Trading Discussion / “Turtle Trading strategy” implementations on: January 03, 2019, 04:10:17 AM
“Turtle Trading strategy” implementations

    Background

In 1994, Covel picked up an issue ofFinancial World and skimmed through an article titled "Wall Street's TopPlayers." Amongst famous investors like George Soros and Julian Robertson,Covel noticed a name he did not recognize at 25th on the list: R. Jerry Parker,who stated that he was trained as a "Turtle" by Richard Dennis(another name Covel did not recognize). Parker was the only investor in the tophundred advertised as being "trained," and as an investor himself,Covel found this story intriguing.

    Synopsis

Richard Dennis made over $200 million as a trader. After having a debate with his partner, William Eckhardt, about whether trading is learnable or an inborn talent, they proposed an experiment where they would spend two weeks training novices in the science of trading and then give them each $1 million to invest. The inspiration came from a trip Dennis took to a turtle-breeding farm in Singapore, stating, "We are going to grow traders just like they grow turtles."

Although each of the 1,000 applicants went through a rigorous application process designed to test their intelligence, ability to manage risk and mathematical skills, the makeup of the chosen Turtles differed greatly; they included a Czechoslovakian-born blackjack master, a Dungeons and Dragons game designer, an evangelical accountant, a Harvard MBA, a U.S. Air Force pilot and a former pianist. The Turtles would go on to gross over $150 million in four years.

    Trading rules:

In the capture of trend signals, the Turtle Trading Law uses a very important technical indicator, the Donchian channel. This channel is very similar to the familiar Bollinger Bands, but it is somewhat different in terms of specific calculations.

Richard Donchian invented this indicator. It consists of three curves of different colors. The indicator uses the highest price within the period (usually 20, some platform system settings can be changed, some can not be set) And the lowest price to show the volatility of the market price, when the channel is narrow, it means that the market volatility is small, otherwise the channel width means that the market volatility is relatively large.

When the price breaks through the upper track of the channel, it is a possible buy signal; on the contrary, it is a possible sell signal when breaking the lower track.

The calculation methods of the Donchian channel are as follows:

        Upper rail = Max (highest, n), the highest value of the highest price of n days

        Lower rail = Min (lowest price, n), the minimum value of the lowest price of n days

        Middle rail = (upper rail + lower rail)/2

Within the framework of multi-factor analysis in the financial sector, this strategy predicts the price trend after the breakthrough is based on the validity hypothesis of the momentum factor. Of course, the effectiveness of this factor has indeed been rigorously verified and complemented by the Fama-French three-factor model and is widely used in financial markets.

Of course, we can optimize and use more reasonable trend-breaking indicators.

So, since the momentum factor is a factor that has been publicly and widely used, then why can the Turtle Trading Law stand out from the crowd? The answer is simple. The Turtle Trading Rules define a set of very strict rules for position control and stop-loss. Let's take a look at each one.

    1. The basic unit of the position N

The principle of the Turtle Rule is to define a small unit (Unit) so that the expected value fluctuation of the position corresponds to 1% of the total net assets. In other words, if you buy the assets of this small unit, the market value of the position on that day will not change by more than 1% of the total net assets.

So how do you define this small unit? How do you estimate the value fluctuations that this small unit can bring? First, in predicting the value volatility of this small unit (this value volatility is called N), the Turtle Strategy uses a method of statistically averaging historical price volatility. The specific calculation formula is as follows:

        TrueRange = Max(High−Low, High−PreClose, PreClose−Low)

        N = (the sum of the N values ​​of the previous 19 days + the TrueRange at the time) / 20

Among them, High indicates the highest price of the day, Low indicates the lowest price of the day, and PreClose indicates the closing price of the previous day. We can see from the definition that the value of N can indeed properly express the recent fluctuations in the price of the asset.

Thus, a Unit should be calculated like this:

        Unit = (1%*Total_net)/N, Total_net is the total net asset value

It can be seen that the price volatility of a Unit's assets = 1% of the total net assets

    2. When to open a position

The action of opening a position comes from the generation of a trend breakthrough signal. If the current price breaks through the upper track, it will generate a buy position signal. If the current price falls below the lower track, it will generate a short position signal (the cryptocurrency market is supported by the short sale!)

Initial build size = 1 Unit

    3. When is the adding position?

If the holding position is long positions and the price of the asset has increased by 0.5N based on the last holding position (or adding position), then add a unit of long position;

If the holding position is short position and the price of the asset has dropped by 0.5N based on the last position (or adding position), then add a unit of short position.

We have seen that the Turtle Strategy is actually a strategy of chasing up and down.

    4. How to do dynamic stop loss

If the holding position is long positions and the price of the asset falls by 2N based on the last holding position (or adding position), then stop loss for all positions;

If the holding position is short position and the price of the asset has increased by 2N based on the last holding position (or adding position), then the entire position must be closed.

Of course, the user can customize the dynamic stop loss plan, such as a 0.5N drop to start partial closing position, instead of waiting for a 2N decline after a rush to close the position; after all, the impact cost is there.

    5. How to make a profit, can you customize the dynamic take profit?

In the Turtle Rule, the Take Profit signal is generated like this:

If the holding position is long positions and the current asset price falls below the lower track of the 10th Donchian channel, all position closed;

If the holding position is short position and the current asset price rises above the upper track of the 10th Donchian channel, all position closed.

Of course, users can customize the dynamic take profit plan, such as when the total net assets / initial net assets > 1.5, just take the profit.

    Advantage

The biggest advantage of the Turtle Trading Law is to help us establish an effective method of controlling the size of the position.

    Disadvantage

The turtle trading system has a common problem with the trend tracking strategy, which is the withdrawal of floating profit. The floating profit that is chasing up is likely to be spit out due to a sudden drop. It is very strong in the big trend, and it is not perform very well in the shock market.

Enough talk, let’s make it happen!

    M language

After 6 years of development, it has absorbed feedback from hundreds of thousands of users. It is a mature and stable model development platform. M language is the most widely used programmatic model development platform in China.

The M language advocates the building block programming concept, which encapsulates complex algorithms into individual functions and adopts the construction mode of “small syntax, large function”. Although the grammar is simple, it can also support logical and complex financial applications with a special programmatic data structure and a rich financial statistical function library.

The function library of the M language is updated frequently, and new functions can be added at any time according to the new requirements of the customer to support the new ideas and new applications of the programmer.

The FMZ Quant not only realized the interpreter of the grammar of M language, but also enhanced its ability to mix programming with high-level language such as JavaScript.

For example:

Code:
// here you can call any API function from FMZ Quant
scope.TEST = function(obj) {
    return obj.val * 100;
}
Closing price: C;

The closing price is magnified 100 times: TEST(C);

The previous closing price is magnified 100 times: TEST(REF(C, 1)); // The mouse moves to the backtest K line and the variable value is displayed.





(*backtest
start: 2018-06-01 00:00:00
end: 2018-11-21 00:00:00
period: 1d
exchanges: [{"eid":"Futures_CTP","currency":"FUTURES","balance":500000,"minfee":0,"fee":[0,0]}]
*)

// this demonstration mainly uses the Turtle Trading Rules to demonstrate the method of writing "position management, maximum position control and other fund management".
// only the demonstration key content statement is annotated, other statements please consult customer service
//This model is only used to demonstrate the use of this strategy, and enters the market accordingly, at your own risk.
Code:
TR:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));// True volatility
ATR:MA(TR,26); // Find a simple moving average of the true amplitude in 26 cycles, shown in the figure
ZOOM:=IFELSE(ISCONTRACT('@Futures_(?!CTP).*'), CLOSE, 1); // Compatible with cryptocurrency futures as margin
LOT:=((MONEYTOT*0.01*ZOOM)/(UNIT*ATR))*ZOOM;// Calculate the number of one hand based on 1% of equity
TC..IFELSE(ISCONTRACT('@Futures.*'), INTPART(LOT), LOT); // Compatible futures and spot ISCONTRACT starts with @ to indicate matching exchange name, support
MTC..4*TC; // Total position
HH^^HV(H,20); // Attached to the main image display
LL^^LV(L,20); // Attached to the main image display
CROSSUP(C,HH)&&ISLASTBK=0&&ISLASTSK=0&&BARPOS>=26,BK(TC);// The latest price exceeds the highest value of 20 cycles, the first time to buy long, the quality is TC hands
CROSSDOWN(C,LL)&&ISLASTBK=0&&ISLASTSK=0,SK(TC); // The latest price fell below the lowest value of 20 cycles, the first time to sell short, the quality is TC hands
C>=BKPRICE+0.5*ATR&&BKVOL<MTC&&ISLASTBK,BK(TC);// The price has increased by 0.5 times ATR on the basis of the last holding position, and when the number of hands does not exceed 4 times of TC, buy long the adding position of TC hands
C<=SKPRICE-0.5*ATR&&SKVOL<MTC&&ISLASTSK,SK(TC);// The price fell 0.5 times ATR on the basis of the last holding position, and when the number of hands does not exceed 4 times of TC, sell short the adding position of TC hand.
C<=(BKPRICE-2*ATR)&&BKVOL>0,SP(BKVOL);// The latest price is less than the opening price minus 2 times of ATR, stop loss and close position
C>=(SKPRICE+2*ATR)&&SKVOL>0,BP(SKVOL); // The latest price is greater than the opening price plus 2 times of ATR, stop loss and close position
CROSSUP(H,HV(H,10))&&SKVOL>0,BP(SKVOL);// The highest price up-cross the highest price of 10 cycles, closing the position
CROSSDOWN(L,LV(L,10))&&BKVOL>0,SP(BKVOL); // The lowest price down-cross the lowest price of 10 cycles, closing position
TRADE_AGAIN(10);

article originally from fmz.com
102  Economy / Trading Discussion / Re: How to learn trading? on: January 03, 2019, 03:07:59 AM
i suggestn you do some quantitative trading. move your energy for controling emotion to design a profitable trading strategy, there is a very beginner friendly platform fmz.com that you should check out, with little programming knowledge, you can write your own trading bot or do some arbitrage tradings.
103  Economy / Trading Discussion / Re: BTI Report: A Majority of the Cryptocurrency Exchanges Fake the Trading Volumes on: January 03, 2019, 01:40:53 AM
right now, it is a great time for trader to do cross exchanges arbitrage trading among these exchanges.
104  Economy / Trading Discussion / Re: The Difference between Quantitative Trading and Subjective Trading on: January 02, 2019, 09:50:39 AM
 Grin Cool Cool Grin
105  Economy / Trading Discussion / The Difference between Quantitative Trading and Subjective Trading on: January 02, 2019, 03:49:42 AM
Quantitative trading

Quantitative systemic traders, enter rules + exit rules + fund management are all quantified. The typical is the turtle trading rules. You are given the model and you know what to do. The model is written in detailed language and you can understand it. This is a systematic trading model that can be quantified.

Quantitative trading relies on a large number of data analysis to produce sample results, and the results are based on sufficient analytical data.

Advantage of quantitative trading

The advantage lies in its discipline, systematicness, timeliness, accuracy and decentralization.

1. Discipline: Strictly implement strategic thinking and overcome the weakness of human nature: greed, fear, etc., to overcome the consequences of feeling good about themselves: chasing up and killing low.

2. Systematicness: Capture more investment opportunities through multi-level quantitative models, multi-angle observations and massive data.

3. Timeliness: Quickly track market changes, comprehensively scan market information, and continuously discover new statistical models that can provide excess returns and find more trading opportunities.

4. Accuracy: Accurately and objectively evaluate trading opportunities, overcome subjective emotional biases, and capture opportunities arising from mispricing and erroneous valuation.

5. Decentralization: that is, winning by probability. There are two main aspects. First, quantitative investment continuously extracts historical laws that are expected to be repeated in the future and uses them. These historical laws are strategies with a high probability of winning. The second is to rely on the selection of portfolios that have high probability of winning, rather than focusing on one. As the saying goes: don't put eggs in the same basket.

Quantitative features:

1. Each analysis has consistency and reproducibility in the early stage. More importantly, consistency is the result of each analysis. It is difficult to evaluate trading opportunities accurately and objectively, overcome subjective emotional bias, and track market changes quickly and efficiently.

2. Quantitative investment can be decentralized, Because people's energy is limited after all. It is difficult to concentrate on trading multiple varieties simultaneously. The more varieties, the greater the error, the greater the human deviation. Quantitative investment does not have this problem, and it can achieve consistency, analyzability and verifiability for all kinds of trading.

Subjective trading

Subjective trading is man-made discovery of opportunities and man-made orders. It’s mainly based on experience, To study the market and summarize his own trading system, so as to choose whether to place an order or not when a trading signal appears. Subjective trading believes that things have happened in the past will happen in the future. The same decline pattern will still work next time. Though experience is very important, but no one can step into the same river. After all, the past is not the future, so it won’t work every time. Once it is not working, people are easily become suspicious, worrying about gains and losses. Thus, the randomness is strong, people are easy to be plagued by profit and loss, and affected by emotions, which makes it difficult to stabilize profits.

This image has an empty alt attribute; its file name is smiley-2979107_960_720.jpg
Defects in subjective trading:

1. The subjective trading strategy contains the elements of human judgment, so it cannot be repeated precisely and lacks of stability. Because of subjective interference, there is no way to be consistent.

2. Subjective trading is inefficient.

Quantitative trading is simply an investment method that uses the data model as the core, programmatic trading as the means, pursuing absolute returns as target. Quantitative investment mainly relies on mathematical models to find investment targets and investment strategies. By establishing mathematical models to realize trading concepts, it has a complete evaluation system. After the model is established, through the backtesting of historical data, to determine that the model can operate effectively in all market stages and achieve profitability.

And subjective trading pays more attention to human analysis and investors’ perceptions. People’s feelings are complex and unreliable. Human beings often have many misunderstandings about things. These misunderstandings make wrong judgments in investment.

We hope every trader can have more options when they choose trading methods instead of trading only by emotion, and we will share more quantitative trading strategies on FMZ Quant to meet more quants.

article originally from fmz.com
106  Economy / Trading Discussion / Re: Newbie should trade or not? Please give me idea. on: January 02, 2019, 01:59:05 AM
you should try some trading bots, start from the small amount, the main propose is understanding the original idea of trading strategy, knowing the what is a reasonable profit-loss ratio, fund management and lower your emotion control energy by the computer to do its job. but remember, don't use those trading bot that you can't see what's inside, it's better to use those platform that you can write your own trading bot but don't need too much programming skills.
107  Alternate cryptocurrencies / Marketplace (Altcoins) / What is the most troublesome thing about quantitative trading? on: August 13, 2018, 08:29:50 AM
Endless programming details, which is the barrier of prevent you from turning strategy thinking into to a real project.

Of course, basic programming knowledge reserves still have to be there, but the details of the bottom mechanism should not be a stumbling block to hold back your strategy as soon as possible to run.

The meaning of the term "Quants" is a very broad concept. Usually operated as a common team, everyone on this team can be called a “Quants”. In the team, someone is responsible for writing the program; someone is responsible for formulating the strategy; someone is responsible for the maintenance and backtesting of the actual running of the strategy; someone is responsible for the establishment of strategic mathematical models (especially algorithmic trading); and others are responsible for the study of market fundamentals.

As can be seen from the above, why the “Pros” are professional? because an effective division of labor can produce greater and better performance.

As an individual investor, how do you compete with these professional teams? After all, a person's ability is limited. Even if you are the same genius as Einstein, IQ can crush anyone in the above-mentioned team, but from the time perspective, I believe that it will still cost you a lot more times than an operation team.

As a trader, please think carefully about a problem. Each of member in the above teams has their own roles and is vital to the actual operation of the project. But what is the most important thing?

Strategy, Strategy, and Strategy!!! this is the core component of all so-called "quantitative trading" Everything in the team is a derivative of this factor. Assuming that "strong artificial intelligence" have been invented one day, the computer can understand human language without barriers, no longer need professional programmers, as a quantitative trader, what do you need to do? Strategy, still the strategy, traders only need to tell the computer the strategy process, the strong artificial intelligence computer will understand the human language, and then trade the strategy you developed.

Is there a place to help you to do the quantitative research and automotive bottom mechanism construct?

In our FMZ(www.fmz.com) platform, the demand for digital currency has been set up fully functioned. From the bottom mechanism to the optimizing order runway. Even in the above-mentioned strong artificial intelligence aspect, “the Argos machine learning system” of the futures market launched by our platform is used to automatically collect major mainstreams news and events. The information on the financial market is then automatically studied in “deep learning” to determine the long and short-term impact on a certain variety.

Automation on digital currency exchanges is the boring programming details mentioned earlier in this article, such as the interface interaction processing of major exchanges, the processing of the runway after you place an order. Most importantly, in order to verify the effectiveness of the strategy, the construct of the backtesting system.

If you want build a backtesting system yourself, you need to understand computer science, you need to learn the operating system (such as server-side LINUX as cloud computing), you need to understand programming languages such as C++ (especially for high-frequency trading), python (strategy writing, machine learning) ), R (scientific computing, machine learning), you need to understand the order trading mechanism at the bottom of each major exchange, you need to optimize your order runway to ensure that your order can be quickly executed.

All of the above, in the current world market environment, with one person's power, is almost an impossible task, especially for those who do not have any computer science foundation. And this may just be for a single exchange or market. For digital currencies, there are currently many exchanges, and the mechanism for processing orders at the bottom of each exchange is different, which further increases the learning curve.

You may have to spend years on the computer science knowledge mentioned above, during the studying period, you may not be able to implement any trading strategy from your mind. You will miss a lot of trading opportunities, especially for professional traders, who need to spend a lot of time on this knowledge so that they can't concentrate on trading, resulting in no income, which leads to psychological distortion of their trading life.

FMZ platform is born to solve the above problems, we have a professional team, professional programmers with more than 20 years of programming experience, build all the underlying mechanisms, backtesting system (accurate to the second level of data), every major exchange interface, runway and order delivery optimization.

Just pay attention to your strategy. This does not mean that you don't need any programming skills. You only need to master one programming language. Python is strongly recommended here, because he is not only in the field of quantification, but also the most promising language for artificial intelligence applications in the future, Python. As a high-level script language, with its simple syntax, efficient learning curve, and a huge library, it has won the favor of many Quants. Using it to focus on your strategy is the most effective investment in your time and effort.

On our platform, Python can quickly implement your strategy, whether it is traditional technical indicator analysis or algorithmic trading, or the most popular deep learning, through spare time learning (professionally learning even better), leave the cumbersome details of the construction that are not relevant, it is the best implementation tool.

Remember, you are a trader, not a programmer. Professional things are better left to professional people. 

Telegram: https://t.me/fmzquant    Twitter: https://twitter.com/FMZ_Quant
108  Bitcoin / Project Development / This is a platform that mainly focus on digital currency Quantitative trading. on: July 06, 2018, 02:51:40 AM
This is a platform that mainly focus on digital currency Quantitative trading.

Writing your strategy by avoiding the tedious and irrelevant programming details, don’t make your own wheels, using our wheels to mainly focus on driving the car. (the strategy!!!)

If you are a rookie, various professionals responsible for algorithms, strategies, programming and fund management together form a powerful and effective community to help you grow step by step. If you are a pro, share your programming skills or strategies for more benefits.

We look forward to your joining.

www.fzm.com

Follow us on: https://twitter.com/FMZ_Quant

Telegram:
https://t.me/FMZQuant
109  Bitcoin / Project Development / This is a platform that mainly focus on digital currency Quantitative trading. on: July 03, 2018, 10:19:03 AM
This is a platform that mainly focus on digital currency Quantitative trading.

Writing your strategy by avoiding the tedious and irrelevant programming details, don’t make your own wheels, using our wheels to mainly focus on driving the car. (the strategy!!!)

If you are a rookie, various professionals responsible for algorithms, strategies, programming and fund management together form a powerful and effective community to help you grow step by step. If you are a pro, share your programming skills or strategies for more benefits.

We look forward to your joining.

www.fzm.com

Follow us on: https://twitter.com/FMZ_Quant

Telegram:
https://t.me/FMZQuant


Pages: « 1 2 3 4 5 [6]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!