Australian (ASX) Stock Market Forum

Weekly Portfolio - ASX

Index is up and I have 6 buy signals. Orders placed. What a good feeling.

Fingers are crossed that no whipasaw is coming.

I am also making headway with putting a strat into python. I will post some info later on this, and my buys.
 
Index is up
@Warr87 I was wondering what index filter you settled on?

eg

1 - XAO for the entire system - daily, weekly or monthly for your system

or

2 - The selected stocks relevant sector index ie EHE - Estia Health Limited - Health Care - Sector XHJ - daily, weekly or monthly for your system

Cheers
 
The All Ords closing above a moving average. (weekly)

The stocks that came up are mostly metals. At the moment I don't have a sector filter (and i'm not sure how to implement one too).
 
Index is up and I have 6 buy signals. Orders placed. What a good feeling.

Fingers are crossed that no whipasaw is coming.

I am also making headway with putting a strat into python. I will post some info later on this, and my buys.

Be interested to hear how you go with Python Warr87. Some time ago I started on the excellent book "Trading Evolved: Anyone can Build Killer Trading Stategies in Python" (Andreas Clenow).

I'm yet to be convinced that Python is "better" than Amibroker, but hoping different tools and different approaches might suggest new creative and profitable directions. If nothing else may open my eyes to other systems/code that people share.

Anything shared by Clenow is usually excellent, so seemed a good place to start the Python journey.

https://www.amazon.com.au/Trading-Evolved-Anyone-Killer-Strategies-ebook/dp/B07VDLX55H
 
I love that book. It happens to be one of first I read. I bought his others after I read that one.

Python is versitile. But one of the benefits is the ability to automate. It is also better when it comes to wider data analysis. Amibroker is great but it can't do a lot of indepth analysis like some quant python builds, nor can Amibroker do a wider portfolio analysis. Ambroker also lacks the API for completely automated trading which I eventually want to build to.
 
At the moment I don't have a sector filter (and i'm not sure how to implement one too).

You can use the following to play with when you have time and it will be interesting to see any change in your backtest results.

Code:
_SECTION_BEGIN("ASX200 Sector ID");
{
// Map the sector ID for this symbol to an index that represents the sector

SectorIndexID = sectorID( ); // 1 Retrieves current stock sector name, 0 retrieves number
 

switch(SectorIndexID)
{
    case 1: tkSector200 = "$XEJ"; break;        // ASX 200 Energy
    case 2: tkSector200 = "$XMJ"; break;        // ASX 200 Materials
    case 3: tkSector200 = "$XNJ"; break;        // Industrials
    case 4: tkSector200 = "$XDJ"; break;        // Consumer Discretionary
    case 5: tkSector200 = "$XSJ"; break;        // Consumer Staples
    case 6: tkSector200 = "$XHJ"; break;        // Health Care
    case 7: tkSector200 = "$XFJ"; break;        // Financials
    case 8: tkSector200 = "$XIJ"; break;        // Information Technology
    case 9: tkSector200 = "$XTJ"; break;        // Communication Services
    case 10: tkSector200 = "$XUJ"; break;        // Utilities
    case 11: tkSector200 = "$XRJ"; break;        // Real Estate
    default: tkSector200 = "$XAO"; break;
}

SectorIndex = Foreign(tkSector200,"C"); // Brings in sector index name XEJ, XMJ etc

/*
SectorIndexImported = ****** add your Filter test here *****;
*/

_SECTION_END();
}
 
Oh, I also forgot one thing from above with python. It's relatively easier to do machine learning in python too, making strategy research and exploration easy.

I realise not everyone wants to run multiple strategies that are automated, or run ML on financial data, but for those who are interested AB won't cut it.
 
Oh, I also forgot one thing from above with python. It's relatively easier to do machine learning in python too, making strategy research and exploration easy. I realise not everyone wants to run multiple strategies that are automated, or run ML on financial data, but for those who are interested AB won't cut it.

@Warr87 I wish to make a few comments for others reading the banter between you & @Newt about Python & AI.

