Bitcoin Forum
May 28, 2024, 05:37:06 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 [3] 4 5 6 »
41  Economy / Trading Discussion / Re: Do you have faith in your trading? on: January 28, 2019, 01:09:06 AM
article originally form FMZ.COM

Before making my response and my point of view to the article you have posted, I have just one question.

Do you understand what you have pasted?
I'm sure he didn't cause he didn't even understand a simple rule which is to paste the direct source.
With this long article, I don't want to read as it only makes be bored, as an OP, I would appreciate if he will also share some insights of what he copy pasted
.


and one more thing, i have been trading for more than 10 years, not only in the crypto market, from stocks to commodity futures. so, my trading experience is abundant than you think, right now, i just hired by FMZ.COM to share my opinion about trading, some native questions i don't want to answer them all, as a trader, i strongly advise you don't judge something too quick, and, do some search before express your opinion.
42  Economy / Trading Discussion / Re: Do you have faith in your trading? on: January 28, 2019, 12:58:10 AM
article originally form FMZ.COM

Before making my response and my point of view to the article you have posted, I have just one question.

Do you understand what you have pasted?
I'm sure he didn't cause he didn't even understand a simple rule which is to paste the direct source.
With this long article, I don't want to read as it only makes be bored, as an OP, I would appreciate if he will also share some insights of what he copy pasted
.



the article itself is my insight and opinion, what more do you want? and by the way , the article is written by me, so if you wonder the copyright problem, please don't!, i have the totally copyright of all the articles on https://blog.mathquant.com/ and FMZ.COM.
43  Economy / Trading Discussion / Re: Jump in with trend and get out with the trend! on: January 26, 2019, 08:21:12 AM
everything just luck , you just haven't realize it yet. our decision just under a higher dimension of  “Random walk”。 manage your risk, you can't manage your profit.

I think you're not getting the point here. What we are saying is that how can a higher being influence the market price? Yes, luck may play a role but that is not within our control.

Everyone should focus on the tangibles, i.e. trading pattern, technical analysis and other indicators that will help you make a good trading decision. So what if you lose in this game and this jump in/out trend doesn't work in the long run? Do you have God to blame for that?

good point!
44  Economy / Trading Discussion / Why do you have to learn to lose money in the futures market? on: January 26, 2019, 07:43:12 AM
article originally from FMZ.COM

Never forget that securities exchanges are the most intense battlefield for money in the world.

1. Lose money to understand

How do you call it to understand? It is to know the huge risks, and then according to the plans, according to the ideas, to lose money according to the expectations.

This seems to be unpleasant, and it is like telling a joke, but it is not. I am not asking you to intentionally and actively to lose money.

The purpose is of course to make money. What I am saying is that every time we should have a specific plan: If the market goes back at which price, how much will be lost when leaving the market. It is sensible to admit defeat of a battle. But it does not mean that we lost the entire war. Don't worry, the opportunities behind will come one after another, as long as we still have the strength and will to win at any time.

What I mean “lose money to understand” also includes: You should understand in advance, after you lose the money, what is the impact on your overall trading operation, whether it has a major impact, and what adjustments are needed in strategy and tactics. It also includes an impact on the mindset.


2. “losing money” must make sense.

Not every position of “losing-money” in the market is a bad position, nor a “making-money” position is it a good position. A professional trader must earning by meanings, losing by reasons.

What is losing by reasons? First of all, the proportion of profit risk should be reasonable, that is, how much the risks are willing to take for seeking profit.

For example: If the market is reversed, it is ready to pay 30,000 to leave the market. If you are right, you can earn 3,000 before you reach the next resistance and support. Is this a good reason to enter the market?

If the market goes against you, you really lose money and leave, so I think that you are unreasonable because you risked ten times more than the profit you are looking for. It seems that you completely forgot the idea of using the small money to acquire the big profits.

You are using the big money to acquire the small profit, even if you make nine consecutive profits, it will not enough for losing in the long run.

Besides, how much will you can be grasping the continuous profit? With this kind of thinking, the winning and losing odds have already determined before you enter the market.

If you reverse the profit-risk ration, don’t you think that the losing is more reasonable?

Secondly, the price of the stop loss should be set after an effective support and resistance level, that is to say, you should identify a pass for your exit, so that you have a reason to stay on duty.

This pass is a long and short position battle for a fierce price, where we can verify the development trend of the overall situation at a very small cost. In these fiercely contested gates, the classics of the futures market are often staged.


If it is a rushing upswing market and a sharp downturn, you want to follow the trend, and neither of these two conditions has any reference value. How to do?

1. Small amount position follow-up with the market continues trend, which will whether evolved in the expected direction or not, then you can gradually increase or decrease the position, the main concern is to control the risk.

2. The trend momentum is slightly reversed or stagnant, you need decisively leave the market without hesitate on any profit or loss. We must remember that no matter what kinds of market, we all dare to jump in, because we can control the risk decisively.

Some people say that the operation should be daring, and some people say that it should be stable. In fact, they are all right, the overall stability, partial boldness. The overall stability, individual boldness. Both are indispensable.

How many times you make a profit in the futures market is not very meaningful. The significance of making small money is not great. You must not take big risks to win small profits. Don't make a loss that won’t cover multiple time profits.

Never use the purpose of making small money for market deployment and operations.

The ultimate goal of “using the small money to acquire the big profits” is to make a huge profits in the market. "Seeing the benefits and leaving" not only violates the principle of "big profits", but also does not reduce your risk.

The profit target should be set at 100% of the total margin - the ability to withdraw the principal to win.

The market always has vibrations. Don't be shocked by a slight shock to escape and miss the opportunity to make big money.

Never forget that securities exchanges are the most intense battlefield for money in the world.

article originally from FMZ.COM
45  Economy / Trading Discussion / Probabilistic thinking on: January 26, 2019, 03:52:43 AM
article originally from FMZ.COM

Market research module

It serves the trading strategy and fund management. Aside from this point, any market judgment has no target, no standard can be set, and there is no practical significance. The research contains predictions, but not only the pre-opening forecast, but also the tracking evaluation after the opening of the position.


Market research needs to answer two questions:

1. when to enter

The answer must be clear, it can be an exact price, or a clear interval. In general, regardless of the analysis method used by investors, the types of incoming signals can be roughly divided into two types:

1) Homeopathic trading type: Take advantage of the trend.

2) Contrarian trading type: low suction and high throw.

This is two completely different analysis ideas, and both of them can be used, but it is better not to switch ideas in the transaction!

2. when to leave

Leaving contains three layers of meaning:

1) because the development of the market does not meet the investor's position standards;

2) for stop loss and take profit;

3) it should be proactive.

The market research must clearly answer this question. Compared to the first question, this question is easily overlooked, so this issue is more important. When to enter is determined by when to leave.

Fund management module

The purpose of futures trading fund management:

1.

It is to survive in the market and survive for a long time.

In order to survive, losses must be limited as small. This "small" is a relative concept. Although everyone understands differently, it should be our absolute pursuit in the transaction process, because we can't predict that there will be how many times of losses in succession. We can only control that every loss is small.

2. Profit is the ultimate pursuit of futures trading. Only profit can make up for the loss and finally leads to profits.

Apply the words of the investment master: limit the loss to a small amount and let the profit run. It is this requirement that determines the third question that needs to be answered in the market research: the market research must be able to measure the ratio of profit and loss, otherwise it will be proved to be flawed.

It should be emphasized that since we do not know how many times we will lose money in a row, we must actively hold the positions once we start to make a profit. This has two implications:

