Pages:
Author

Topic: “Turtle Trading strategy” implementations - page 2. (Read 577 times)

newbie
Activity: 18
Merit: 7
In my experience, generally speaking, the simpler the system, the more robust it is. Beginning traders make the mistake of trying to develop a system that is rarely wrong. There is no Holy Grail of systems.
The Holy Grail of trading is inside of you, in terms of knowing yourself and your emotional weakness, and working to trade in a way to minimize harm from your weaknesses.

You can knock yourself out trying to create a system that is rarely wrong....you start with perhaps a pair of moving averages, then when it shows some promise but is wrong a few times in a row, you add some other indicator...then another and another. The result is, at best a system that has been "curve-fitted" to your test data and is not robust in real trading. The other effect is that your new super 5 layer indicator system
filters out too many trades.

Here's what I mean: Every trader using a mechanical system, which is what the "turtles" used, should know his/her system's "expectancy". If I have 100 trades, 60 of them profitable with an avg profit of
$20...and 40 losing trades with an average loss of $18, my expectancy is (.60 * 20) - (.40 * 18) = $4.80 / trade. The beginner mistake is to add layers of filters to the system to try to raise the expectancy
higher. In doing so, if they succeed it usually results in fewer trades, so even though each trade is more profitable than before the system was modified, they make less money because their new trade selection
parameters are stricter and gives fewer trades.

Example: I have system A detailed above: Expectancy of $4.80 / trade and with those selection parameters I get 100 trades/year....so I make $480

I then tweak system A and manage to raise its expectancy to $7.00 / trade. This new system (B) with stricter selection rules to filter out more losers only
generates 60 trades a year. Even though each trade makes more $, it only makes $420 in the same amount of time that system A made $480

Accept that losing is part of profitable trading. Casino's dont mind losing b/c they know that time is on their side. All they want is more chances to let their
statistical edge work for them and eventually/inevitably make them profitable.

As for what time frames to trade....day trade, swing trade, trend trade...that's where knowing yourself and your risk tolerance and ability to sit tight on a trade is critical. If you find a system that works on a daily chart using a 20 day indicator...but you know you are more risk averse and want a shorter horizon, test the system using the same number of chart bars(20 for the daily example that
I just mentioned) using 20 bars of an hourly/30 min/15 min/5 minute chart as a starting point for your testing.
member
Activity: 111
Merit: 13
Perseverance pays... a lot!
normal retail trader like most of us, even with the most advanced computing equipment, you still need solve the algorithm level of software issues. therefore, financial engineering is a systemic work. but it really just for pros?

i don't think so, we can't deal with the sub-minutes level of ticker date. but above a higher level of time period, such as 4-hour daily weekly and so on. with some traditional technical analysis, you will have a bigger change to be profitable.

what i trying to say is that at this "kind of level" of quantitative trading. we don't expected to be a rocket scientist, but at least we can take advantage the disciplinary management of computer to executed a reasonable and profitable trading strategy, which brings the next advantage of automated trading, we can backtest it as long, multi-variety and cross-variety as we want. it's impossible to do it by manual trading. also, after some backtest to prove a profitable trading strategy, the capital management method become more realistic, otherwise you just guess the trading results link to your capital management.  
newbie
Activity: 14
Merit: 0
surely it needs learning to understand and use this kind of strategy.
do you think it's better for day trader or long-term hodler?
how to modify this strategy to my own?
newbie
Activity: 18
Merit: 7
I have many years of experience in trading both in the CBOT bond pit and by computer, as well as designing profitable systems and backtesting. There is nothing magic about Dennis' system or Donchian Channels.
They did what anyone willing to work can do: Find a repeatable method that has a positive expectancy, apply aggressive money management rules to it, and trade it faithfully and consistently.

They picked people that they thought had personalities that would allow them to stick to the rules, which is critical for any "system".

