Wednesday, September 28, 2016

10 of the Worlds Most Powerful Trading Rules

1. A winning trading system must either be designed to have a large winning percentage of trades or big wins and small losses.

2. Your trading system must be built on quantifiable facts not opinions.

3. Start with the weekly price chart to establish the long term trend, and then work down through the daily and hourly charts to trade in the direction of that trend. The odds are better if you are trading in the direction of the long term trend.

4. The more times a support or resistance level is tested, the greater the odds that it will be broken. Old resistance can become the new support, and the old support may become the new resistance.

5. Moving averages can quantify trends and create signals for entries, exits, and trailing stops.

6. Bull Markets have no long term resistance, and Bear Markets have no long term support.

7. “The larger the market gaps, the greater the odds of continuation and a trend.” – Linda Raschke

8. “The last hour often tells the truth about how strong a trend truly is. “Smart” money shows their hand in the last hour, continuing to mark positions in their favor. As long as a market is having consecutive strong closes, look for an up-trend to continue. The up trend is most likely to end when there is a morning rally first, followed by a weak close.” – Linda Raschkee

9. Above the 200 day is where bulls create uptrends. Bad things happen below the 200 day; downtrends, distribution, bear markets, crashes, and bankruptcies.

10. “It is much easier to watch a few than many.” – Jesse Livermore

These are 10 powerful trading rules from new book “Trading Habits: 39 of the World’s Most Powerful Stock Market Rules.” The book explains these rules in great detail and how to profit from them along with 29 others.

Thursday, September 8, 2016

The 10 Trading Rules of Jesse Livermore

The 10 Trading Rules of Jesse Livermore

Before there was a William J. O’Neil or a Nicolas Darvas there was Jesse Livermore. Livermore was considered to be one of the greatest traders to ever live. He is said to have made over $100 million shorting the 1929 crash, an unthinkable amount in his time. He made and lost millions on several occasions, he was a master of the market. No one blew up as many trading accounts or came back to be a millionaire more times in trading history that I know of. We would all do well to sit up and listen to the primary rules and the methodology that he traded with. His strength was his ability to trade with size and ride a trend for huge wins. Livermore’s weaknesses were likely his lack of discipline at times to follow his own rules and he did not manage his risk of ruin throughout his career going through too many cycles of boom and bust. I would assume with his style of trading he was chopped up in range bound markets and spent a lot on commissions, in his day there were no discount brokers and commissions would add up.

Here were his basic rules from his book How to Trade In Stocks which is recommended reading by many top stock traders.

Buy rising stocks and sell falling stocks.Do not trade every day of every year. Trade only when the market is clearly bullish or bearish. Trade in the direction of the general market. If it’s rising you should be long, if it’s falling you should be short.Co-ordinate your trading activity with pivot points.Only enter a trade after the action of the market confirms your opinion and then enter promptly.Continue with trades that show you a profit, end trades that show a loss.End trades when it is clear that the trend you are profiting from is over.In any sector, trade the leading stock – the one showing the strongest trend.Never average losses by, for example, buying more of a stock that has fallen.Never meet a margin call – get out of the trade.Go long when stocks reach a new high. Sell short when they reach a new low.

While Livermore won in the markets over the long term he also lost everything many times, he even went into bankruptcy before making his unbelievable wealth. While he was a true pioneer in trend following, his weakness was the proper respect of risk management, especially his understanding of the odds that he would be ruined if he risked large amounts of his capital on each trade. He was living proof that if you do not respect the risk of ruin you will eventually be ruined by a string of losses. It is popularly believed that Livermore died broke, this is not true, he set up a trust for himself after one of his comebacks to make sure he would never be broke again. According to the books I read and Wikipedia he had untouchable trusts and cash assets at his death totaling over $5 million. He had a  lifelong history of clinical depression and it had become the dominant factor in his final years. He may have faced and been overcome by mental ruin at the end when he committed suicide after a life spent on the boom and bust wealth cycle along with a materialistic lifestyle. Jesse Livermore’s life is both an example of success with making the kind of money most new traders dream about and also a cautionary tale that shows the dangers of trading and the mental toll it can take when done incorrectly and with the wrong mindset.

Thursday, June 23, 2016

Behind Microsoft's Shift to Cloud Technology (MSFT)


Few companies have enjoyed the long-term success of Microsoft Corporation (NASDAQ: MSFT). The company has been a leader in the software business for over four decades and has created one of the most iconic brands in technology. Microsoft shareholders have benefited from the company's success. The company's $409.1 billion market capitalization as of June 8, 2016, ranked it as the world's third most-valuable publicly traded company.

Despite its history of success, Microsoft faces serious challenges going forward. Disruptive technologies, such as cloud computing, challenge the company's traditional software business and ultimately may make it obsolete. How the company addresses and embraces the competition from cloud computing may determine its future.

ADVERTISING

Proactive Response

Microsoft understands that it must embrace cloud computing and transition the company for future growth. Chairman John Thompson asserted that the company's traditional software business may disappear in a few years. While he lauded efforts by chief executive officer (CEO), Satya Nadella, to increase the company's revenues from internet software and services, he also acknowledged that the transition must occur more quickly. Thompson mentioned increased spending on cloud technology and restructuring the company's sales force and partnerships as ways to address the problem. The company sees cloud computing not merely as an add-on to its existing services, but rather as a critical step in its transition.

An Analogy to Telecom

Thompson noted that fellow board member Chuck Noski, the former chief financial officer (CFO) of AT&T Inc. (NYSE: T), experienced firsthand the effects of failing to address competition from new technology. Noski witnessed the traditional wireline business at AT&T disappear as consumers switched to wireless devices. Thompson and Noski understand that Microsoft may face a similar fate with its on-premise software programs.

Late to the Game

Microsoft forecast $20 billion in annual sales of commercial cloud products in fiscal year 2018, and Nadella expects the company to meet this goal. However, Thompson expressed concern about the company's late entry into cloud computing. While Microsoft's Azure cloud computing platform posted 100% gains in quarterly sales, it contributed only $5.8 billion of the company's $93.6 billion in revenues in fiscal year 2015. Other cloud products such as Power BI and the enterprise mobile management service contribute an even smaller fraction of the company's overall revenues. The board is evaluating whether the company has invested enough in this area and how it might leverage its relationships with partners to deliver better cloud products.

Building Partnerships

Analyst Lydia Leong of Gartner Inc. (NYSE: IT) believes Microsoft can better leverage its Azure offerings by forming partnerships with consultants to install and manage its services. Leong noted that Microsoft lags Amazon Web Services in its knowledge about installing and servicing cloud products. Most Microsoft salespeople lack deep familiarity and experience with subscription-based deals. Unlike the one-time purchases of traditional software sales, cloud sales entail longer-term contracts. Matt McIlwain, managing director at Seattle's Madrona Venture Partners, believes that Microsoft's sales team still needs to transition more effectively to a subscription-based selling model.

Reliance on Traditional Model

Microsoft's quarterly report, which it released on April 21, 2016, demonstrated the long path the company faces in breaking into cloud computing. The company announced weakness in its traditional software business and noted that this weakness may persist in the future. The company needs to grow its cloud business more quickly to avoid more growth headaches.

The company's 2015 annual report also highlighted the costs of transitioning to cloud computing. Cloud computing is a lower-margin business than traditional software; the cost of building and running data centers to deliver the product erodes margins. Microsoft's gross margins dropped from 80% in fiscal year 2010 to 65% in fiscal year 2015.

Competition

In market share, Microsoft's Azure cloud service trails Amazon Web Services, the product offering of Amazon.com Inc. (NASDAQ: AMZN), but it leads product offerings by Alphabet Inc. (NASDAQ: GOOGL) and International Business Machines Corporation (NYSE: IBM). Microsoft also offers Office 365 cloud versions for email, spreadsheets and other software.

Another big health hire APPL


Apple is quietly building one of the strongest teams in digital health, and on Thursday, it just added perhaps its most high-profile hire yet.

Stephen Friend, co-founder and President of Sage Bionetworks, is joining Apple's healthcare team, Sage Bionetworks announced in a press release on Thursday.

It's not clear exactly what Friend's title will be at Apple, and Apple did not immediately respond to requests for comment. 

Before Sage, Friend was an executive at Merck and a faculty member at Harvard Medical School. 

Sage Bionetworks is perhaps the most important partner for Apple's nascent health effort. Sage has been a partner on most of the high-profile apps to come out on Apple's health-focused platforms, ResearchKit and CareKit. 

Sage Bionetworks helped develop the Parkinson mPower app, for example, which was one of the first ResearchKit apps at launch and later became one of the first CareKit-enabled apps. 