(1). We can't know if the profit has already been maximized. Only when profit starts to retrace, can we know which position the biggest profit point is, even if you are an investor who is good at measuring the amount.

Because some market changes will cross the time level, for example, the daily-level market has evolved into a weekly-level market, so there is profit. As long as our position standards are still there, we may wish to hold positions more firmly, and we must not "chase profit" without any principle.

2. Many market trends will be repeated at the beginning. We may fail to attack once, twice or even several times. In order to maintain the ability to "attack", profits must be able to make up for multiple attacks. If you can't do this, it means that the market research may have something wrong.

In short, "gain after you know how to stop", "do what your strength allows." No matter how to stress the fund management, it is not enough. It’s the most personal aspect of all trading process, reflecting all aspects of the investor's personality. There is no good or bad, and suitable is good.

With the above quantification, it is easy for investors to clarify the “lossy resources” that can be used in each transaction or in each period. Many people compare all investment margins to "bullets". I think it should be more appropriate to compare their losses to "bullets". Bullets can't be back when they are shot, but in order to get "prey" we must fire "bullets". If the loss amount is running out, you should stop trading.

The combination of the market research module and the fund management module can measure a reasonable and clear loss limit, which helps to improve execution.


Trading strategy module

This is the most flexible part and it most needs effort. In this session, many investors have overlooked a problem: the rhythm of the market trend. Formulating an appropriate trading strategy is to accurately follow the rhythm of the market trend. The trading strategy needs to finish off the following three issues:

(1)

Time to enter

After determining the time level of your trade, what do you think of your entry signal? For example, wether enter or not when a daily-level trader who want a breakthrough face the opening gap during the entire trading day; wether to leave or not when it retreats within the key point?

In order to avoid these problems, the daily-level trader should probably enter according to the signal when it’s about to close, filtering out the day's signal. This may miss some profit margins, but you can avoid unnecessary stop-loss actions caused by intraday fluctuations and avoid disadvantages.

As a futures investor, you should put avoiding disadvantages first. It is just an example. It is not to say that this is the only or best way. Investors should have a clear standard for the timing of their trading.

2. How to deal with market emergencies

This is a very important issue. For emergencies, there must be a positive response, regardless of whether the emergency is beneficial or not. Many investors believe that although unexpected events can cause abnormal fluctuations in the market, accelerate a wave of trend, or slow down a wave of trend, but most of events cannot change the trend of the market.

Since it is a "burst", there is no prediction, and you might as well not to consider it. Obviously this view is a bit negative. The government has been actively calling on all walks of life to establish an "early warning mechanism", and futures investors should also establish an "early warning mechanism" to ensure the smooth implementation of trading strategies to the greatest extent. Otherwise, the rhythm will be disrupted by unexpected events, and blindly entering or passively leaving will occur.

3. Adding and subtracting positions, smoothing the mind

I have never believed that some investors can be calm as still water when they face the ups and downs of the market, the profits and losses of the funds. It’s known that the two weaknesses of human nature - greed and fear - have been magnified many times in futures trading, causing a lot of trouble for traders, and all investors are trying to overcome these weaknesses.

I believe that overcoming weaknesses should start with respect for weaknesses. Weaknesses are born, and they all play a role at all times, and we cannot get rid of them. But we can formulate a clear trading strategy, through the addition and subtraction of positions, to smooth or offset the test from profit and loss fluctuations on human weakness.

The general principle of adding and subtracting positions: when you lose, don’t add position; when you gain profits, you only add according to the pre-set measured ratio. It should be noted that this is a general principle, not the only standard.

The maximum risk of the account will be controlled at 25%. Usually 1/3 of the investment amount will be closed when the signal is unclear, and this profit will be used to guarantee another 1/3 of the investment, so that only 1/3 of the investment amount is risky, while at the same time there is 2/3 of potential to gain profit. So that investors are in an invincible position, while not affecting the mood due to the big fish slip away, maintaining a calm state of mind.

The trading system is a whole, each module is an organic combination, not a simple superposition. A good trading system does not highlight a certain module but is considered and synchronized in whole. Every detail of a good trading system is holographic, reflecting all the information, goals, principles, skills and so on.

The hardest thing for people to do is to understand themselves and evaluate themselves correctly. The trading method can be learned, but while learning it is necessary to combine the analysis and understanding of yourself. The method that suits you is likely to be the best method.

article originally from FMZ.COM
46  Economy / Trading Discussion / Re: Do you have faith in your trading? on: January 26, 2019, 02:36:48 AM
article originally form FMZ.COM

Before making my response and my point of view to the article you have posted, I have just one question.

Do you understand what you have pasted?

While posting articles from a source link, make sure you also give your insights about it and not just will copied it here.
He directly paste up the sites name without qouting the direct source of such thing being posted.Where you can actually find it here https://blog.mathquant.com/ rather than posting https://www.fmz.com/ alone.

Back to topic about faith in trading.I agree that experience and skills wont really came out if you dont try or do afraid to execute your own trading style. Trial and error is needed but there are really some traders which

do really hesitates to proceed because of anxiety or being worried that it might not be effective.If you have this kind of mindset nor no faith on the things you had formulated then you wont really able to grow up.

thanks for the reminder, both  https://blog.mathquant.com/ and FMZ.COM are our company's website, so does this forum account.
47  Economy / Trading Discussion / Re: Jump in with trend and get out with the trend! on: January 26, 2019, 02:33:54 AM
everything just luck , you just haven't realize it yet. our decision just under a higher dimension of  “Random walk”。 manage your risk, you can't manage your profit.
48  Economy / Trading Discussion / Do you have faith in your trading? on: January 25, 2019, 06:58:49 AM
article originally form FMZ.COM

There is a famous saying on Wall Street: mediocre traders trade with skills, while top traders trade with faith. This fully shows that the difference between a mediocre trader and a trading master is not about skill but faith.

Many people have a profitable trading system that cannot be executed, probably because they suspect the system and have no firm faith in their trading system. Therefore, there is a well-known motto in the futures world: we must not only have a trading system, but also a system of faith.

People often attribute successful traders to their intelligence and hard work. However, this is far from enough. For investors, the key factor controlling the success or failure of a transaction is faith. The size of self-confidence determines the size of a person's achievement.

It is said that as long as Napoleon is on the court, the combat effectiveness of the soldiers can be doubled. Most of the combat effectiveness of an army depends on the confidence of the general. The confidence of the general before the war can greatly enhance the courage and combat effectiveness of the army. If he reveals doubts and falter, the whole army must fall into chaos and panic.


Human spirit and ability, like the military, depends on the support of their will and belief. People with strong faith can achieve magical careers even with the simplest trading systems. Doubtful and timid people achieve nothing. The size of a person's achievement usually does not exceed the size of his self-confidence. The prerequisite for success is self-confidence.

So, how do we form a firm faith in our trading system in the transaction? The answer is simple: familiarize yourself with the system, understand and integrate the system. The technical stuff must be integrated with his convinced trading philosophy to have its inner roots in thought, and such skill can be ingrained.

Technology is actually an idea. Only when you fully understand and believe in the system will you use it without any obstacles. The skills that can be described as hearsay will inevitably lack internal strength, just like the duckweed in the water. Once the wind and rain hit, it will fall and swing.

The process by which traders tend to trade perfectly is a process of moving closer to themselves. It is a process in which an external system and an inner self are constantly integrated, moving toward unity.

At the beginning of the transaction, we are operating other people's systems and other people's strategies. Therefore, once we encounter difficulties, we will have doubts about the system and cause the investment to fail. After that, we began self-examination on ourselves from failure, and gradually found our own trading methods and trading philosophy in the transaction.


