• Australian (ASX) Stock Market Forum

Hello and welcome to Aussie Stock Forums!

To gain full access you must register. Registration is free and takes only a few seconds to complete.

Already a member? Log in here.

Tools being used by your trading competition

Discussion in 'Trading Strategies/Systems' started by howardbandy, Dec 10, 2016.

  1. jjbinks

    jjbinks

    Posts:
    305
    Likes Received:
    265
    Joined:
    May 14, 2013
    Hey Howard,

    Why do you recommend python for beginners instead of something like AFL or the other languages with other software?

    Thanks
     
  2. ThingyMajiggy

    ThingyMajiggy

    Posts:
    1,627
    Likes Received:
    44
    Joined:
    Nov 12, 2007
    Did you miss his last post just now?
     
  3. howardbandy

    howardbandy

    Posts:
    838
    Likes Received:
    93
    Joined:
    Jun 13, 2007
    Hi JJ --

    If you will be staying with a traditional trading system development platform, then my recommendation has long been and continues to be AmiBroker and the afl language.

    If you will be developing trading systems using machine learning, then my recommendation is Python with the scikit-learn library.

    The models that can be created using traditional platforms are primarily decision tree. Due to the limitations of the platform, there is seldom any other model algorithm that can be created. Scikit-learn hosts about 20 model algorithms, including decision tree and several others that often perform better than decision tree. Additionally, the entire stack of trading operations can be coded into a single Python program -- development, validation, risk assessment, trading management.

    Best regards, Howard
     
  4. Quant

    Quant

    Posts:
    492
    Likes Received:
    142
    Joined:
    Dec 13, 2015
    Great thread and good to see Howard instigating a meaningful discourse . Id love to dig in and say my bit but its xmas and there is plenty of time for that . Watching with interest .


    statistical based empirically proven rules based systems can have defined expectancy and by their very nature can be exploited to maximize returns exponentially J curve style . This is the realm of quants , dismiss at your peril ...

    rock on

    Ohh and MERRY XMAS to all , make 2017 matter
     
  5. OmegaTrader

    OmegaTrader

    Posts:
    590
    Likes Received:
    85
    Joined:
    Jul 19, 2016
    Meaningful?

    I don't even know what you just said ahaha

    Only joking

    Why do you Quants always pull this jargon!!
    What the hell does that even mean

    Your not exploiting anything, just optimising your position sizing
    ???
    I think haha

    and why bring in the j-curve???

    to confuse me more and show your smarter than me
    aahaha



    http://www.investopedia.com/terms/j/j-curve-effect.asp



    Can't you just say

    Given my ASSUMPTIONS and statistical/ historical back testing I know what risk and return will be for my system.

    Therefore I can increase of decrease position sizing within my system to optimise returns.
     
  6. Wysiwyg

    Wysiwyg Everyone wants money

    Posts:
    8,424
    Likes Received:
    260
    Joined:
    Aug 8, 2006
    Got a question for Howard regarding "data". Data availability, data reliability, data latency and cost of data are some factors that limit data analysis. I notice on Quantopian they claim 4 million data sets are available through Quandl and Yahoo Finance. What is a data set, please?
     
    Last edited: Dec 25, 2016
  7. howardbandy

    howardbandy

    Posts:
    838
    Likes Received:
    93
    Joined:
    Jun 13, 2007
    A data set is a series of values associated with a tradable issue, such as a stock, fund, future; or with an economic, econometric, or demographic indicator, such as gross domestic product or population. Being a series implies that there are dates associated with the data values, such as daily closing price for a stock, quarterly GDP, or annual population.

    Quandl is a data aggregator. They do not produce data. Rather, they gather data from a variety of sources and redistribute it. Some of their data sets, such as those gathered from Yahoo or government agencies, are free; others have a subscription charge.

    For Quandl, the data is stored on the Quandl servers. Quandl maintains a single master copy. Customers retrieve the latest copy as it is needed. In this respect, Quandl data is similar to Yahoo data, but with many more data series available.

    Compare with Norgate where the data is stored on the customer's computer and updated automatically by Norgate. Norgate's data is excellent, but limited to financial trade prices.

    My experience with Quandl is good. What you get from a single Quandl data series is essentially a comma separated file similar to a spreadsheet. A customer, free or subscription, can download a data series as a flat file in csv format for processing on a local computer. Quandl also provides APIs for many programming languages that access the Quandl data and pass it to an application program on the subscriber's computer. For example, I use the Quandl Python API. When I execute an analysis program written in Python, a call to the Quandl API specifies the Quandl identifier (such as a ticker symbol or string) and returns the data as a Python Pandas dataframe. If I want to perform analysis using some trading data and some econometric data, I make several calls to Quandl, storing each data series in the Pandas dataframe. The dataframe automatically takes care of date and time alignment, filling in missing values, etc.

    Quandl's web page:
    https://www.quandl.com/
    One of their pages for US stocks:
    https://www.quandl.com/data/WIKI-Wiki-EOD-Stock-Prices/documentation/documentation?modal=null
    To my limited knowledge, they do not cover Australian stocks.

    Best, Howard
     
  8. ThingyMajiggy

    ThingyMajiggy

    Posts:
    1,627
    Likes Received:
    44
    Joined:
    Nov 12, 2007
    So Howard I've been meaning to ask, with all this talk of machine learning etc. do you actually have/run any ML systems yourself? I imagine that you must have a few systems that earn you an income. what success have you had with ML and trading?
     
  9. howardbandy

    howardbandy

    Posts:
    838
    Likes Received:
    93
    Joined:
    Jun 13, 2007
    Greetings --

    The short answer is yes, I do.

    I do follow my own advice, most of which is outlined in the presentations I have made and writings I have published. I'll break my response into a few parts.

    1. Most of the development work I am doing now is with machine learning. The flexibility and power of the Python base, coupled with the variety of models available through scikit-learn and other libraries, the ability to determine hyperparamters, fit models, test whether learning took place, and calculate the risk and profit potential all in a single program run gives a great deal of control over the development process. I continue to work in AmiBroker -- particularly with some of my clients.

    2. The sweet spot in terms of risk-normalized profit potential really is high accuracy and short holding periods. Using one-day lookahead targets fits naturally into machine learning. Anticipating market-to-market daily management of trades after the system has moved on from development, using day-to-day state signals rather than impulse signals works well.

    3. I am making fewer trades these days. One of the reasons to stop trading is when you have enough. At my stage of life, I do not know what I would do with more money.

    I highly recommend following the scientific method of learning then validating. And becoming competent in machine learning for trading. Pay particular attention to learning, validation, and aspects of modeling and simulation unique to time series. There is a lengthy learning curve and it includes becoming competent in both mathematics and programming. Do not be fooled by suggestions that these skills are unnecessary.

    The best traders have already moved to machine learning. They would not have done that unless it gave an advantage over all other trading techniques -- including subjective trading and quantitative trading using only the decision tree model available in traditional development platforms. Large trading organizations are already employing thousands of highly educated, highly skilled system developers. There is only one trading arena. Trading is zero-sum at best. In order to be profitable, every trader must be able to compete profitably along side David Shaw, James Simons, and Goldman Sachs.

    Best, Howard
     
  10. ThingyMajiggy

    ThingyMajiggy

    Posts:
    1,627
    Likes Received:
    44
    Joined:
    Nov 12, 2007
    Thanks very much Howard :)

    Yeah the Mathematics is the hard part for me, I know some programming already, but have been out of school for years and I am terrible with my Maths unfortunately, so I'm going to have to raid the likes of Khan Academy or something as well if I am to learn ML.
     
  11. OmegaTrader

    OmegaTrader

    Posts:
    590
    Likes Received:
    85
    Joined:
    Jul 19, 2016
    Hi again,

    Some more questions this time, more on the philosophical side..

    You can always forward some money to me. haha

    Pm me for details :)



    This raises interesting questions.

    Is it better to just passively invest, if there is no possibility of alpha given the strong competition?

    If one cannot trade effectively in general, the the next best thing is to passively invest.

    Why should I read books or learn if I am fighting bruce lee.

    Better to acquiesce

    It also raises another point.

    How do you explain the success of buffet type strategies who generally are not Quants?

    Also

    I saw before someone put the 20-30% return range.

    In your experience, in general, I know a bit hard to generalise...

    What is the risk and reward profile of these quant type strategies?

    Return, STD/Volatility etc

    Finally a philosophical reflection on quants, assumptions and human nature.

    A big theme of the GFC was counter party failure and Quants

    The banks made risky loans, on sold those loans in collateralised derivative black magic instruments created by quants.

    That hardly anyone understood.

    The quants then valued these given ASSUMPTIONS.

    The models were completely off.

    Some parties took on the risk of the loan and then hedged the risk with an insurer.

    The problem was that the insurer went bankrupt and COUNTERPARTY FAILURE ensued.

    Until the people ended up taking the cost through government assistance.

    Of course people who took out the loans did not have clean hands either.

    Aren't these the smart quants at goldman sachs. or did they just ignore the warning signs?

    So the question is whether the quants got it wrong of if HUMAN NATURE,corruption and under regulation led the data being put into these models to be incorrect, assumptions incorrect and then led to an mistake in the valuation of risk.

    Or whether there really is a chance for the human creativity that we cannot encompass yet into a computer.

    Until we reach/if we reach the singularity.

    Part of me doesn't want to accept that yet.

    cheers

    my twocents
     
  12. howardbandy

    howardbandy

    Posts:
    838
    Likes Received:
    93
    Joined:
    Jun 13, 2007
    My thoughts -- some that can be justified using the principles of mathematics, modeling, simulation, and statistics. Others not so easily.

    1. Review my thoughts on investing versus trading versus expenses. If I make an investment, I have my lawyer write the details and disposition into my will. If there is a reasonable chance I will close out that transaction sometime before I die, it is a trade. Trades need rules. I need to know what conditions will cause the exit. If there are so few examples that I cannot use the scientific method of evaluating many in-sample examples followed by testing previously unused out-of-sample examples, then that transaction is subjective and no analysis is possible.

    Passive investing, to me, means buying a stock or fund, putting it in my will, and forgetting about it. Not even another GFC would cause a sale. Passive trading, to me, means buying a stock or fund, expecting to sell it sometime, but not having clear rules. I am terrible at that. The first book I recommend to everyone is Daniel Kahneman's "Thinking, Fast and Slow." Dr. Kahneman explains how we fool ourselves.

    Passive holding of any asset implies relatively long holding periods. Long enough that there will be substantial drawdown. An assumption of passive holding is that the drawdown will be short enough and shallow enough that it can be tolerated -- held through. Some people even think that is an opportunity to increase position size. In some cases, that works. The drawdown in 2009 was over 50%. Easy money policies by central banks bought a quick recovery. We will learn the true consequences of those policies in the next year or two. I expect another very steep drawdown. The drawdown in 1932 was about 80% and took over 25 years to recover.

    Passive holding assumes that returns will compensate for risk and inflation. Much of the period those of us alive and trading today remember is that following WWII. There are many signs that we cannot expect the conditions that brought those gains to continue. For example, increasing globalization, increasing unrest, and serious climate changes.

    2. Warren Buffett acts more like the president of a corporate conglomerate than a trader. Berkshire Hathaway buys large positions in companies expecting to hold them long periods. They experienced drawdowns of more than 50% in 2009. My risk tolerance is much lower. To my thinking, a trader holding through steep drawdowns is making a mistake. A better technique is exiting and returning later.

    3. By quant strategies, I'll assume those similar to James Simons and David Shaw. When I was working in a hedge fund, we, and most funds, charged "2 and 20" -- 2% annually of notional funds under management and 20% of profits -- and our customers were profitable. Some of the best funds charged higher fees -- as high as 5 and 45 -- and still made customers wealthy. But funds that profitable are rare. And the 2 and 20 model is disappearing.

    4. I recommend not trading anything that is not cleared by an independent central clearing agent. In over-the-counter trades, when I buy from you, you are my counterparty. If you fail to meet your obligations, I must deal with you directly. When trades are cleared by an independent central clearing agent, the clearing house is the counterparty to both traders. Be very wary of trading anything OTC.

    5. I began working with artificial intelligence and machine learning in the 1960s. Some of the research I did in graduate school contributed to early work with neural networks and nearest neighbor analysis. Alan Turing posed the Turing Test in 1950, anticipating increasing capabilities of computer-based applications. The Turing Test has been convincingly passed; computers are now champions of every board and card game; artificial intelligent applications are better than human experts in almost all professions, including medicine, law, and logic.

    Some people estimate that the singularity -- computer abilities surpassing human abilities in almost everything -- will happen soon. I agree with them. I believe the singularity is near.

    I also believe the singularity will be harmful to the world, including to people. I imagine the similarities with being discovered by a superior society. Consider the Incas being discovered by Pizarro, or the US plains Indians by European settlers, or ...

    --------------

    I know -- this is more than you expected to hear. I hope it helps in convincing readers of the importance of following the scientific method in trading system development and in trading.

    Thanks for listening.

    Best, Howard.
     
    Boggo and captain black like this.
  13. captain black

    captain black

    Posts:
    1,281
    Likes Received:
    748
    Joined:
    Oct 24, 2005
    Great post Howard. Plenty of great minds (Elon Musk, Bill Gates, Stephen Hawking etc) warning about the singularity. Sadly, like a few of the other issues you mentioned, most of the warnings are being ignored.
     
  14. OmegaTrader

    OmegaTrader

    Posts:
    590
    Likes Received:
    85
    Joined:
    Jul 19, 2016
    Great post again.

    Where do I start? haha

    Point 1
    Sorry to disagree with you but
    It is very hard to argue against passive investing as a strategy in the long term.

    I haven't seen a lot of evidence to show that passive doesn't work in the long term.

    1932 was the most extreme of the extreme.

    I can't remember the book/publication but they looked across countries and over 100 of years.
    In most countries given the long term it worked.
    But there is always exceptions. Japan etc

    I suppose it is a bet on the future of the country.
    Growth by population, efficiency from technology, better regulations etc etc

    To me passive trading just means spending less time on researching and implementing the trading decisions. Not being an idiot and giving up on being strategic or rational. hahaha


    If passive investing is not a suitable strategy and one cannot beat the big boys trading....

    and

    If Profitable funds are also rare

    Then what do you do?

    Leave the money in the bank and get destroyed by inflation and taxes?


    I can't agree or disagree with you on your pessimism.

    My opinion :The fog of war is too noisy for anyone to predict what will happen.

    Point 2

    The point I was making was that Buffett is successful and doesn't use advance quant strategies..
    That goes against your ethos of quantifying as much as possible.
    Doesn't that prove that qualitative strategies can work??

    Point 3

    So 20+%. No one is making money anymore???
    What?



    Point 4

    Yes OTC is a minefield.

    I am not saying quant strategies don't work

    and following scientific evaluation can really really help.

    But the point I was making is that all of the aspects were quantified but the counter parties failed.
    and these were big counter parties and the smartest of the smartest quants.

    AIG Goldman Sachs JP etc etc



    The numbers on the sheet did not tell the wholes story, unless someone was fabricating the numbers...

    I think sometimes quants forget that life is not like a poker, blackjack,chess game, with the cards/board always being the same and the optimum strategy never changing once you have found it

    We can't even work out the weather in one weeks time...

    Going back to your previous point, a will can be challenged, so even that is not set in stone.

    Assumptions are the key and are still mainly in the realm on qualitative thought

    Qualitative analysis still must have some value at least at the moment.



    Point 5

    I used to think that the singularity was close and fear it..

    But now think it will be more augmentation, even some biological engineered/evolutionary aspects thrown in there too.

    No wolverines or skynet in my lifetime,

    :vamp::borg:

    I hope

    cheers
     
  15. howardbandy

    howardbandy

    Posts:
    838
    Likes Received:
    93
    Joined:
    Jun 13, 2007
    I'll comment just on passive versus active.

    By active, I mean all purchases and sales are the result of signals given by rules. If development was done following the scientific method, trade-by-trade position size adjusted to keep anticipated risk within personal tolerance, then there is a chance results will be profitable.

    By passive, I mean picking a stock or fund that follows an index, then buying and holding that for a long time -- years -- without regard for rises or falls in the value. At some point, the funds will be withdrawn, but that is because they are needed for some other purpose, rather than as a result of performance.

    -----------

    That said, passive is essentially subjective selection of a country, sector, or stock. It is subjective even if there are pseudo-rules based on historical data because there is not an opportunity to test on out-of-sample data that follows the historical data.

    My concern is that, in my opinion, the future is unlikely to resemble the past. The US economy grew strongly following WWII, up through about 2000. The period since 2000 has been much weaker. The recovery from the 2009 crisis was due almost entirely to central banks buying a recovery with borrowed money -- yet to be repaid. Some of the factors that are different now compared with 1945 to 2000 are development in previously under-developed countries, globalization in manufacturing and intellectual activities, nationalism, terrorism, automation in manufacturing, artificial intelligence in intellectual activities, climate change, and the debt that must be repaid to unwind the recovery from 2009.

    Which country to pick?

    Not the US. We are in a bubble as extreme as we were in 2000. Even without Trump, the US is unlikely to experience any growth at all over the next decade or two. If Trump succeeds in implementing his stated plans, I expect a short, temporary spurt in apparent growth -- maybe we are seeing the start of it already in anticipation -- followed by a crisis worse than 2009 that will go on for decades and cripple the US, and the world, forever. I think the risk of being a passive investor / trader in US equities, bonds, and real estate is the highest it has ever been.

    Japan has very high debt and low productivity. Europe is in trouble. China is restricting financial activity. Russia is a poor country with only two export products -- oil and fear. The mid-east is a disaster that, at best, we can hope will not spread. Africa is unruly.

    I do not see a good choice for buy and hold decades. As you say, these include my assumptions and subjective estimates.

    I do see opportunities to trade using scientific techniques with day-to-day management, reducing position size when recent results are poor and increasing when they are good. Quantitative. Scientific. Day-by-day. Using the best model development techniques available. The tools -- the mathematics -- will tell us what and when to buy and sell, and when to stop trading.

    Thanks for listening,

    Best, Howard
     
    pixel and tech/a like this.
  16. tech/a

    tech/a No Ordinary Duck

    Posts:
    19,238
    Likes Received:
    3,253
    Joined:
    Oct 14, 2004
    None are as blind as those who cannot see.
    None are as deaf as those who cannot hear.

    We all march to the beat of our own drum.

    The best we can hope for is to manage our own
    affairs. If we can do that you'd be surprised
    what can happen.

    Thanks to everyone sharing.
     
  17. OmegaTrader

    OmegaTrader

    Posts:
    590
    Likes Received:
    85
    Joined:
    Jul 19, 2016
    BY this thought process almost all historical back-testing is invalid.

    As the assumption of back-testing is that the future will follow similar rules.

    Isn't that what a lot of systems use as part of the analysis?

    Passive investing is simply buying and holding and selling in 20-30 years when you need the money to retire.

    That is it. No time, no effort, no complicated formulas.

    That is the rule:

    buy every year of work using savings and hold it until retirement.

    I would be suprised if your could show me a period of 20-30 years were buying each year would not work in Australia or the us

    Save on tax, save on commission, save on fees, save on grey hairs!!!

    No timing the market.

    It has worked for the history of the Australian stock market

    and the US.

    It is not perfect but it saves the opportunity cost of spending time and mental capital on trading.



    I was reading an an article based in the 1980/90s about how the US was going to default on Gov debt now it is 120% + f GDP and still going....

    Of course logical scientific analysis is useful.

    But don't forget we are not playing blackjack.....

    No one knows what cards are in the deck.

    The GFC should have aught alot of quants that.

    cheers
     
  18. howardbandy

    howardbandy

    Posts:
    838
    Likes Received:
    93
    Joined:
    Jun 13, 2007
    Greetings --

    1. Correct. Almost all historical backtesting is without value in estimating future performance. The phrase I used was: profitable backtesting is necessary, but not sufficient.

    2. Let me make a slight change in the terminology: Successful trading requires that the future resemble the past. That is one of the tenets of technical analysis, as well as machine learning.

    In order for a trading system to be profitable in live trading, the system must be profitable for the out-of-sample validation period and into the live trading period. (It will have been profitable for the in-sample period too, but that is always true of a system that enters validation testing.) We rely on the conditions being stationary. That is, the future must resemble the past with respect to the signals and trade generated by the system. Watch my YouTube presentation on "The Importance of Being Stationary."
    http://www.blueowlpress.com/video-presentations

    3. Trading is like some gambling games.

    Trading is similar to blackjack. Blackjack has a memory. The cards already played change the distribution of the cards yet to be played, and change the players odds of winning. An expert blackjack player does know the cards that remain in the deck, can compute the probability of winning and losing given those yet-to-be-dealt cards, can identify when the player has an advantage over the house, and can bet accordingly. My "Modeling" book has an analysis of blackjack as a business and compares trading as a business. Both require capital adequate to stay solvent through drawdowns.

    But trading is not similar to roulette. Roulette has no memory. No history or sequence of recent winning pockets changes the probability of winning a bet on any pocket on the next play. The odds of a player winning is never in his or her favor. And no money management scheme can turn that negative-expectation game into a winning system. The "Modeling" book also describes roulette.

    Best, Howard
     
    pixel likes this.
  19. OmegaTrader

    OmegaTrader

    Posts:
    590
    Likes Received:
    85
    Joined:
    Jul 19, 2016
    The deck in poker does not change.
    The chess pieces do not change.

    The rules of the game do not change. Once the optimum/game theory optimum/ basic strategy is found.
    That is the end of the game.
    It has been solved now any computer or idiot on basic strategy using rule of thumb can win it.



    As you stated yourself.

    Assumptions again....

    Incorrect assumptions lead to incorrect statements !!!

    Roulette is beatable and not always a negative ev game.

    The man who broke montecarlo.

    The first historical reference of a biased wheel in roulette.

    Edward O Thorp one of the main contributors to basic blackjack strategy

    beat roulette as well...

    In sense he constant turning of the wheel over time biases the numbers.
    Colloqually a memory of sorts...


    In O Thorps case, calculating where the ball will likely land given it's current position speed etc etc

    Once again a memory of sorts...


    I am merely trying to prevent my point of view that qualitative though still has value because of assumptions.

    Pure Quants often forget this.


    You are clearly an extremely intelligent and successful individual being well respected also.

    So please do not be offended.


    cheers
     
  20. howardbandy

    howardbandy

    Posts:
    838
    Likes Received:
    93
    Joined:
    Jun 13, 2007
    Greetings --

    I have snipped out some of your reply to allow the focus on points where we disagree:

    The deck in poker and blackjack definitely does change. Every card that is exposed while the game is in progress changes the distribution of the remaining yet-to-be-dealt cards. That change can be detected. It is precisely that change in distribution that players use to estimate their advantage or disadvantage, and play accordingly. With no change in distribution, as when the blackjack deck is shuffled before each hand, or continuously shuffled, the player always has a negative expectation due to rules that favor the house.

    Roulette is not beatable. A true wheel has no memory. Between the table limits (which prevent full use of Martingale betting techniques) and the house advantage (green pockets) that creates a negative expectation, no player can win consistently.

    Edward Thorpe was a major contributor to analysis of blackjack. He also successfully managed money. His success with roulette was due to recognizing and taking advantage of an unfair (out of balance) roulette wheel. Neither he, nor anyone else, could or can predict which pocket the ball will land in on a fair roulette wheel.

    Best, Howard
     
    pixel likes this.
Loading...

Share This Page