Sage provides an accessible, open-source backend for ResearchKit and CareKit apps, and for many researchers and clinical professionals, it was a partner that helped address a lot of the messy behind-the-scenes problems with building one of these mobile health apps. 

"Sage Bioneworks is definitely a big player with where Apple goes with [health], but there's some sort of pseudo-interesting relationship between the two of them," Ahmed Albaiti, CEO of health care consultancy Medullan, said.

"Sage has a very rich think-tank set of resources, and they are are the ones that trailblaze on these Apple products, but they don't help you develop [ResearchKit and CareKit apps]," Albaiti said.  

Apple has long-term ambitions to go into the healthcare market, and has been emphasizing the health capabilities of the Apple Watch. Earlier this year, CEO Tim Cook said Apple had "massive interest" in the health world and that the healthcare space is "ripe for simplicity and a new view."

Last month, it posted a job listing for a lawyer who focused on medical privacy. 

Wednesday, March 7, 2012

How to embed fonts in EPUB?

I tried to read Chinese font in Kobo's Wireless eReader (KOBO WI FI) recently, and I found a way to do it, maybe it is the only solution for KOBO WIFI.

So I prepared a step by step guide to explain how to make any exists epub file work as following, I also prepared several screenshots for you.

  1. Prepare the zip tool - 7zip, you can download it from here, and install it
  2. Rename the epub file to zip
  3. Extract files into a folder using 7zip
  4. Copy the font file DroidSansFallback.ttf into the unzipped folder
  5. Edit stylesheet.css add the font and use it, the original and changed css as following

  6. @namespace h "http://www.w3.org/1999/xhtml";
    
    body{
        margin:10px;
        font-size: 1.1em;
    }
    
    p{text-indent:2em; line-height:1.5em; margin-top:0; margin-bottom:0;}
    
    .catalog{
        margin:1pt;
        padding:0;
        text-indent:2em;
    }
    
    h1{text-align:right; margin-right:2em; page-break-before: always; font-size:1.6em; font-weight:bold;}
    
    h2{
        display: block;
        font-size: 1.2em;
        font-weight: bold;
        margin-bottom: 0.83em;
        margin-left: 0;
        margin-right: 0;
        margin-top: 1em;
        page-break-before: always;
    }
    
    .mbppagebreak {
        display: block;
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
        page-break-after: always
    }
    
    a{
        color: inherit;
        text-decoration: inherit;
        cursor: default
    }
    
    a[href]{
        color: blue;
        text-decoration: underline;
        cursor: pointer
    }
    
    .italic{
        font-style: italic
    }
    

    @font-face{
        font-family:"Droid Sans Fallback";
        font-style:normal;
        font-weight:normal;
        src:local("DroidSansFallback.ttf"), url("DroidSansFallback.ttf");
    }
    
    body{
        margin:5%;
        font-family:"Droid Sans Fallback";
    }
    
    p{
        text-indent:0.25in;
        margin:0;
        line-height:150%;
        text-align:justify;
        font-size:100%;
        font-family:"Droid Sans Fallback";
    }
    

  7. Edit content.opf to change any metadata not in latin to latin chracter

  8.     三国演义(毛评本)
        罗贯中
        三国演义(毛评本)
        zh-cn
        
        COAY.COM [http://www.coay.com]
        COAY.COM
        2610
        三国演义(毛评本)
    

        SanGuoYanYi
        LuoGuanZhong
        SanGuoYanYi
        zh-cn
        
        COAY.COM [http://www.coay.com]
        COAY.COM
        2610
        SanGuoYanYi
    

  9. Zip the folder content using 7zip
  10. Rename the zip file to epub
  11. Drop it into your KOBO WIFI and enjoy reading

This was tested on KOBO WIFI and android 2.1 tablet and smartphone.

Saturday, April 16, 2011

Wrapper Classes and Their Constructor Arguments

PrimitiveWrapper Class Constructor Arguments
booleanBooleanboolean or String
charCharacterchar
byteBytebyte or String
shortShortshort or String
intIntegerint or String
longLonglong or String
floatFloatfloat, double, or String
doubleDoubledouble or String

Default Values for Primitives and Refrence Types in Java

Variable TypeDefault Value
Object referencenull (not referencing any object)
byte, short, int, long0
float, double0.0
booleanfalse
char'\u0000'

SCJP Exam Watch 11 - Access instance variable/method from static mathod

One of the mistakes most often made by new Java programmers is attempting to access an instance variable (which means nonstatic variable) from the static main() method (which doesn't know anything about any instances, so it can't access the variable). The following code is an example of illegal access of a nonstatic variable from a static method:

class Foo {
    int x = 3;
    public static void main(String[] args) {
        system.out.println("x is " + x);
    }
}

Understand that this code will never compile, because you can't access a nonstatic (instance) variable from a static method. Just think of the compiler saying, "Hey, I have no idea which Foo object's x variable you're trying to print!". Remember, it's the class running the main() method, not an instance of the class.

Of course, the tricky part for the exam is that the question won't look as obvious as the preceding code. The problem you're being tested for accessing a nonstatic variable from a static method will be buried in code that might appear to be testing something else. For example, the preceding code would be more likely to appear as

class Foo {
    int x = 3;
    float y = 4.3f;
    public static void main(String[] args) {
        for (int z - x; z < ++x; z--, y = y + z) {
            // complicated looping and branching code
        }
    }
}
So, while you're trying to follow the logic, the real issue is that x and y can't be used within main(), because x and y are instance, not static, variables! The same applies for accessing nonstatic methods from a static method. The rule is, a static method of a class can't access a nonstatic (instance) method or variable of its own class.


Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

Sunday, April 10, 2011

Compiler generated constractor code

class Foo {}
======>
class Foo {
    Foo() {
        super();
    }
}


class Foo {
    Foo() {}
}
======>
class Foo {
    Foo() {
        super();
    }
}


public class Foo {}
======>
public class Foo {
    public Foo() {
        super();
    }
}


class Foo {
    Foo(String s) {}
}
======>
class Foo {
    Foo(String s) {
        super();
    }
}


class Foo {
    Foo(String s) {
        super();
    }
}
======>

Nothing, compiler doesn't need to insert anything.



class Foo {
    void Foo() {}
}
======>
class Foo {
    void Foo() {}
    Foo() {
        super();
    }
}

(void Foo() is a method, not a constructor.)


Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

SCJP Exam Watch 10 - Methods return an abstract class or interface

Watch for methods that declare an abstract class or interface return type, and know that any object that passes the IS-A test (in other words, would test true using the instanceof operator) can be returned from that method - for example:

public abstract class Animal {}
public class Bear extends Animal {}
public class Test {
    public Animal go () {
        return new Bear();    // OK, Bear "is-a" Animal
    }
}

This code will compile, the return value is a subtype.


Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

Saturday, August 28, 2010

SCJP Exam Watch 9 - Class and Interface Declaration

Look for illegal uses of extends and implements.  The following shows examples of legal and illegal class and interface declarations:


class Foo {}                        // OK
class Bar implements Foo {}         // No! Can't implement a class
interface Baz {}                    // OK
interface Fi {}                     // OK
interface Fee implements Baz {}     // No! Interface can't implement an interface
interface Zee implements Foo {}     // No! Interface can't implement a class
interface Zoo extends Foo {}        // No! Interface can't extend a class
interface Boo extends Fi {}         // OK
class Toon extends Foo, Button {}   // No! Class can't extend multiple classes
class Zoom implements Fi, Baz {}    // OK
interface Vroom extends Fi, Baz {}  // OK
class Yow extends Foo implements Fi {}    // OK


Burn these in, and watch for abuses in the questions you get on the exam.  Regardless of what the question appears to be testing, the real problem might be the class or interface declaration.  Before you get caught up in, say, tracing a complex threading flow, check to see if the code will even compile.


Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

Thursday, August 26, 2010

My sons

My sons picture!
Great!


They are in China now, I miss them and my wife.

SCJP Exam Watch 8 - Obfuscate

The exam creators will tell you that they're forced to jam tons of code into little spaces "because of the exam engine." While that's partially true, they ALSO like to obfuscate.

The following code:

Animal a = new Dog();
Dog d = (Dog)a;
d.doDogStuff();

Can be replaced with this easy-to-read bit of fun:

Animal a = new Dog();
((Dog)a).doDogStuff();

In this case the compiler needs all of those parentheses, otherwise it thinks it's been handed an incomplete statement.


Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

Tuesday, May 18, 2010

SCJP Exam Watch 7 - Object Orientation (3)

Don't be fooled by a method that's overloaded but not overridden by a subclass. It's perfectly legal to do the following:

public class Foo {
    void doStuff() {}
}

class Bar extends Foo {
    void doStuff(String s) {}
}

The Bar class has two doStuff() methods: the no-arg version it inherits from Foo (and does not override), and the overloaded doStuff(String s) defined in the Bar class. Code with a refrence to a Foo can invoke only the no-arg version. but code with a reference to a Bar can invoke either of the overloaded versions.


Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

SCJP Exam Watch 6 - Object Orientation (2)

Be careful to recognize when a method is overloaded rather than overridden. You might see a method that appears to be violating a rule for overriding, but that is actually a legal overload, as follows:

public class Foo {
    public void doStuff(int y, String s) {}
    public void moreThings(int x) {}
}

class Bar extends Foo {
    public void doStuff(int y, long s) throws IOException {}
}

It's tempting to see the IOException as the problem, because the overridden doStuff() method doesn't declare an exception, and IOException is checked by the compiler.

But the doStuff() method is not overridden! Subclass Bar overloads the doStuff() method, by varying the argument list, so the IOException is fine.


Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

SCJP Exam Watch 5 - Object Orientation (1)

If a method is overridden but you use a polymorphic (supertype) reference to refer to the subtype object with the overriding method, the compiler assumes you're calling the supertype version of the method.

If the supertype version declares a checked exception, but the overriding subtype method does not, the compiler still thinks you are calling a method that declares an exception.

Let's take a look at an example:

class Animal {
    public void eat() throws Exception {
        // throws an Exception
    }
}

class Dog extends Animal {
    public void eat() {
        /*no Exceptions*/
    }

    public static void main(String[] args) {
        Animal a = new Dog();
        Dog d = new Dog();
        d.eat();        // OK
        a.eat();        // Compiler error - unreported exception
    }
}

This code will not compile because of the exception declared on the Animal eat() method. This happens even though, at runtime, the eat() method used would be the Dog version, which does not declare the exception.

Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

Friday, May 14, 2010

SCJP Exam Watch 4 - Encapsulation

Look out for code that appears to be asking about the behavior of a method, when the problem is actually a lack of encapsulation. Look at the following example, and see if you can figure out what's going on:

class Foo {
    public int left = 9;
    public int right = 3;

    public void setLeft(int leftNum) {
        left = leftNum;
        right = leftNum/3;
    }

    // lots of complex test code here
}

Now consider this question: Is the value of right always going to be one-third the value of left? It looks like it will, until you realize that users of the Foo class don't need to use the setLeft() method! Thay can simply go straight to the instance variables and change them to any arbitrary int value.


Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

SCJP Exam Watch 3 - Array Declaration

It is never legal to include the size of the array in your declaration. Yes, we know you can do that in some other language, which is why you might see a question or two that include code similar to the following:

int[5] scores;

The preceding code won't compile. Remember, the JVM doesn't allocate space until you actually instantiate the array object. That's when size matters.


Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

SCJP Exam Watch 2 - Interface Definition

Look for interface difinitions that define constants, but without explicitly using the required modifiers. For example, the following are all identical:

// Looks non-static and non-final, but isn't!
public int x = 1;
// Looks default, non-static, non-final, but isn't!
int x = 1;
// Does't show public or final
static int x = 1;
// Doesn't show public or static
final int x = 1;
// Doesn't show final
public static int x = 1;
// Doesn't show static
public final int x = 1;
// Doesn't show public 
static final int x = 1;
// What you get implicitly
public static final int x = 1;

Any combination of the required (but implicit) modifiers is legal, as is using no moddifiers at all! On the exam, you can expect to see questions you won't be able to answer correctly unless you know, for example, that an interface variable is final and can never be given a value by implementing (or any other) class.



Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)

SCJP Exam Watch 1 - Identifier

The objective says you have to know legal identifiers only for variable names, but the rules are the same for ALL Java components. So remember that a legal identifier for a variable is also a legal identifier for a method or a class. However, you need to distinguish between legal identifiers and naming conventions, such as the JavaBeans standards, that indicate how a Java component should be names. In other words, you must be able to recognize that an identifier is legal even if it does't confirm to naming standards.

If the exam question is asking about naming conventions - not just whether an identifier will compile - JavaBeans will be mentioned explicitly.



Refrence: SCJP Sun® Certified Programmer for Java™ 6 Study Guide Exam (310-065)
Java, JavaScript, HTML, XHTML, AJAX, CSS, etc.