Gradually turn "others’ methods" into our own. Only at this time, you have completely integrated the system with yourself, and began to establish your own trading faith and trading internal power. Only when you operate completely with trading system that is gained by your own practice and sensibility, can you be confident and achieve inevitable success constantly.

Constant repetitive operations and constant understanding can quickly turn other people's trading systems into your own trading systems. When you start trading, because of the differences between you and others, there are often some stagnation and dullness in operating other people's systems. As the number of transactions increases, you will gradually understand the principles and trading philosophy of the trading system, and gradually integrate into your own thinking, forming new ideas and faith on your own mind. A perfect transaction is definitely your trade with system that you understand and agree with.

In the whole transaction, if you start the operation without understanding the actual meaning of each step of a trading system and how the whole system is profitable, if you understand the whole system only from the current transactions’ profits and losses, not based on the system's profitability principle and market philosophy, such transaction will inevitably lead to losses and failures.

This is why I disapprove of blindly operating a system that is hearsay. As stated in The Ghost of Wall Street: There are still people who want to lead a successful path of stable profits by learning the trading methods and trading strategies introduced in a book. This is a big joke, "Turtle Trading system” has been published for nearly 20 years, but how many people in the actual transaction can be profitable with this excellent system? Skills can be learned from books, but the internal power related to skill needs to be taught.

All wealth comes from a clear and correct understanding of a thing. Correctly strengthening and cultivating your own trading in the investment market is the only way to successful trading. The rule of success is to have deep trading internal power and strict trading discipline.

Only if you firmly believe in the system, can you succeed. This is an irrefutable truth. In final, I need to tell you something to end this article: if you can't strictly follow the discipline, you may make 10,000 kinds of mistakes; but if you can strictly abide by discipline, you won’t make any mistake.

article originally form FMZ.COM
49  Economy / Trading Discussion / Jump in with trend and get out with the trend! on: January 25, 2019, 02:46:09 AM
article originally from FMZ.COM

Jump in with trend and get out with the trend!

The market will be smarter than us at any time. The timing of a tremendous wave of trend, the form of development, the scale, the intensity, and the duration of the time are almost always out of our expectations. It seems that we will never follow our mood. The key to participating in this game is to maintain your initiative, leadership, and control.

The only thing we can control in the trading is the stop loss. We need to know clearly how much risk we will take and how much loss we will bear. When we know this bottom line, we will have the largest trading space. The amount of profit that can be earned in a transaction is never controlled by us because the market is uncertain and unpredictable. If we peg profit or market, we will fall into an environment that cannot be grasped and controlled, and let ourselves be filled with contradictions and chaos. So the only thing we can do is to focus on stop loss without considering profit, which is the best way to pursue profit.


"The only thing that can be done is to focus on stop loss without considering profit. This is the best way to pursue profit."

The real profits from speculative trading come from those positions that have been profitable from scratch.

Focus on the stocks that are most prominent on the day. If you can't win profits from the leading active stocks, you can't make a profit in the entire stock market.

Whenever I wait patiently for the market to reach the "key point" before I start, I can always profit from the transaction. why? Because in this case, what I chose is the psychological moment that marks the start of the market. I never need to worry about losing money. The reason is very simple. I happen to be decisive when the guidelines signal.

Move and gradually accumulate positions according to the signals issued by the guidelines. After that, the only thing I have to do is to wait and see, and let the market automatically expand itself.

I only believe in the trend of the market I saw in front of me, and I will never guess where is the top and where is the bottom. As for whether it is to follow the major trend or to open a position with sub-level trend, it is up to your trading system to decide, and the supporting stop-loss system is guaranteed.

In the futures market, profit and loss is a common occurrence of investment. If you have a loss in your futures position, what should you do? You will be like most other people, bet that the price will one day "come back (ie, floating losses becoming profits or loss reduction)." Now suppose that the futures position you hold has already made a profit. This time you will not bet again. Your approach is simple: immediately take profit and settle down. This phenomenon of "stopping profit is always simple, stop loss is always too difficult" violates the principle of "limited loss, unlimited profit". After long-term trading operations, the fund accounts of many investors are shrinking. What is even more frightening is that due to one or two big losses, the account be busted.


The Doyle Brunson said: most people who enter the casino have experienced the experience of winning money. The reason why most people lose money is because they don't know when to exit. This is also true for investors. "Exit" is "take profit and stop loss". We often hear people say that a stockholder who does not know how to stop loss is not a mature stockholder. The reason is that in a market with unilateral multi-mechanism, “stop loss” is the only “tool” that we can effectively control risk. If there are "weapons" that you don’t use, you can’t blame your failures on others.

The friend who told the story to the author once witnessed a companion in the "Randomly draw one card to compare the big or small" gamble, and repeatedly bet the fourteen "small" in a "double down" approach. On the spot, all the credit cards on this person were “exploded” and lost more than 100,000 Hong Kong dollars. From this we can see that if we don't have the consciousness of “can't afford to lose”, we will always “reserve the position” with limited funds and try to reduce the cost. The result is often that when the “bottom” really comes, we have no chance. Therefore, the author's suggestion is: When we start thinking about "can make up the position later", please select "stop loss".

Compared with the “stop loss”, learning to “take profit” is a more important step towards maturity. Because "Take Profit" requires us to overcome a greater psychological barrier, that is, to overcome the "greed", which is deeply rooted in human nature. People in the stock market are all want profits. It is impossible to not "greedy". However, everything has a "scale" and "insatiable greed" is the performance of "infiniteness", and ultimately it must be self-sufficient. We should remember: What is the word "greed"? It is the natural dialectics.

Speculative trading, giving up the subjective view of the self, following the footsteps of the market, and combining with the trend. Pull the hand of the price and follow the trend. It's that simple.

Friends When you trust the trend, you just find God, because the trend is God, there is no other God. When you trust it, drift with it, we are in harmony with the trend, in harmony, with the same pace. This game is eternal - with the trend, with the trend - this is an eternal game.

article originally from FMZ.COM
50  Economy / Trading Discussion / Re: What do you think about option trading? on: January 24, 2019, 08:04:16 AM
where did you guys trading crypto for option trading?
51  Economy / Trading Discussion / Single thinking model is the source of many investment disasters on: January 24, 2019, 06:03:14 AM
How to make a good decision? How to become a good investor? Forming our own thoughts and choices in our thinking model is a good start. Building these modes of thinking is the key to making the right decisions.

There can't be only one "hammer" in the hand.

The mental model is a prediction of the development of things. To make it clear, how you want things to develop is not a mental model, but how do you think things will develop is your mental model.

If a person has a complete and sound mental model, he can make accurate predictions about the development of things, so he can make better judgments than others. We describe people, sometimes with vision and foresight, to praise those whose mental models are more precise than ordinary people.

Wikipedia believes that the core of the mental model is that there must be multiple models. If you compare it to a tool, the more tools you have, the better. It may not be possible to have many “tools” in reality, but you have to allow as many “tools” as possible in your own “toolbox”.

Imagine what would happen if you had to fix something without the right tools. From my experience, if you have the right tools, you might have solved the problem easily

It’s similar to mental models. The more mental models you have, the more you tend to make more correct decisions.


This seems natural on the surface, but in reality it’s not so natural in the process of thinking. If people's brains are not properly trained, then the brain is more inclined to think about problems in patterns that they know and like.

Munger’s argument is to compare it to a man with only one hammer: “If a person has only a hammer as a weapon, then the way he solves all the problems is only through a hammer.”

When you are just used to thinking with a mental model, you tend to put everything into the mental model, regardless of the situation. This can lead to dangerous thinking or wrong decisions.