Where things break down, and the problem with trading an otherwise profitable system that you havent developed yourself (with incorporated knowledge of yourself and your risk tolerance)
is that your brain won't let you follow ALL the rules, ALL the time.

For the vast majority of people, trading a system that someone else has developed is usually a fools game. It might be profitable on paper, and for the person that developed it, but if its
style and rules aren't compatible with your particular brand of "fear and greed" (which we all have), you're very likely to lose money.
legendary
Activity: 1512
Merit: 1041
I know this piece is more about "what" trutle trading strategy is instead of how it started but I can't really go beyond that part. First of all these people were given a method that would probably yield them profits unless something unthinkable happens. Hence they were suppose to follow an order and make money with that strict line given to them.

Lets take a look at the candidates, a black jack master is a guy who can read cards and numbers to do card counting to beat the house and gain house edge, with that in mind he needs to perfect his skills and strictly follow the card counting rules, perfect for this type of job, dungeons and dragons DM is a guy who writes these kinds of amazing stories and lines and make others follow the path without really going above or below the game limits, perfect again, air force pilot drives a plane that's multi-million sometimes goes into hundreds of millions of dollars worth, he needs to know his plane so well that even what could go wrong needs to be in his mind, amazing candidate, former pianist is someone who mastered piano on which keys do what and what you click gives what sound and memorize the notes and songs and so forth, again amazing.

Basically they picked candidates that worked all their lives on perfecting something that needs to be followed stirctly just like trading, they knew who they were hiring and not people who are emotional about stuff.
legendary
Activity: 3080
Merit: 1353
Great info,but I think that this is way too technical and most of the newbie traders won't understand how it works.Somebody has to simplify it.It would be great if someone creates a trading bot around this strategy.
I might be interested in asquiring such bot. Grin

Exactly, even a mid level trader would be lost be lost with some of the technical aspect of this trading strategy. But yes I agree that if a bot would be created (maybe the OP can hire someone), then it will be much easier for a casual trader to understand and take advantage of this method. I'm not saying its bad, but traders mostly don't want complex trading methods. They just want it to be simply and yet effective so a bot will be a good "nice to haves".
member
Activity: 67
Merit: 24
Quote
way too technical
This is one of the most basic strategies ever, created in 1970s. You are in an industry where you are playing against some of the best mathematicians, developers and financists. I think you need to get a little bit technical to stand a chance.
hero member
Activity: 3164
Merit: 937
Great info,but I think that this is way too technical and most of the newbie traders won't understand how it works.Somebody has to simplify it.It would be great if someone creates a trading bot around this strategy.
I might be interested in asquiring such bot. Grin
member
Activity: 111
Merit: 13
Perseverance pays... a lot!
Do you have backtests results for different coins with this?

https://www.fmz.com/strategy/132298


overhere, some more backtest results
member
Activity: 67
Merit: 24
Do you have backtests results for different coins with this?
member
Activity: 111
Merit: 13
Perseverance pays... a lot!
no one cares? Cry
Of course someone has read your post and to be honest, I'm not aware of this kind of strategy. Everyone has already some trading strategy that works so they don't want to overly complicate things on their end. Personally though, I need to read more and understand how I can apply it, however, I'm not into trading right now because of the market conditions, but maybe I will give it a try.


thanks a lot
sr. member
Activity: 2618
Merit: 439
no one cares? Cry
Of course someone has read your post and to be honest, I'm not aware of this kind of strategy. Everyone has already some trading strategy that works so they don't want to overly complicate things on their end. Personally though, I need to read more and understand how I can apply it, however, I'm not into trading right now because of the market conditions, but maybe I will give it a try.
member
Activity: 111
Merit: 13
Perseverance pays... a lot!
no one cares? Cry
member
Activity: 111
Merit: 13
Perseverance pays... a lot!
“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&&BKVOLC<=SKPRICE-0.5*ATR&&SKVOLC<=(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
Pages:
Jump to: