Monday, December 13, 2021

Sunday, December 12, 2021

libwebsockets-test

 https://ubuntu.pkgs.org/20.04/ubuntu-universe-arm64/libwebsockets-test-server-common_3.2.1-3_all.deb.html

Friday, December 3, 2021

The Complete MQTT Broker Selection Guide

 https://www.catchpoint.com/network-admin-guide/mqtt-broker

mosquitto

 https://github.com/eclipse/mosquitto

my Guru 2

 https://lms.onnocenter.or.id/wiki/index.php/MQTT:_install_di_Ubuntu_20.04

Thursday, November 25, 2021

Error: Unable to load CA certificates on Mosquitto Broker Server

1637245173: Error: Unable to load CA certificates. Check cafile "/etc/letsencrypt/live/10.0.36.50/chain.pem".

1637245173: Error: Unable to load server certificate "/etc/letsencrypt/live/10.0.36.50/cert.pem". Check certfile.

1637245173: OpenSSL Error[0]: error:02001002:system library:fopen:No such file or directory

1637245173: OpenSSL Error[1]: error:20074002:BIO routines:file_ctrl:system lib

1637245173: OpenSSL Error[2]: error:140DC002:SSL routines:use_certificate_chain_file:system lib




Mosquitto man page

 https://mosquitto.org/man/mosquitto-8.html

Friday, March 5, 2021

Peter Lynch's 25 Golden Rules for Investing

 Rule 1: Investing is fun and exciting, but dangerous if you don't do any work.

Rule 2: Your investor's edge is not something you get from Wall Street experts. It's something you already have. You can outperform the experts if you use your edge by investing in companies or industries you already understand.

Rule 3: Over the past 3 decades, the stock market has come to be dominated by a herd of professional investors. Contrary to popular belief, this makes it easier for the amateur investor. You can beat the market by ignoring the herd.

Rule 4: Behind every stock is a company. Find out what it's doing.

Rule 5: Often, there is no correlation between the success of a company's operations and the success of its stock over a few months or even a few years. In the long term, there is a 100% correlation between the success of the company and the success of its stock. This disparity is the key to making money; it pays to be patient, and to own successful companies.

Rule 6: You have to know what you own, and why you own it. "This baby is a cinch to go up" doesn't count.

Rule 7: Long shots almost always miss the mark.

Rule 8: Owning stocks is like having children — don't get involved with more than you can handle. The part-time stockpicker probably has time to follow 8-12 companies, and to buy and sell shares as conditions warrant. There don't have to be more than 5 companies in the portfolio at any one time.

Rule 9: If you can't find any companies that you think are attractive, put your money in the bank until you discover some.

Rule 10: Never invest in a company without understanding its finances. The biggest losses in stocks come from companies with poor balance sheets. Always look at the balance sheet to see if a company is solvent before you risk your money on it.

Rule 11: Avoid hot stocks in hot industries. Great companies in cold, non growth industries are consistent big winners.

Rule 12: With small companies, you are better off to wait until they turn a profit before you invest.

Rule 13: If you are thinking of investing in a troubled industry, buy the companies with staying power. Also, wait for the industry to show signs of revival. Buggy whips and radio tubes were troubled industries that never came back.

Rule 14: If you invest $1000 in a stock, all you can lose is $1000, but you stand to gain $10,000 or even $50,000 over time if you are patient. The average person can concentrate on a few good companies, while the fund manager is forced to diversify. By owning too many stocks, you lose this advantage of concentration. It only takes a handful of big winners to make a lifetime of investing worthwhile.

Rule 15: In every industry and every region of the country, the observant amateur can find great growth companies long before the professionals have discovered them.

Rule 16: A stock market decline is as routine as a January blizzard in Colorado. If you are prepared, it can't hurt you. A decline is a great opportunity to pick up the bargains left behind by investors who are fleeing the storm in panic.

Rule 17: Everyone has the brainpower to make money in stocks. Not everyone has the stomach. If you are susceptible to selling everything in a panic, you ought to avoid stocks and stock mutual funds altogether.

Rule 18: There is always something to worry about. Avoid weekend thinking and ignore the latest dire predictions of the newscasters. Sell a stock because the company's fundamentals deteriorate, not because the sky is falling.

Rule 19: Nobody can predict interest rates, the future direction of the economy, or the stock market, Dismiss all such forecasts and concentrate on what's actually happening to the companies in which you have invested.

Rule 20: If you study 10 companies, you will find 1 for which the story is better than expected. If you study 50, you'll find 5. There are always pleasant surprises to be found in the stock market — companies whose achievements are being overlooked on Wall Street.

Rule 21: If you don't study any companies, you have the same success buying stocks as you do in a poker game if you bet without looking at your cards.

Rule 22: Time is on your side when you own shares of superior companies. You can afford to be patient — even if you missed Wal-Mart in the first five years, it was a great stock to own in the next five years. Time is against you when you own options.