Technical analysis
For a start technical analysis isn’t becoming obsolete for the average punter & Amibroker is not obsolete when compared to advancement in technology. Amibroker uses a “Decision Tree process” to find signals whereas AI uses the "Machine Learning process" to find signals. Trading is not an exact science but a mathematics game, a game of probabilities & not percentages. AI is great at finding static positions (see definition below) whereas the market are very fluid driven by rational people making irrational decisions & that's why there isn't mass take up at present. A supercomputer using AI would have no idea what my the next word is going to be let alone what I am thinking.

Systematic trading
Let's compare - A Trading strategy that uses a “Decision Tree process” finds conditions that have been pre-programmed into code, whereas AI find conditions then goes about looking for the reason that preceded that condition. (Simple difference but it's more than that)

AI advancements in medical research
"AI" is a godsend in medical research, it's the equivalent of a medical breakthrough for that industry.

Definition
Static positions for example can be a cancer cell or comparing genomes. Fluid position are constantly changing (decisions made by emotions)

Quoting Dr Howard Bandy
“The business of trading is changing with astonishing speed. It is now about applied mathematics, machine learning, Bayesian statistics. Traders without skills in math, programming, statistical analysis, and scientifically developed trading techniques are at a severe disadvantage"

Quoting Dr Tomasz Janeczko (Founder of Amibroker)
“In my opinion throwing more languages (like Python) into the mix just makes things harder, not easier, and is not really necessary as everything is doable within AmiBroker itself, but Howard Bandy and others have other opinion. People have tendency to think in terms "more = better". But the truth is that in programming less is more. And less is better. So don't add complexity when it is not needed”

Summary
Traditional trading system platforms as AmiBroker, TradeStation & NinjaTrader uses a decision tree model. AmiBroker, TradeStation & NinjaTrader the traditional platforms apply an indicator, then see what happens whereas Machine learning such Python identifies something important then see what came before it.

Skate.
 
If AB came with a server client that could run in the background and run auto tasks like running your AFL code, then submitting such code to your broker for auto execution, then you are right AB would be all that you need. I love AB and it is very powerful but can't do everything.
 
Week 15
Buy: MLX,WAF,RMS,PDN,PPH
Sell: none

5 positions, with 1 more in the market.

Index is up. 6 orders were placed, 5 have already been filled.

MSB remains open. I'm puzzled by this because there are plenty of buys and sellers in the market and yet nothing is being traded. I can't see any trading halts either. This isn't the first time this has happened.

Any ideas?


upload_2020-5-11_15-58-46.png

I have changed over to Norgate from Premium data. It was very easy and a seamless change. Looking forward to see how the python plugins work. In the meantime, AB has been setup to use Norgate.
 
I just ran my code against my new Norgate database in AB. It only brought up 1 buy instead of the 6 it should have. Any ideas? I changed my ticker for index to $XAO.au as this is the new convention, but I'm not sure what else I may be missing.

Ideas?

@Skate
 
I just ran my code against my new Norgate database in AB. It only brought up 1 buy instead of the 6 it should have. Any ideas? I changed my ticker for index to $XAO.au as this is the new convention, but I'm not sure what else I may be missing. Ideas? @Skate

@Warr87 check out thses ideas.

1. Make sure that "Pad & Align" has been selected.
2. Make sure the Index is selected ($XAO.au)

Pad & Align Capture.JPG

3. Make sure you have the correct data set select as they will be different to the previous format (make sure the suffix is displayed for your charts)

select Capture.JPG

4. Make sure the Norgate Data Plug-in is selected for the Data source.

Data source Capture.JPG

Hope this gets you out of trouble..

Skate.
 

Attachments

  • Pad & Align Capture.JPG
    Pad & Align Capture.JPG
    24.2 KB · Views: 5
Thanks Peter2. I noticed that after I had posted lol.

@Skate that didn't work. I did 'backtest' and that enters 6 positions so some how my explore code is now not correct. I will have to have a look at it later and see where I went wrong (or start again as its pretty sloppy).
 
Thanks Peter2. I noticed that after I had posted lol.

