Australian (ASX) Stock Market Forum

P2: A batch of FX market trades

Create a portfolio of strategies with each strategy suited to a particular market condition (range bound, trend up, trending down). Create a market classification algo that defines the current market conditions and adjusts the amounts risked on each strategy (decreasing risk on unsuitable strategies, increasing risk on suitable strategies). Run portfolios on each time frame.

OR

Create a portfolio of strategies with each strategy suited to a particular market condition. Create an algo that monitors the recent results of each strategy and adjusts the amount risked (reducing the amounts risked in strategies that are currently losing, while increasing the amounts risked to those strategies that are winning). Run portfolios on each time frame.
 
the algo is run on different time frames simultaneously.

This is the key.

I've mentioned this article once before on ASF in @Modest 's futures thread. I'll post it again here because it planted the seed for the eventual path I went down. It's old code, there's better ways of doing it now, but the concept is the same.

http://www.amibroker.com/docs/MTFIndicators.html

It's an Amibroker document but we've coded it into our systems with Python. I haven't used EA's so not sure if it can be tested and applied in one.

An interesting line of thought. Thanks

Happy to help, you've posted so much interesting stuff over the years. Hopefully I can sow the seeds of an idea that can improve your returns.
 
Thanks for the article. I'll re-read a few times to stir my thoughts. The article proposes a MTF indicator that can be used in a single time frame chart and that the indicator is more responsive and provides earlier indications than the single time frame. I'll think about this some more and see if I can code an MTF indicator and whether I can code this into an EA to test in the FX markets.

I'd thought that your preferences @captain black were with intraday VSA based indicators, unless the charts you show are only a part of your overall trading activities.
 
I'd thought that your preferences @captain black were with intraday VSA based indicators

Wyckoff/VSA forms part of the entry and exit setup criteria. The MTF composites are used primarily to determine what type of market phase and therefore what risk management parameters to use.

The entry setup on the FESX chart last night has a higher probability of leading to a trending outcome rather than a swing trade so rather than looking to exit on the next distribution setup the system takes a more conservative "trend following" exit strategy.

That particular entry setup took several bars to form after the initial high volume reversal bar. There was a second high volume bar. The subsequent bars in that accumulation zone were in the medium-high spread range. Along with a few other inputs, these all gave a higher probability score to a trending trade than a swing or MR trade.

I'll just add that it's not about prediction, it's about probabilities.

As the trade developed, the probability we were in a strongly trending market increased so the trend following exit parameters were adjusted to allow more room to move and the position was added to in shallow pullbacks.

Each type of setup is tested individually, similar to how Thomas Bulkowski grades the pattern setups on his pattern site. As the probability of one particular outcome increases, the parameters are adjusted.

Individual setups (eg Wyckoff/VSA) contribute to this probability calculation as well as the MTF composites. So rather than setting the probability at the beginning of the trade, it's a dynamic process taking into account not only the initial risk but also the underlying market phase determined by the MTF composite.
 
Thanks for the article. I'll re-read a few times to stir my thoughts.

I've sent the article to a few people in the past and as far as I know no-one has found it particularly useful so you may find the same :)

I'm sure most people would read my "probability" post above as well and find it a load of waffle.

I mentioned @Boggo 's signature "Differently Think" in my futures thread earlier today. I know from past experience that it's the times I've been forced to "differently think" that I've had a few "a-ha" moments.