Rule 23: If you have the stomach for stocks, but neither the time nor the inclination to do the homework, invest in equity mutual funds. Here, it's a good idea to diversify. You should own a few different kinds of funds, with managers who pursue different styles of investing: growth, value small companies, large companies etc. Investing the six of the same kind of fund is not diversification.

Rule 24: Among the major stock markets of the world, the U.S. market ranks 8th in total return over the past decade. You can take advantage of the fastergrowing economies by investing some portion of your assets in an overseas fund with a good record.

Rule 25: In the long run, a portfolio of well-chosen stocks and/or equity mutual funds will always outperform a portfolio of bonds or a money-market account. In the long run, a portfolio of poorly chosen stocks won't outperform the money left under the mattress.

Thursday, March 4, 2021

Gann's 28 Trading Rules

 The Rules given below are based upon W. D. Gann's experience :

1. Amount of capital to use: Divide your capital into 10 equal parts and never risk more than one-tenth of your capital on any one trade.

2. Use stop loss orders. Always protect a trade when you make it with a stop loss order.

3. Never overtrade. This would be violating your capital rules.

4. Never let a profit run into a loss. After you once have a profit (...), raise your stop loss order so that you will have no loss of capital.

5. Do not buck the trend. Never buy or sell if you are not sure of the trend according to your charts and rules.

6. When in doubt, get out, and don't get in when in doubt.

7. Trade only in active markets. Keep out of slow, dead ones.

8. Equal distribution of risk. Trade in two or three different commodities, if possible. Avoid tying up all your capital in any one commodity.

9. Never limit your orders or fix a buying or selling price. Trade at the market.

10. Don't close your trades without a good reason. Follow up with a stop loss order to protect your profits.

11. Accumulate a surplus. After you have made a series of successful trades, put some money into a surplus account to be used only in emergency or in time of panic.

12. Never buy or sell just to get a scalping profit.

13. Never average a loss. This is one of the worst mistakes a trader can make.

14. Never get out of the market just because you have lost patience or get into the market because you are anxious from waiting.

15. Avoid taking small profits and big losses.

16. Never cancel a stop loss order after you have placed it at the time you make a trade.

17. Avoid getting in and out of the market too often. 

18. Be just as willing to sell short as you are to buy. Let your object be to keep with the trend and make money.

19. Never buy just because the price of a commodity is low or sell short just because the price is high.

20. Be careful about pyramiding at the wrong time. Wait until the commodity is very active and has crossed Resistance Levels before buying more and until it has broken out of the zone of distribution before selling more.

21. Select the commodities that show strong uptrend to pyramid on the buying side and the ones that show definite downtrend to sell short.

22. Never hedge. If you are long of one commodity and it starts to go down, do not sell another commodity short to hedge it. Get out of the market; take your loss and wait for another opportunity.

23. Never change your position in the market without a good reason. When you make a trade, let it be for some good reason or according to some definite rule; then do not get out without a definite indication of a change in trend.

24. Avoid increasing your trading after a long period of success or a period of profitable trades.

25. Don't guess when the market is top. Let the market prove it is top. Don't guess when the market is bottom. Let the market prove it is bottom. By folllowing definite rules, you can do this.

26. Do not follow another man's advice unless you know that he knows more than you do.

27. Reduce trading after first loss; never increase.

28. Avoid getting in wrong and out wrong; getting in right and out wrong; this is making double mistakes. When you decide to make a trade be sure that you are not violating any of these 28 rules which are vital and important to your success. When you close a trade with a loss, go over these rules and see which rule you have violated; then do not make the same mistake the second time. Experience and investigation will convince you of the value of these rules, and observation and study will lead you to a correct and practical theory for successful Trading in Commodities.

Tuesday, March 2, 2021

Money Flow Index Trading Indicator

The Money Flow Index (MFI) is a momentum indicator that measures the strength of money flowing in and out of a market. Look for divergence between the Money Flow Index and the current price. If the price moves higher and the MFI moves lower a reversal may be imminent.

Refer figure below. Look for possible market tops when the MFI is above 80. Look for possible market bottoms when the MFI is below 20. This study is very similar to the Relative Strength Index, however, the Money Flow Index includes Price and Volume in the calculation.

Properties

Bars = Number of Bars to use in the calculations.
Average = Number of N periods used in the optional moving average.

Formula

Money Flow = Price * Volume
Money Ratio = Positive Money Flow Sum / Negative Money Flow Sum
Money Flow Index = 100 – ( 100 / ( 1 + Money Ratio))


Monday, March 1, 2021

On Balance Volume indicator(OBV) for Trading

 Overview of OBV Indicator