@Skate that didn't work. I did 'backtest' and that enters 6 positions so some how my explore code is now not correct. I will have to have a look at it later and see where I went wrong (or start again as its pretty sloppy).

Another quick check..
Did you change the: SetForeign( "$XAO" ); as it needs to reflect the Index of the new format ( "$XAO" ) to ( "$XAO.au" )

# Make sure your Index Filter reflect the the suffix.

//--------------------- Index Filter ---------------------//

Change -----------> SetForeign( "$XAO" ); -------------------> to ---------------> SetForeign( "$XAO.au" );

NEXT

Set the date from "1 Recent bar/ 1 recent date" to From-to-Date & have the start date 2 1/1/2020 & run explore.

IMPORTANT
You shouldn't have trade signals for today.

from to date Capture.JPG

Hope this helps...

Skate.
 
Last edited:
I did 'backtest' and that enters 6 positions so some how my explore code is now not correct.

Do you have a buy delay on the backtest? I am thinking that this might put your Backtest / Explore code out by the delay amount. I have seen this happen on a daily system, but not sure about your weekly setup.
 
@Warr87 I wish to make a few comments for others reading the banter between you & @Newt about Python & AI.

Technical analysis
For a start technical analysis isn’t becoming obsolete for the average punter & Amibroker is not obsolete when compared to advancement in technology. Amibroker uses a “Decision Tree process” to find signals whereas AI uses the "Machine Learning process" to find signals. Trading is not an exact science but a mathematics game, a game of probabilities & not percentages. AI is great at finding static positions (see definition below) whereas the market are very fluid driven by rational people making irrational decisions & that's why there isn't mass take up at present. A supercomputer using AI would have no idea what my the next word is going to be let alone what I am thinking.

Systematic trading
Let's compare - A Trading strategy that uses a “Decision Tree process” finds conditions that have been pre-programmed into code, whereas AI find conditions then goes about looking for the reason that preceded that condition. (Simple difference but it's more than that)

AI advancements in medical research
"AI" is a godsend in medical research, it's the equivalent of a medical breakthrough for that industry.

Definition
Static positions for example can be a cancer cell or comparing genomes. Fluid position are constantly changing (decisions made by emotions)

Quoting Dr Howard Bandy
“The business of trading is changing with astonishing speed. It is now about applied mathematics, machine learning, Bayesian statistics. Traders without skills in math, programming, statistical analysis, and scientifically developed trading techniques are at a severe disadvantage"

Quoting Dr Tomasz Janeczko (Founder of Amibroker)
“In my opinion throwing more languages (like Python) into the mix just makes things harder, not easier, and is not really necessary as everything is doable within AmiBroker itself, but Howard Bandy and others have other opinion. People have tendency to think in terms "more = better". But the truth is that in programming less is more. And less is better. So don't add complexity when it is not needed”

Summary
Traditional trading system platforms as AmiBroker, TradeStation & NinjaTrader uses a decision tree model. AmiBroker, TradeStation & NinjaTrader the traditional platforms apply an indicator, then see what happens whereas Machine learning such Python identifies something important then see what came before it.

Skate.

Good points Skate. As an amateur computer nerd, I can however always hide behind "hobby learning". Getting my hands dirty with a bit of Python may or may not work out like like learning, BASIC, Visual Basic, VB.NET, VBA, 6502 machine language, Arduino IDE and even a little C#. Each was usually a very useful tool and for opening my eyes to some new computer hardware, and it was rare they didn't pay valuable dividends for some work or hobby project along the way.

Too early to say if Python will be of any use with trading, but its increasing use as a data reduction tool in the sciences alone makes it a worthwhile thing to pursue. And there might even be a bit of fun along the way. Not planning to attempt any semi-sentient intraday algos anytime soon..... :)
 
@Trav. @Skate

Doing '1 recent bar' doesn't work, but if i put in 'from- to dates' it does.

I'm lost as to why lol.

1. Doing '1 recent bar' doesn't work - "Because there are no signals for today"

2. 'from- to dates' it does - "Because it looks back further than 1 day or 1 recent bar" - last signal is the 8/5/2020 that it picks up.

Skate.
 
Top