How can we avoid it? Then try to include different models in your existing mental model, and allow these models to compete and compare with each other.

In the beginning, the brain will feel uncomfortable doing this, but you need to know that this means a different mental model is working.

Do you remember when you learn to ride a bicycle for the first time? In the beginning, you may not think or believe that you can ride your own bicycle, but in the end you know how to ride the bike, and you can't imagine how it is done. Once you know how to do it, you will never forget this skill.

There are many different tools in your brain kit, and don't be a person with only one "hammer".

Charlie Munger said: "You must learn the essence of these major subjects, and regularly use all that you have learned, not just a little. However, most people just learn a single subject and content, for example, many investors just learn economics, and only solve it in one way when they encounter all the problems."

Munger thinks that thinking clearly is a response to a person's educational level. He believes that people's brains are just like muscles and need exercise.

Munger specifically mentioned these major subjects that can help expand thinking about mental models, and said that you don't need to know everything in these subjects, but you need to know the main content. These subjects are: Physics, Psychology, Biology, Mathematics, Philosophy, History, Sociology, and many others.

Develop a list of investments

For investors, it is necessary to have a list to check.

The list can help investors make better decisions in their investments, but there is no law. Investors need to learn from mistakes and constantly add new factors to their lists.

This list can help us and help investors stay rational in the face of uncertainty and chaos.