On Balance Volume (OBV) measures buying and selling pressure as a cumulative indicator that adds volume on up days and subtracts volume on down days. OBV was developed by Joe Granville and introduced in his 1963 book, Granville's New Key to Stock Market Profits. It was one of the first indicators to measure positive and negative volume flow. We can look for divergences between OBV and price to predict price movements or use OBV to confirm price trends.

The On Balance Volume (OBV) line is simply a running total of positive and negative volume. A period's volume is positive when the close is above the prior close. A period's volume is negative when the close is below the prior close. 


OBV rises when volume on up days outpaces volume on down days. OBV falls when volume on down days is stronger. A rising OBV reflects positive volume pressure that can lead to higher prices. Conversely, falling OBV reflects negative volume pressure that can foreshadow lower prices. OBV would often move before price. Expect prices to move higher if OBV is rising while prices are either flat or moving down. Expect prices to move lower if OBV is falling while prices are either flat or moving up. On Balance Volume (OBV) is a simple indicator that uses volume and price to measure buying pressure and selling pressure. Buying pressure is evident when positive volume exceeds negative volume and the OBV line rises. Selling pressure is present when negative volume exceeds positive volume and the OBV line falls. We can use OBV to confirm the underlying trend or look for divergences that may foreshadow a price change. 

As a normal sense, if the OBV is down means money is drawing out from that market, and if OBV is up means money is pumping into that market





Thursday, February 18, 2021

The 1929 Stock Market Crash

“Those who cannot remember history are condemned to repeat it,” warned philosopher George Santayana. There is no more glaring example than the 1929 stock market crash, which in some ways was eerily similar to the boom and bust cycle that the stock market went through beginning in March 2000.

It wasn’t the Internet that fascinated the nation and helped usher in the roaring 1920s, it was electricity. At the same time, many people became enamored with the stock market. With very favorable margin rates (you could borrow 9 times the amount of your original investment), it seemed as if everyone was in the stock market.

As more and more people entered the market, the prices of stocks went up. (In a way, it was like a huge Ponzi scheme. People paid off what they owed on their original investment with the paper profits they made on their rising stocks.) The attitude of the Coolidge administration was laissezfaire, a French term meaning “letting things be.” The government wanted to let the forces of capitalism work without interference.

As the stock market got shakier and the economy got worse, the new president, Herbert Hoover, realized that something had to be done. The goal was to increase margin requirements (which many considered the main culprit) without causing panic. Unfortunately, the market panicked.

After a series of frightening stops and starts, the market finally crashed on October 24, 1929. Over $10 billion of investors’money was wiped out before noon. Huge crowds of angry and shocked investors packed the visitor’s gallery of the NYSE to watch the debacle. By noon the market was in a “death spiral.” Investors around the world were horrified at the extent of the financial damage.

By October 29, 1929, all the market’s gains from the past year had been wiped out. Eventually, the market fell 89 percent from its 1929 high of 381.

After the crash, economists tried to figure out what had gone wrong. It was obvious that many people had missed the signs the market was overpriced. For example, the P/Es of many stocks were high, well beyond what was considered the P/E safe zone of 15. In addition, the Fed decided to raise interest rates, which many economists considered to be the wrong move. Congress also had a hand in turning what really was a recession into a fullblown depression. For example, during this period it doubled income taxes and raised tariffs on imports and exports.

Another problem was that banks were allowed to operate with few restrictions on how much they could lend. After the crash, many of the banks’ customers had no way of paying back the money they had borrowed, forcing many banks to close. Finally, many people believed that fraud and insider activity was to blame.

After the initial crash, the United States entered a 3-year bear market; the Dow finally bottomed at 41 in 1932. The new president, Franklin Delano Roosevelt (FDR), took a number of unprecedented steps to bring stability and trust to the market, including creating the SEC in 1932. Wall Street was skeptical about letting the government interfere with the private sector, but the steps FDR took eventually helped turn the economy around. However, it took 25 years for the Dow to make it back to 381.

The 1987 Stock Market Crash: Electronic Trading Is Born

Before 1987, the only way you could trade stocks was by calling your stockbroker on the phone (unless you were one of the lucky few who had enough money to buy a seat on one of the stock exchanges).

The weakness of this system was revealed in October 1987, when the U.S. markets crashed, falling by more than 20 percent in one day. Because many investors and institutional investors panicked and tried to sell at the same time, the phone lines jammed or stockbrokers refused to answer their phones. 

On more than a few occasions, the floor brokers filled the orders of institutional investors but ignored orders from individual investors. (As you can imagine, many investors lost everything because they sold too late.) 

Because of this fiasco, the Nasdaq created a special computerized system called SOES (Small Order Execution System) that allowed traders to place orders electronically and at the most competitive price. The first to take advantage of SOES were day traders, who discovered that they could bypass a stockbroker and send their orders directly to the stock exchange. 

This was the beginning of the online trading revolution, but it was only for day traders. It was another 10 years before retail investors were allowed to trade online.