(If you read this @Boggo it's a great signature. The play on the common "think differently" phrase is ingenious)
 
@captain black Thank you for providing the additional context. Trading with probabilities is certainly not waffle as you know. It's the goal of all traders that want to be profitable. I'd rather buy a BO with a prob >0.8 than a BO with a prob of 0.5. You may or may not have noticed that all six intraday trades (US) that I posted last night were with the market or sector. I'll never trade a pattern on an intraday time frame without agreement with the sector and market. The probabilities of a successful trade are so much greater when everything is in alignment. Patterns on their own are 50:50, patterns with the sector are 70:30 and with the market 80:20. (*)

The context you added with the MTFs makes so much sense. I totally accept that trading the intraday VSA setups with the trend of the MTFs improves the probabilities greatly. I'm very grateful for this extra information. Your additional info has given me plenty to think about. My task now is to assimilate that info into a carefully thought out plan for research.

(*) AMD (semiconductor stock) was selected because it was the strongest semiconductor stock. The semiconductor index was chosen because it was the strongest sector and it's one of the largest components of the SPY. The AMD trade was started when the SPY was going up early in the morning. Strongest stock in the strongest sector when the market is going up, what is the probability of a successful trade? It's >95%. If anyone wants to trade equities intraday, understanding this is vital.
 
Thanks for your detailed reply again Pete.

I'll never trade a pattern on an intraday time frame without agreement with the sector and market. The probabilities of a successful trade are so much greater when everything is in alignment. Patterns on their own are 50:50, patterns with the sector are 70:30 and with the market 80:20.

A lot of discretionary traders talk about "overall context" when they take a trade which is pretty much what you describe above. What is happening in higher and lower timeframes, where is support and resistance, which sectors are outperforming etc. etc.

What we've tried to do over the last few years is to turn "overall context" from a discretionary decision into computer language that can be used to make decisions in an automated system.

Statistical analysis gets you so far and we're slowly integrating machine learning now to take us the next step.
 
AMD (semiconductor stock) was selected because it was the strongest semiconductor stock. The semiconductor index was chosen because it was the strongest sector and it's one of the largest components of the SPY. The AMD trade was started when the SPY was going up early in the morning. Strongest stock in the strongest sector when the market is going up, what is the probability of a successful trade? It's >95%. If anyone wants to trade equities intraday, understanding this is vital.

Another pearl of wisdom :xyxthumbs

While were on the subject of sector analysis and trading the strongest stocks in the strongest sectors I'll throw in this link from one of Joe Marwood's articles:

https://jbmarwood.com/simple-breakout-system-sector-filter/
 
Wyckoff/VSA forms part of the entry and exit setup criteria. The MTF composites are used primarily to determine what type of market phase and therefore what risk management parameters to use.

The entry setup on the FESX chart last night has a higher probability of leading to a trending outcome rather than a swing trade so rather than looking to exit on the next distribution setup the system takes a more conservative "trend following" exit strategy.

That particular entry setup took several bars to form after the initial high volume reversal bar. There was a second high volume bar. The subsequent bars in that accumulation zone were in the medium-high spread range. Along with a few other inputs, these all gave a higher probability score to a trending trade than a swing or MR trade.

I'll just add that it's not about prediction, it's about probabilities.

As the trade developed, the probability we were in a strongly trending market increased so the trend following exit parameters were adjusted to allow more room to move and the position was added to in shallow pullbacks.

Each type of setup is tested individually, similar to how Thomas Bulkowski grades the pattern setups on his pattern site. As the probability of one particular outcome increases, the parameters are adjusted.

Individual setups (eg Wyckoff/VSA) contribute to this probability calculation as well as the MTF composites. So rather than setting the probability at the beginning of the trade, it's a dynamic process taking into account not only the initial risk but also the underlying market phase determined by the MTF composite.

edit: when I read it over again it's actually quite do-able. Identify the type of market (one of three, based on a higher TF) and alter your size and exits accordingly. I have never attempted to define the type of market conditions in a system. Probably should try that, thanks.
 
Last edited:
Identify the type of market (one of three, based on a higher TF) and alter your size and exits accordingly.

We identify 4 types of markets in the system.

1/ Sideways (stand aside) (my mate has labelled it as "shitty" in the code. Who says coders don't have a sense of humour :))
2/ MR
3/ Swing (or momentum)
4/ Trending

Within each of those market types we assign a ranking from 1 - 10 so in effect were adjusting the system for 40 different market phases. Dealing with non-stationary data means the rankings are constantly changing.

(I guess standing aside for major news events is another market phase too.)

based on a higher TF

Hint:
Higher AND lower. We trade futures primarily on 1 and 2 - minute timeframes and look not only at the composite calculations in higher timeframes but also at what tick bar and range bar composites calculations tell us too.

alter your size and exits accordingly.

The idea of an "adaptive" type of system came to me when I was staring at the books in my bookshelf and one of the titles there is Radge's "Adaptive Analysis". The book is more based on traditional technical analysis but the word "adaptive" triggered one of those "a-ha" moments.
 
We identify 4 types of markets in the system.

1/ Sideways (stand aside) (my mate has labelled it as "shitty" in the code. Who says coders don't have a sense of humour :))
2/ MR
3/ Swing (or momentum)
4/ Trending

Within each of those market types we assign a ranking from 1 - 10 so in effect were adjusting the system for 40 different market phases. Dealing with non-stationary data means the rankings are constantly changing.

(I guess standing aside for major news events is another market phase too.)



Hint:
Higher AND lower. We trade futures primarily on 1 and 2 - minute timeframes and look not only at the composite calculations in higher timeframes but also at what tick bar and range bar composites calculations tell us too.



The idea of an "adaptive" type of system came to me when I was staring at the books in my bookshelf and one of the titles there is Radge's "Adaptive Analysis". The book is more based on traditional technical analysis but the word "adaptive" triggered one of those "a-ha" moments.

40 market phases....yowsers. I can't imagine how you'd rank them without sampling a lot of historical trades, but maybe that's what you're doing. Most coders are serious AF, so you found a good one!
 
This is where our machine learning code is being tested at the moment. Calculating the timeframe composites and "learning" as new data comes in.

I imagine something like the following: Be ready to trade in the direction of the higher TF (aka 'context'), but trade the equity curve of the 1 min TF, and assign the 10 layers of rank according to the 1 min equity curve.
 
I imagine something like the following: Be ready to trade in the direction of the higher TF (aka 'context')

One of the elements is the composite calculation of the higher timeframes but it's only a small part of a number of variables.

trade the equity curve of the 1 min TF

We don't reference the equity curve in any of the code apart from the "kill switch" if things turn to poo. ;)
 
Thanks. I do the same thing. Manually/discretionally. If a market has not broken out of a range I avoid it and find a market that has and trade it using a pull-back or BO-NH setups to join the trend.

You're suggesting that I start the algo by classifying the current market conditions first then select the most suitable trading strategy for those conditions. If the conditions remain the same the algo trades profitably until the market changes, the algo has a few losses, recognizes the changed conditions then switches to a more suitable strategy.

In your case rather than switch strategies, the algo adjusts the risk management of the strategies when the market conditions change (decreasing risk for the unsuitable strategy and increasing the risk for the suitable strategy). ie All your strategies are running continuously and the algo monitoring the current market conditions modifies the trade risk, increasing the risk for the most suitable strategies and decreasing the risk for the unsuitable strategies.

Classify current market condition (range bound, trending up, trending down)
IF range bound . . . THEN use mean reversion strategy
IF trending UP . . . THEN use PB, BO-NH buy strategies
IF trending DOWN . . . THEN use retracement, BO-NL sell strategies

The difficulty of classifying the current market conditions is that the market conditions may be different in different time frames. Although if the algo does this consistently well, the algo is run on different time frames simultaneously.

An interesting line of thought. Thanks

Peter,

Personally, I have found using an ADX filter for trending systems is quite a simple and effective component. I.e. Trending if above >=25 or ranging if below. Then decide if you want to pause trading or switch to another system.

You can use one bot, which switches between the two modes, which can be easier for backtesting and testing drawdown.

Obviously, you can use two or more bots for different conditions.

Interestingly, standard risk reward ratios, such as 1:1, 1:2, are not always the way to go. I have had and continue to have good results with reversed ratios as well.
 
Wyckoff/VSA forms part of the entry and exit setup criteria. The MTF composites are used primarily to determine what type of market phase and therefore what risk management parameters to use.

The entry setup on the FESX chart last night has a higher probability of leading to a trending outcome rather than a swing trade so rather than looking to exit on the next distribution setup the system takes a more conservative "trend following" exit strategy.

That particular entry setup took several bars to form after the initial high volume reversal bar. There was a second high volume bar. The subsequent bars in that accumulation zone were in the medium-high spread range. Along with a few other inputs, these all gave a higher probability score to a trending trade than a swing or MR trade.

I'll just add that it's not about prediction, it's about probabilities.

As the trade developed, the probability we were in a strongly trending market increased so the trend following exit parameters were adjusted to allow more room to move and the position was added to in shallow pullbacks.

Each type of setup is tested individually, similar to how Thomas Bulkowski grades the pattern setups on his pattern site. As the probability of one particular outcome increases, the parameters are adjusted.

Individual setups (eg Wyckoff/VSA) contribute to this probability calculation as well as the MTF composites. So rather than setting the probability at the beginning of the trade, it's a dynamic process taking into account not only the initial risk but also the underlying market phase determined by the MTF composite.

I Like your approach here Captain Black,

You have given me some interesting ideas, thanks.

I have started focusing more on probability on my systems, and definitely do not think it is waffle.

Increasing trade volume on low risk setups, decreasing on high risk. Looking for repeatable patterns that occur during different trading session (Tokyo, London, US, etc)
 
I Like your approach here Captain Black,

You have given me some interesting ideas, thanks.

My pleasure, and thank you for taking the time to comment. It's heartening to know that a few of my ideas have resonated with other traders.

Increasing trade volume on low risk setups, decreasing on high risk.

Position sizing is another component that we're constantly working on. Often with discretionary trading we get a feel for a position and market action and know instinctively when to increase or decrease our position size. It's another part of reading the overall context of the market.

One of the factors we're still tweaking is position sizing during the transition from (for example) the MR phase to the swing/momentum phase. If there is a high probability setup early in the phase changeover do we take a large position or wait until "x" number of bars confirm the changeover. Currently we use a 1 - 10 scale to measure the strength of the new phase compared to the previous phase and switch to full position sizing once the new phase strength is greater than the old but I think there's better ways of doing it.

I'm off to the Grampians for a week of walking in a couple of days, think I might need to sit on top of a mountain and contemplate for a while :)
 
Re-read this thread last night, lots of great trading advice here.

Peter, what do you think of this AUD/USD buy on the 4hr chart. Price is sitting on daily 200 moving average at the moment. So could see a push above soon. There is supply at 1 R, but I think it is worth the risk.

cT_cs_1028462_AUDUSD_2020-05-28_10-14-00.png
 
Top