The well-known successful investor Seth Klarman (the world's fourth-ranked hedge fund Baupost founder) and Monis Pablo (Mohnish Pabrai, Buffett’s disciple, a new generation of value investors) are active users of checklist method. They all say that the use of the checklist method in the investment is the basic step in the decision-making process.

Munger himself never said how he used the list, but he reminded us of the importance of the list through lectures, writing and conversations on various occasions. He wants each of us to think for ourselves and list one by yourself that suits you.


Reverse Thinking

Munger said: "To learn to turn things around and think about it, reverse thinking will help you find many problems. Many problems are discovered and solved in the process of reverse thinking."

In investing, do you want to make a profit by pursuing good grades, or do you want to make yourself more successful by constantly practicing your risk aversion? To live a happy life is to try to avoid the situation that might puts you in a bad situation.

Most people think that big risks mean big returns, but Buffett earns wealth by avoiding risks.

Munger once said that he and Buffett's success was not because they were smart, but because they tried to "avoid stupidity."

Here is an example related to the stock market. If you find a stock and want to buy it, and it’s supported after inferring all the analysis. You also need to do reverse thinking to find out why you can't buy this stock.

By doing this, you can ensure that your research is comprehensive and that every aspect of the investment is thoroughly considered.

Good at learning from mistakes

This may not require much explanation. Be sure to learn from others’ mistakes and your own mistakes. The only way to make investors smarter is to keep learning from mistakes. This is not only an attitude issue, but also to raise the height of your view of the problem,

After Edison invented the light bulb, someone told him that he had found the most suitable material for the invention of the light bulb after 3,000 failures. Edison’s answer was that he did not fail 3,000 times. He just learned 3,000 ways that cannot make the light bulb. This is an amazing height of view to look at the problem.

Buffett also said many times that he also learned a lot from failures. Buffett used to invest millions of dollars in the Dexter shoe factory. The factory closed a few years later. During Buffett’s subsequent investigation of the company, he found his previous mistakes and decided to summarize the “investment moat” theory. Buffett, the billionaire, also learned from mistakes and failures.

Recently, the billionaire, Pershing Square hedge fund founder, Bill Ackman suffered setbacks in his investment. He was the largest investor in Valeant Pharmaceuticals Inc., and his investment in the company caused Ackman to lose $1.09 billion.

He appeared on TV frequently in recent to explain his failure process of investment and the impact on the Pershing Fund. What we need to see is his humility toward mistakes. Ackman is smarter and richer than many other investors in the world. Even so, he publicly acknowledges his mistakes on TV shows. Every investor must have such an attitude.

There are still some investors in our lives who have not done a lot of tangible research, and simply follow the propaganda of newspapers and other media to invest. Such investment has the potential to get a return, but this is just a matter of luck.

In the end, blindly following must put themselves into loss. If you don't do real research and study, you should always remind yourself that you may make mistakes.

Find an excellent person to follow

Charlie Munger said: “I have been looking for someone who is exceptionally good in my life to observe their investment. I am very interested in what happened to them.

What you observe and learn will increase the factors that make your investment successful. Learning and emulating these excellent people should not stay on the surface, emulate their nonlinear thinking and style. This kind of emulation and learning will have a positive effect.”

Munger particularly recommends that investors take time to watch the movie "Big Short". This movie is not only very entertaining, but also a true portrayal of the world of investment in real life.

Reading makes people rational

As investment becomes more and more rational, these rationalities do not come overnight. It is necessary to have the patience to practice the methods of thinking about problems with different mental models.

Reading is one of the tricks of learning. Reason is a way that can be learned. We all have a natural preference for certain behaviors and ideas, but investors can become more rational through learning.

Reading the works of famous investors, you can find out what "functional disorders" you have in thinking by comparison. Reading can also help you find the way to overcome these "functional disorders" and find the right direction of development.

Train falsification ability

Learn to protest against your own idea. It's easy to choose the stocks that you like in your subconscious, and filter out the opposite ideas that block your chosen stock before deciding to buy.

But remember that the stock market doesn't care how much you love the stock, and the market is the most ruthless.

Mr. Munger highly praised Charlie Darwin's falsification spirit. He commented that Darwin is the model of rational and objective thinking at the opening ceremony of the 2007 Ivy League School in the United States, especially his ability to continually correct his initial conclusions.

Munger said: "We have to learn Darwin's remarkable and profound analytical spirit. When Darwin had his original thoughts, he quickly put down the books to find evidence that could contradict his own ideas. If you can continually exercise yourself just like Darwin, you will become an amazing perfect thinker, not just staying in the study of your original thoughts."

How to apply this into investment? Munger explained: "Investing also needs to be applied in the same way. When you find a company you like or an idea that you think is great, you need to break down the idea and try to prove that you are wrong, If you can't prove your investment idea is wrong, then you have a good investment."
52  Economy / Trading Discussion / Trade psychology--get along with your mental state on: January 24, 2019, 02:27:03 AM
Some people say that a good mental attitude helps trading. Indeed, for investors, the mentality is very important. Numerous masters, masters, or traders who are still struggling to pursue the sincerity of trading are discussing the mentality – a sinister but real interference.

1

What is a good trading mentality? Is it seeing through the emptiness of the world? Is it to overcome the weakness of human nature and maintain rational thinking? Or is it calm like still water?

2

Some people say that futures are a digital game in their eyes. So, can someone completely ignore their own mentality changes? A friend of mine has been trading for many years, and he has found that no matter how hard he tries, he can't eliminate his negative mentality. He is very frustrated. Is his life destined to miss success? In fact, if the trader comes for profit, it will definitely be a concern. Everyone can't eliminate the human weakness. Not to mention being calm like still water, ignoring all fluctuations in interest - this is the legendary realm.

So how do you face your different states of mind?


3

A friend who has been profiting for many years tells me that during the transaction, he will also be troubled by different mentalities, such as excitement, pessimism, disappointment, nervousness, excitement, etc., but he knows that this will happen, and he has already adapted. I saw his capital curve, which is a very beautiful curve, but I can't see the kind of mental journey he has experienced before.

This must contain many stories, doubts about retracement, frustration of losing money, and fear of the unknown. What is certain is that he knows the various mentalities in the transaction process and accepts the baptism of human nature and finally goes to the end of the victory. As for the sweets and bitters of this, only he knows.

4

Therefore, a successful trader is not immune to mentality disturbance, but he can better control the impact of mentality on emotions, and operates objectively and calmly.

As long as you are trading, the mentality will always be with you. You need to understand your trading system and understand what kind of mental state it will bring to you. For example, if you are a programmatic transaction, when your capital curve is greatly increased, you need to know, There is a good chance that there will be a retracement, and this kind of retracement will be accompanied by loss, struggle, remorse and even pain, because you will lose a lot of profits in order to follow the trading system. And what you can do is just watch it happen. This requires great perseverance and confidence. You need to be prepared to accept it, and when it is determined that it will happen, you will not be controlled by your humanity to find a way to save.


5

The subjective transaction is the same. After a detailed analysis, you come up with a trading strategy, but when the market starts to be bad for you, you need to understand what mentality you are about to face – doubts, anxiety, and fear of continuing positions. You have to accept this reaction and separate it from your decision. In the presence of this mentality, you should look at the market objectively according to the method of entry and exit that you have set before trading. Over time, your adaptability will help you get used to these negative mentalities, identify with their existence, and your future will naturally become objective and smooth.

Therefore, if you don't believe in your trading system and have a deep understanding of the psychological state that you will appear during the operation of the system, you will not be able to achieve a sense of unity and achieve stable profitability. If you want to be a successful trader, you need to understand what kind of mentality changes you will experience during the transaction, and accept it calmly, adapt to it, get used to it. One day, the impact of your mentality fluctuations will be minimal, and you will calmly face the ups and downs. In the end, the deal may have really become a digital game.

Through trading, analyzing the shortcomings of human nature and self-cultivation, isn't this the charm of trading?
53  Economy / Trading Discussion / Human nature behind technical and fundamental analysis on: January 23, 2019, 05:51:39 AM
article originally from FMZ.COM

01

The futures market is fascinating but confusing, and people who are deeply involved in it always want to explore its essence to obtain an eternal profit secret. Different people, in different environments, with different experiences and restrictions, observing and exploring the futures market from different angles, the resulting sentiments or so-called "conclusions" are often very different, as well as the resulting trading patterns that they think are profitable. The wealth of the futures market, which seems to be easily accessible, makes us eager to do so, even if we can't help it, it can't hinder our desire to chase it.


The vulgar like me is one of them. I want to explore the nature of futures from my own perspective so that I can find a profit model in this market that can convince myself.

I think from the perspective of a profit-oriented trader, the nature of futures can be interpreted in two ways:

1. Futures are derivatives of the spot;

2. Futures are a game of human nature.

(If you stand in the market's observer perspective, designer's perspective, operator's perspective or other angles, the nature of futures can have other meanings)

02

First of all, futures are not born without reason. Every futures variety and futures contract are specific spots. Futures are born for the spot. Although the relationship between futures and spot is sometimes tight and sometimes loose, and occasionally runs in opposite directions. In any case, futures are the derivative of the spot. Futures and spot are inextricably linked. This relationship is inseparable, necessary existence and there is a way to follow. From this perspective, if the research reveals the spot of a certain variety, it will be relatively smooth to make money in the futures market.

Secondly, every volatility, every price, and every transaction of futures is produced by “man-made”. It is made up of a wide and democratic vote by different funds with different opinions. Behind every of these “man-made” products, there is the impact and compromise of power, opinion, emotion, and mind from people. It is the process and result of humanity game between different participants in the futures market. From this perspective, if we deeply analyze the characteristics of human nature and understand the common law of human nature, we can make money relatively smoothly in the futures market.

Because I understand the nature of futures is the derivation of the spot, the game of human nature. Therefore, from my perspective, the fluctuations in futures prices, the formation of trends, the sawing and transformation of the market, etc., which I have seen, can be understood as the process and result of the change of the relationship between the supply and demand of the spot and the game of the participants. Although the price of futures is affected by these two all the time, I can also simply define the main determining power of futures long-term price fluctuation as the supply and demand relationship of the spot; and determining power of futures short-term price fluctuation is defined as the game of participants' humanity. As a result, perhaps my futures trading becomes relatively simple and operational.

Regardless of whether the following two sentences are correct or not, whether they can withstand the rigorous test, but at the current stage with many limits, I can firmly believe that the law of supply and demand determining the long-term price trend is unchanged, and the law of human nature determining the short-term price movements has remained unchanged. With such a belief, it is equivalent to having a core world view and values ​​that look at the futures market. From then on, a corresponding methodology can be derived, that is, looking for the profit model of futures trading under the guidance of this core viewpoint.

03

The market for a futures product being in a bull market or a bear market is determined by its spot supply and demand relationship. The bull market is in short supply. The bear market is in oversupply. If the spot of the futures product is a commodity, the understanding of supply and demand is easy, and if the spot of the futures product is a stock index or a stock, the relationship between supply and demand is actually the supply and demand of stock chips and money. If there is more supply of chips and less money to buy chips, it’s oversupplied and the stock will fall. Otherwise it will go up.

The bull market and the bear market, that is, the running direction of the market, is determined by the relationship between supply and demand. The waves in the bull market and the bear market, that is, the walking path of the market is determined by human characteristics.


For example, it’s said that " the fighting spirit is aroused by the first roll of drums, depleted by the second and exhausted by the third. " is a characteristic of human nature, so there will always be a "stop" for each trend.

If we are careful enough to observe, understand, analyze, and identify, we will find that when the mainstream people involved in the market are impulsive, panic, chasing, stucking, closing... the market will show corresponding price fluctuations. Any thoughts and emotions of any participant in the market will be reflected in the fluctuations of the market, but when the mainstream people do not form the same or similar views or states, the market is usually in disorder, random, and oscillating. And in a certain time, when the mainstream people's views or status tend to be the same, the market usually has an identifiable trend.

For all investors, understanding the macro fundamentals of supply and demand, such as monetary easing, industrial policies, etc., can be achieved by everyone; but to understand the details of the supply and demand, such as the cultivation area, growth, and alternatives of agricultural products, mood of growers, etc., it’s difficult to achieve by ordinary individual investors but relatively easier for institutional investors and professional investors. Therefore, in the macro fundamental research, the individual investors are not worse than institutional investors and professional investors, but in the short-term trend of fundamental research, individual investors are clearly at a disadvantage. The fundamental analysis of the relationship between supply and demand is definite useful. As for the application of rug analysis or detailed analysis, it depends on person. We should play our strengths instead of relying on our shortcomings.


04

When the trader observes the market, if he believes that certain types of market fluctuations are not obvious, then these quotes are unavailable to him. For him, he should actively "miss" these quotes; if other types of market volatility are obvious and identifiable, then he can seize these quotes. All he needs to do is wait for these types of quotes to appear, identify them, and capture them. Of course, because of the limited ability of personal analysis, summarization and recognition, and the variability of the mainstream population involved in the market, even if the trader sees a sign of a market that he believes has obvious characteristics, it may be an “illusion”. And if you encounter the "illusion", a coping strategy is good, that is, stop loss in time. This is the technical analysis and its application.

Technical analysis pays attention to "re-enactment". In fact, the market is not repeating graphics, but human nature. The market sentiment consisting of the emotions of a living person must be regular, because human nature is immutable and regular. It's just that market sentiment is made up of thousands of participants with different emotions, which are more complicated and difficult to identify than individual emotion. But no matter what, when the sentiment of the mainstream groups participating in the market tends to be same, it is easy to identify. I think this might be the essence of technical analysis.

article originally from FMZ.COM
54  Economy / Trading Discussion / Re: Any free trading bots out there? on: January 23, 2019, 05:21:07 AM
come and check www.fmz.com, build your own trading bot by using professorial programming language such as Python JavaScript and C++. also have lots of well-build strategies to rent, buy and sale.
55  Economy / Trading Discussion / Re: Binance Multi-Currencies Automation Trading Strategy API Operation Guide on: January 23, 2019, 02:11:43 AM
seems a good one, i just start learning coding these strategies. thanks for sharing. is your platform support Python? i heard a lot of advise that a Quant should start with this programming language.

good for you!, in the future, i think not only the trading tools part, knowing some programming skills is like using calculator nowadays. it just a basic skill set.

you don't have to develop the whole system from ground, just for analysis part, such as python on some lower level of data analysis will be a basic tool for the future trading analysis.
56  Economy / Trading Discussion / Re: Two disciplines for trading on: January 23, 2019, 02:07:03 AM
trading can be difficult, risk is a unknown thing, but risk can be managed, i think this is the fundamental part of trading, god decided who will be rich, we just take care of ourselves being from bankruptcy.
57  Economy / Trading Discussion / Re: Two disciplines for trading on: January 22, 2019, 09:17:10 AM
In my opinion we have to discipline with trading plan and risk management,  there are many trader loss much money because they don't have any risk management before start in to trading.  And learn about trend of market,  and use always stop loss for all open trading because the price action can be turn in to dump in a few minute.

good point, i know some traders have no trading plan or terrible plan, they always stop loss, never take any profits. in the end, the countless of small stop loss kill them. a good plan i think it must allow some amplitude of price changes.
58  Economy / Trading Discussion / Two disciplines for trading on: January 22, 2019, 06:41:02 AM
Buddhist monastic disciplines produce the power of meditation, the power of meditation produces wisdom, wisdom making you become a Buddha.

What are the disciplines in futures? (For individual traders) The two disciplines are enough. The others are not a problem after the two disciplines are done.

First discipline: Don't trade in too many varieties. Find a variety that suits your trading model. This is difficult for many individual traders, so many people fail. Trade in only one variety, do not look and care about other trading products. Can you insist on doing this for 3 years?

Second discipline: Don’t operate in too many trading models. Find one suits your personality, your fund size, and your mental capacity. In other words, the trading model needs to be concentrated on one kind. This is also difficult for many people. Some of them use model A this month, use model B next month and use model C in the third month. As a result, no one model is used well. Simple model should be repeated! Only when your own methods are consistent in long-term, you can understand the advantages and disadvantages of your trading model. One trick is enough to go all over the world.

When you constantly do these two disciplines for three years, somehow you gain the power to meditate. And then you gain endless wisdom, finally you will become a buddha with enough wisdom. Therefore, you wouldn’t struggling for profits in futures market.

When you gain success in markets after insisting single model in single variety for decades, someone may ask you how to earn so many RMB, you can smile and say "nothing magical, just practiced in this".
59  Economy / Trading Discussion / Binance Multi-Currencies Automation Trading Strategy API Operation Guide on: January 22, 2019, 02:45:31 AM
article originally from FMZ.COM      if the code part is not clear to see,  please come to here: https://www.fmz.com/bbs-topic/2720

Although the Binance.com has not been established for a long time, due to its excellent technology, the API is stable and efficient, the request frequency limit is also relaxed, and there are many coins and active transactions, which is already the preferred platform for spot trading. At present, there are more than 150 kinds of currencies that are priced by BTC, and they are still increasing, which makes it difficult to obtain many currency prices and K-line. This article will mainly introduce how to operate multi-currency strategies on the FMZ quantitative trading platform, and even for operating all currencies without problems, mainly for users with a certain knowledge foundation.

1. Get the market quote
If you want to operate 150 currencies at the same time, it is obviously inappropriate to use REST protocol to get the market quote. It will waste a lot of time after polling, and websocket can't subscribe to so many currencies at the same time. Binance.com realizes the problem of multi-variety strategy to obtain the market quote, and provides an aggregated market quote interface.

When directly use this REST interface (/api/v1/ticker/24hr),must note that its weight is 40, meaning that one access is equivalent to ordinary of 40 times of access, even if you access this interface once in 5 or 6 seconds, it is also possible to exceed the limit.

Therefore, we need to access the websocket version of this interface, but be aware that due to the huge amount of data, the data is only fixed for 1s to push the data with market changes. For some unpopular currencies that have not been traded for a few minutes, it may not be pushed for a long time. Fixed push times are not suitable for high frequency strategies, but are sufficient for general multi-currency strategies. The specific code is as follows:

Code:
function main() {
    var client = Dial("wss://stream.binance.com:9443/ws/!ticker@arr");
    while (true){
        var data = client.read();
        var msg = JSON.parse(data);
        updateTicker(msg);//The updateTicker function handles market quotes and transactions, which will be introduced below.
    }
}

2. Preparation before the trading
Binance has many restrictions on trading, minimum transaction value, minimum transaction volume, price accuracy, and transaction volume accuracy. These need to be prepared in advance.

Defined global variables:

Code:
var totalbtc = 0;//Total value, not necessarily btc
var baseCoin = ['BTC', 'ETH', 'BNB', 'USDT'][baseCoin_select];//Base currency selection baseCoin_select is a parameter of the drop-down box
var exceptList = Except_list_string.split(',');//Excluded currency, Except_list_string is the strategy parameter
//K line cycle selects PERIOD_M1, PERIOD_M5 is FMZ default global variable
var period = [PERIOD_M1, PERIOD_M5, PERIOD_M15, PERIOD_M30, PERIOD_H1, PERIOD_H1, PERIOD_D1][period_select]
var periodSecond = [60, 300, 900, 1800, 3600, 3600*24][period_select]//The number of seconds corresponding to each cycle
var lastPeriodTime = 0;//The most recent cycle time, used to update the K line
var updateProfitTime = 0//Recently updated earnings time to update revenue
var buyList = []//buying order list
var sellList = []//selling order list
var accountInfo = {};//Used to store transaction related data lists
The next step is to improve the content of accountInfo, and all the content related to the trading pair is stored in it.

if (!_G('accountInfo')){//If accountInfo is not stored in the database, reacquire the data.
    var exchangeInfo = JSON.parse(HttpQuery('https://api.binance.com/api/v1/exchangeInfo'));//Get transaction related data
    var ticker = JSON.parse(HttpQuery('https://api.binance.com/api/v1/ticker/24hr'));//First use the rest protocol to get a full amount of ticker
    var tradeSymbol = exchangeInfo.symbols.filter(function(x){return x.quoteAsset == baseCoin});//Filter the required trading pairs
    accountInfo[baseCoin] = {free:0, frozen:0, last:1, value:0};//Base currency information
    for (var i=0; i<tradeSymbol.length; i++){
        var info = tradeSymbol[i];
        if(exceptList.indexOf(info.symbol.slice(0,info.symbol.length-baseCoin.length)) >= 0){
            continue;//Filter out the currencies that was kicked out
        }
        for (var j=0; j<ticker.length; j++){
            var symbol = info.symbol.slice(0,info.symbol.length-baseCoin.length)//Currency name
            if(ticker[j].symbol.slice(ticker[j].symbol.length-baseCoin.length) == baseCoin && ticker[j].symbol == info.symbol){
                //The stored contents of the exchangeInfo and ticker
                accountInfo[symbol] = {
                    last:parseFloat(ticker[j].lastPrice), free:0, frozen:0,
                    minQty:parseFloat(info.filters[2].minQty), minNotional:parseFloat(info.filters[3].minNotional)
                    tickerSize:parseFloat(info.filters[0].tickSize), stepSize:parseFloat(info.filters[2].stepSize),
                    ask:parseFloat(ticker[j].askPrice), bid:parseFloat(ticker[j].bidPrice), volume:parseFloat(ticker[j].quoteVolume),
                    lowPrice:parseFloat(ticker[j].lowPrice), highPrice:parseFloat(ticker[j].highPrice),
                    priceChangePercent:parseFloat(ticker[j].priceChangePercent),
                    sellPrice:0, buyPrice:0, state:0, value:0, records:null
                }
                break;
            }
        }
    }
}else{
    accountInfo = _G('accountInfo');
}
//Automatically save accountInfo to the database when exiting
function onexit(){
    _G('accountInfo', accountInfo);
}

3. Update account and K line information
Update the account information function without real-time updates.

Code:
function updateAccount(){
    account = exchange.GetAccount();
    if (!account){
        Log('time out');
        return;//Returning directly here is to save time, and the account information acquisition is not affected in time.
    }
    for (var i=0; i<account.Info.balances.length; i++){
        var symbol = account.Info.balances[i].asset
        //Are stored in accountInfo
        if (symbol in accountInfo){
            accountInfo[symbol].free = parseFloat(account.Info.balances[i].free);
            accountInfo[symbol].frozen = parseFloat(account.Info.balances[i].locked);
            accountInfo[symbol].value = (accountInfo[symbol].free + accountInfo[symbol].frozen)*accountInfo[symbol].last
        }
    }
}
//Update the current account total value in the selected base currency
function updateTotalBTC(){
    var btc = 0;
    for (var symbol in accountInfo){
        btc += accountInfo[symbol].value
    totalbtc = btc;
    }
}

Update the K line, the initial update can use the GetRecords function in stages, and the later update uses push data synthesis.

function initRecords(){   
    for (var symbol in accountInfo){
        if(symbol == baseCoin){continue}
        if(!accountInfo[symbol].records){
            var currency = symbol + '_' + baseCoin;
            //Switch trading pair
            exchange.IO("currency", currency)
            accountInfo[symbol].records = exchange.GetRecords(period)
            Log('Update', currency, 'K line', accountInfo[symbol].records[accountInfo[symbol].records.length-1])
            Sleep(250)//Update four per second, no limit will be reached
        }
        //Recent K-line time
        lastPeriodTime = Math.max(accountInfo[symbol].records[accountInfo[symbol].records.length-1].Time/1000, lastPeriodTime)
    }
}
//Update K line based on push ticker data
function updateRecords(msgTime){
    //If the current time is greater than the last updated cycle, it indicates that a new K line needs to be generated.
    if(parseFloat(msgTime)/1000 - lastPeriodTime > periodSecond){
        for (var symbol in accountInfo){
            if(symbol != baseCoin){
                //If the K line missing of a trading pair is too much, it will be re-acquired once, it may be that the transaction is not active, ticker did not push
                if(parseFloat(msgTime)/1000 - accountInfo[symbol].records[accountInfo[symbol].records.length-1].Time/1000 > 1.5*periodSecond){
                    var currency = symbol + '_' + baseCoin;
                    exchange.IO("currency", currency)
                    var records = exchange.GetRecords(period)
                    if(records){
                        accountInfo[symbol].records = exchange.GetRecords(period)
                    }
                    Log(symbol, 'K line is missing, regain')
                }else{
                    //Push a new K line
                    accountInfo[symbol].records.push({"Time":parseInt(lastPeriodTime + periodSecond)*1000, "Open":accountInfo[symbol].last, "High":accountInfo[symbol].last,
                    "Low":accountInfo[symbol].last, "Close":accountInfo[symbol].last, "Volume":0})
                }
            }
        }
        lastPeriodTime = lastPeriodTime + periodSecond
        Log(parseFloat(msgTime)/1000, 'Adding K line')
    }else{
        //If it is in the current K line cycle, update the current K line
        for (var symbol in accountInfo){
            if(symbol != baseCoin){
                var length = accountInfo[symbol].records.length
                accountInfo[symbol].records[length-1].Close = accountInfo[symbol].last
                accountInfo[symbol].records[length-1].Volume += accountInfo[symbol].volume
                if(accountInfo[symbol].last > accountInfo[symbol].records[length-1].High){
                    accountInfo[symbol].records[length-1].High = accountInfo[symbol].last
                }
                else if(accountInfo[symbol].last < accountInfo[symbol].records[length-1].Low){
                    accountInfo[symbol].records[length-1].Low = accountInfo[symbol].last
                }
            }
        }
    }
}

4.Trading related function

Code:
//Cancel current trading pair orders
function CancelPendingOrders() {
    var orders = _C(exchange.GetOrders);
    for (var j = 0; j < orders.length; j++) {
        exchange.CancelOrder(orders[j].Id, orders[j]);
    }
}
//Cancel all trading pair orders
function cancellAll(){
    try{
        var openOrders = exchange.IO('api', 'GET', '/api/v3/openOrders');
        for (var i=0; i<openOrders.length; i++){
            var order = openOrders[i];
            var currency = order.symbol.slice(0,order.symbol.length-baseCoin.length) + '_' + baseCoin;
            exchange.IO("currency", currency);
            exchange.CancelOrder(order.orderId);
        }
    }
    catch(err){
        Log('Cancel order failed');
    }
    for (var symbol in accountInfo){
        accountInfo[symbol].state = 0;
        accountInfo[symbol].buyprice = 0;
        accountInfo[symbol].sellPrice = 0;
    }
}
//Placing the buying long order
function toBuy(){
    //The currencies you need to buy are stored in the buyList
    if (buyList.length == 0){
        return;
    }
    for (var i=0; i<buyList.length; i++){
        var symbol =  buyList[i];
        //Slippage is the "selling price 1" plus minimum trading unit, may not be completely executed immediately, you can modify it yourself
        var buyPrice = accountInfo[symbol].ask + accountInfo[symbol].tickerSize;
        buyPrice = _N(buyPrice, parseInt((Math.log10(1.1/accountInfo[symbol].tickerSize))));//Meet price accuracy
        var currency = symbol + '_' + baseCoin;
        exchange.IO("currency", currency);//Switch trading pair
        //If you have placed an order and the price is same as this one, do not operate.
        if (accountInfo[symbol].state && accountInfo[symbol].bid == accountInfo[symbol].buyprice){
            continue;
        }else{
            //Order placed first will be cancelled first
            if (accountInfo[symbol].state == 1){
                CancelPendingOrders();
                accountInfo[symbol].state = 0;
                accountInfo[symbol].buyprice = 0;
            }
            var amount = (accountInfo[symbol].free + accountInfo[symbol].frozen)*buyPrice; //Value of existing currency
            var needBuyBTC = HoldAmount - amount;//HoldAmount is a global parameter, which require value of the hold
            var buyAmount = needBuyBTC/buyPrice;
            buyAmount = _N(scale*buyAmount, parseInt((Math.log10(1.1/accountInfo[symbol].stepSize))));//Order quantity accuracy
            //Meet minimum transaction volume and minimum transaction value requirements
            if (buyAmount > accountInfo[symbol].minQty && buyPrice*buyAmount > accountInfo[symbol].minNotional){
                if (accountInfo[baseCoin].free < buyPrice*buyAmount){return;}//Have enough base currency to buy
                var id = exchange.Buy(buyPrice, buyAmount, currency);//Final order
                if(id){
                    accountInfo[symbol].buyprice = buyPrice;
                    accountInfo[symbol].state = 1;
                }
            }
        }
        //If the buying orders are too much, it need a pause, Binance allows 10 orders every 1s maximum
        if(buyList.length > 5){
            Sleep(200)
        }
    }
}
//Placing the selling orders principles are similar to the buying orders
function toSell(){
    if (sellList.length == 0){
        return;
    }
    for (var i=0; i<sellList.length; i++){
        var currency = symbol + '_' + baseCoin;
        exchange.IO("currency", currency);
        var sellPrice = accountInfo[symbol].bid - accountInfo[symbol].tickerSize;
        sellPrice = _N(sellPrice, parseInt((Math.log10(1.1/accountInfo[symbol].tickerSize))));
        if (accountInfo[symbol].state == 1 && accountInfo[symbol].bid != accountInfo[symbol].buyprice){
            CancelPendingOrders();
            accountInfo[symbol].state = 0;
            accountInfo[symbol].sellPrice = 0;
        }
        var sellAmount = accountInfo[symbol].free;
        sellAmount = _N(Math.min(scale*sellAmount,accountInfo[symbol].free), parseInt((Math.log10(1.1/accountInfo[symbol].stepSize))));
        if (sellAmount > accountInfo[symbol].minQty && sellPrice*sellAmount > accountInfo[symbol].minNotional){
            var id = exchange.Sell(sellPrice, sellAmount, currency);
            if(id){
                accountInfo[symbol].state = 1;
                accountInfo[symbol].sellPrice = sellPrice;
            }
        }
        if(sellList.length > 5){
            Sleep(200)
        }
    }
}

5.Trading logic

The trading is very simple, just push the currency of the buying and selling to the buyList and sellList.

Code:
function checkTrade(){
    buyList = []
    sellList = []
    for(var symbol in accountInfo){
        if(symbol == baseCoin){
            continue
        }
        var length = accountInfo[symbol].records.length
        //Simple moving average, this is a simple demonstration example, don't use it at the real market.
        var fast = TA.MA(accountInfo[symbol].records, FastPeriod)[length-1]
        var slow = TA.MA(accountInfo[symbol].records, SlowPeriod)[length-1]
        if(accountInfo[symbol].value > 2*accountInfo[symbol].minNotional && fast < 0.99*slow){
            sellList.push(symbol)
        }
        //HoldAmount strategy parameter
        if(accountInfo[symbol].value < 0.9*HoldAmount && fast > 1.01*slow){
            buyList.push(symbol)
        }
    }
}

6.Update robot interface status and ticker
How to display so many trading currencies is also a problem. Fortunately, the FMZ Quantitative Platform provides a complete table functions. It can also be sorted by number, which is simple and convenient. Every time the websocket pushes the ticker, it is updated because of the event-driven, transactional and various update logic.

Code:
function updateStatus(msgTime){
    //The specific data to be displayed can be defined by itself.
    var table = {type: 'table', title: 'Position information',
             cols: ['Currency', 'Bid', 'Ask','Last', 'Lowest price','Highest price','Price Amplitude','Volume','buying price','Selling price', 'frozen','Available','Present value'],
             rows: []};
    for (var symbol in accountInfo){
        if(symbol == baseCoin){
            var infoList = [symbol,0, 0, 1,0, 0, 0,0, 0, 0, 0, _N(accountInfo[symbol].frozen,4),_N(accountInfo[symbol].free,4), _N(accountInfo[symbol].value,5)];
        }else{
            var infoList = [symbol,accountInfo[symbol].bid, accountInfo[symbol].ask, accountInfo[symbol].last,
                        accountInfo[symbol].lowPrice, accountInfo[symbol].highPrice, accountInfo[symbol].priceChangePercent,
                        _N(accountInfo[symbol].volume,2), accountInfo[symbol].buyPrice, accountInfo[symbol].sellPrice,
                        _N(accountInfo[symbol].frozen,4),_N(accountInfo[symbol].free,4), _N(accountInfo[symbol].value,5)];
        }
        table.rows.push(infoList);
    }
    var logString = _D() + ' Net value:' + _N(totalbtc,6) + (typeof(msgTime) == 'number' ? (', Latest market time: ' + _D(msgTime)) : '') + '\n';
    logString += 'The currency to be bought:' + buyList.join(',') + ' \n';
    logString += 'The currency to be sold:' + sellList.join(',') + ' \n';
    logString += 'Currently available'+ baseCoin + ':' + _N(accountInfo[baseCoin].free,6) + ',frozen:' + _N(accountInfo[baseCoin].frozen,6)  + '\n';
    LogStatus(logString + '`' + JSON.stringify(table) + '`');//Update to robot interface
}
//Every time pushes the ticker, it is updated because of the event-driven, transactional and various update logic.
function updateTicker(msg){
    var ticker = msg;
    var msgTime = 0;
    for (var i=0; i<ticker.length; i++){
        msgTime = Math.max(msgTime, ticker[i].E);
        var symbol = ticker[i].s.slice(0,ticker[i].s.length-baseCoin.length)
        if (ticker[i].s.slice(ticker[i].s.length-baseCoin.length) == baseCoin && parseFloat(ticker[i].c) && symbol in accountInfo){
            accountInfo[symbol].last = parseFloat(ticker[i].c);
            accountInfo[symbol].volume = _N(parseFloat(ticker[i].q),1);
            accountInfo[symbol].lowPrice = parseFloat(ticker[i].l);
            accountInfo[symbol].highPrice = parseFloat(ticker[i].h);
            accountInfo[symbol].ask = parseFloat(ticker[i].a);
            accountInfo[symbol].bid = parseFloat(ticker[i].b);
            accountInfo[symbol].priceChangePercent = parseFloat(ticker[i].P);
            accountInfo[symbol].value = (accountInfo[symbol].free + accountInfo[symbol].frozen)*accountInfo[symbol].last
        }
    }
    if (Date.now() - updateProfitTime > LogProfitTime*1000){
        updateAccount();
        updateProfitTime = Date.now();//Reset revenue time
        LogProfit(totalbtc);//Update revenue
    }
    updateRecords(msgTime)//Update K line
    updateTotalBTC();//Update total market value
    updateStatus(msgTime);//Update robot status
    checkTrade()//Check which orders need to be placed
    toBuy();//placing buying order
    toSell();//placing selling order
}

7.Executive summary

Code:
function main() {
    cancellAll();
    initRecords()
    updateAccount();
    updateTotalBTC()
    Log('Total transaction digital currency:', Object.keys(accountInfo).length-1);
    updateStatus();
    var client = Dial("wss://stream.binance.com:9443/ws/!ticker@arr");
    while (true){
        var data = client.read();
        var msg = JSON.parse(data);
        updateTicker(msg);
    }
}

8.Summary

This article mainly shows a basic Binance multi-currency trading framework, which mainly includes how to store trading information, how to synthesize K-line according to ticker, how to place an order, how to display strategy charts, and trigger trading based on ticker push events. There are a lot of places that can be changed and customized. The whole is extracted from my personal strategy. It may imply a bug and is only for users who have a certain knowledge foundation.

article originally from FMZ.COM      if the code part is not clear to see,  please come to here: https://www.fmz.com/bbs-topic/2720
60  Economy / Trading Discussion / Re: Detailed explanation of BitMEX pending order strategy on: January 19, 2019, 01:23:55 AM
thanks a lot, i don't think this for me, i don't know anything about programming. i saw you have post a lot of strategies here, is there anyone i can just use manual trading method, the old-fashioned but most effective way.

don't worry about that, if you really have a great idea about trading, we can help you make it happen, or you just don't want programming at all, with a little cost, we will write it for you, you can test the code anywhere, because we will provide the source code with the strategy.
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!