# Potential swing trades



## markrmau (3 February 2007)

Just interested in potential swing trades (mixed with a bit of my gut feeling) and would like to see if we can get a positive expectancy. I am not currently trading this system.

Trade 1. Short BHP on mondays open.


----------



## albi000 (4 February 2007)

I've posted a handful of swing trade setups on my blog Market Ninja.  Still investigating the system but it uses what is called the Traders Action Zone (TAZ) which looks for a specific pattern between the 10SMA and 30EMA.


----------



## CanOz (4 February 2007)

markrmau said:
			
		

> Just interested in potential swing trades (mixed with a bit of my gut feeling) and would like to see if we can get a positive expectancy. I am not currently trading this system.
> 
> Trade 1. Short BHP on mondays open.




So how much of a retrace are you expecting? Personally i can't see it hitting my stop at 23.99 anytime soon. With recent events on the LME we may see a decline but i can't see it lasting.

Cheers,


----------



## alankew (4 February 2007)

Mark are you expecting/hopefull that it will get down to the $24.50 level


----------



## markrmau (5 February 2007)

Obviously with the carnage on the lme, bhp will drop today. It's hard to put a downside target on bhp as it really depends on what metals do.

2 risks as I see it.

1. Metals rebound sharply after friday's sell of - close position.
2. bhp has better than expected results this week. I actually think the results will disappoint though.

I would put a tight stop on though - around fridays close or slightly higher.


----------



## markrmau (8 February 2007)

Clearly I got BHP wrong.


----------



## Magdoran (10 February 2007)

markrmau said:
			
		

> Just interested in potential swing trades (mixed with a bit of my gut feeling) and would like to see if we can get a positive expectancy. I am not currently trading this system.
> 
> Trade 1. Short BHP on mondays open.



Hello markrmau,


I salute your courage in posting your forecast, and accept that you actually made a call in advance to the best of your abilities, and that commenting on this later is far easier in hindsight, so please do not take my comments as criticism post the event, but sharing some ideas as a basis for discussion which I hope may provide alternative ideas for you to consider.

Playing the short side is an art.  BHP was a tough call to make in the current situation, swing trading technically (using fundamentals, and long term approaches are a different game altogether).  

I did have a time and price lock on it for a while (and RIO), but there are times wave structure, time and price methods, and straight technical analysis is difficult to use in situations like this.  I do see a dominant cycle in BHP, and your post when you said you’d short BHP spun my head around, since I thought a swing/position trade short was highly risky given the work I’d done on it.

03 Feb was a minor increment in my system, and would have indicated support in time the way BHP traded into it.  If it traded up, your call would have made more sense to me.  But the price action on the day, and the previous higher lows from a key increment in time for both the major low, and the higher low yielded a bullish probability to me.  But I didn’t trade this, oddly my analysis was for RIO to be the better pick, so I got this wrong too.  I certainly wasn’t expecting the significant gap up that occurred.

To me this is still bullish, and expect BHP to reach one of the price targets around 23rd Feb ($32, 30.16, 31.07, 29.54).  But there are contingencies for this.  BHP may try to close the gap before resuming bullishly.

Your idea to short may come to fruition on the 23rd, but I didn’t see any lower highs, and obvious resistance in cycles, or in price from the way I look at charts to warrant a high probability short as suggested for 03 Feb.  Sure, BHP in the daily is in a downtrend, but in the weekly it’s still in an uptrend (depending on your T/A of course).

Out of interest what was your method?  The chart showed a major low, and higher lows, despite oil and metal prices… What was your rationale for this?

The big move down may come however, especially if the ASX tops around 24th Feb (or 1st April).  This seems to be a key day to me.  If the market pulls back hard from a high or false break around here, I think this could be significant.  It is of course possible for pitch to keep on moving strongly bullishly, and if this is the case, all short bets are on hold again.  But a lower high from a major high on the 24th Feb would signal the start of a strong bearish attempt to me…

I hope this comment and the attached chart are of interest…  I especially marked up the chart to illustrate the point as simply as I could.  Hope it makes sense…


Kind Regards


Magdoran


----------



## Magdoran (10 February 2007)

Please, only read this if you are really interested in the finer points of this style of analysis…

I’ve been doing some research on this type of pattern, and I should explain a few things to clarify how I see the probabilities of how BHP may pan out from a position/swing trading perspective.

There are several caveats to consider here from the expected outcome:

Firstly, this type of pattern can behave differently when other cycles are in play, and occasionally truncate the underlying dominant cycle.  This just means taking partial profits is a tactic which can be beneficial to reduce risk and lock in profits at points of risk (especially if using leverage), and recognising where these patterns may end prematurely in time, and price.  

In this case there is a reasonable chance of a high coming in on the 11 Feb (reads Friday 09 Feb or Monday 12 Feb), or 20 Feb is an alternative fail point.  This is based on two different cycles running concurrently through the underlying, and the phasing of the different cycles can effect the price action, hence I’m outlining where the expected main forecast has a probability of failing, and why, so it can be recognised quickly, and appropriate action taken (like winding out a position, or taking partial profits, or hedging in some manner).

There is also a rule I have for this exact pattern of resistance at a key price extension derived from key highs and lows in this pattern.  This yields $29.77 (and perhaps ranging up around $29.95) as a potential fail point for a bullish drive should it continue.  (There is a secondary and less reliable extension using micro extensions in the actual drive from the 08 Jan swing low – this yields $29.40 as a potential top – but this is much less reliable and I’m still evaluating this approach).

Secondly, the price action, and the pattern is central to evaluating entries and exits from this part of the drive.  A long was signalled after 18th Jan using this approach which confirmed the 08 Jan swing low as a significant tradeable swing reversal.

Going long from this point or on a pull back becomes increasingly risky as the 23 Feb is approached.  The price action with multiple higher lows and a bullish gap is currently bullish in the daily chart.  But there may be an attempt to close the gap. If this occurs, and the attempt to fill the gap fails, this may present a long opportunity.

If the 28.31 - 28.33 resistance is broken and held (layer on it even better), this may also present a short term bullish opportunity.

Finally, any long initiated here, if swing trading, is quite risky.  So profit taking (especially if a position doubles) is critical.  I wouldn’t be holding a full position after 23 Feb because of the risk – if it spikes up bullishly, then a partial position may well succeed…

This bullish price action may also cease from this point, having hit key resistance, and hit a miscellaneous time point (this odd time truncation is really obscure, and took me a long time researching to figure out, but a fair percentage of this pattern type fails here).  The price action in this case is so strong though that I give this a low probability of occurring, but I always recognise “anything can happen” in the market (Ala Douglas).

I hope that clarifies the fine detail for those who are interested, but as you can see, this style of T/A is very intricate, and I find it difficult to explain all the detail.


Regards,


Magdoran


----------



## tech/a (10 February 2007)

Moggie.

Without confusing things with my analysis.(VSA Volume Spread Analysis) and just for interest.
BHP is at a crossroad. Conflicting short term signals.
The last day is bullish low volume testing the high means little or no selling supply.The 2 previous days Thursday sees supply with sellers winning the day.
Wednesday saw a huge day with heaps of volume taking all sellers.

The longer term trend is down.I expect the market to test the channel to the downside but its really up to Monday to disclose the markets intention.

Longer term I think is positive---shorter term negative unless we see supply being absorbed in tighter ranges or demand overwhelming supply.

I would personally not be taking a position until this is clear.But short term leaning toward a retracement and re test.


----------



## Magdoran (10 February 2007)

tech/a said:
			
		

> Moggie.
> 
> Without confusing things with my analysis.(VSA Volume Spread Analysis) and just for interest.
> BHP is at a crossroad. Conflicting short term signals.
> ...



Hello daffy,


You may well be right.  I do think BHP should retest the 08 Feb low.  I expect the gap to be tested, but if it can hold, would see a bullish drive may end the move, then a more major retest post 23 Feb.  Price action is the key to trading this long if the pattern plays out.

Another scenario is that BHP moves directly DOWN into 24 Feb from here, entirely possible with the 11 Feb termination/truncation of the cycle…  Then this would become support in time, not resistance.

I suspect a brief bullish drive is more likely, if the window/gap is not closed, and a higher low can hold on a pull back.  But I do view any bullish activity as a COUNTER TREND to the current bearish activity, and not the other way.  I need more evidence to determine if the bullish trend has resumed, which currently I don’t think it has.

If the key resistance is broken there is also a possibility of a strong bullish push.  If this eventuates, I think in the longer term this is likely to be exhaustive, and the way the bearish response pans out will tell us a lot about what is happening with the trend.  A shallow bearish response would be bullish.

Post 24th Feb, I suspect we’re in for some kind of correction across the board in the XAO.  But there is a possibility of a very strong exhaustive move up to end the bullish drive, and perhaps the entire 2003 onwards campaign.  Hence I see a potential major correction in the wings.  The possible collapse of the commodity markets does look possible in the charts. (so there is a chance of pitch overcoming the Feb 24 time target).

A lot will depend on how the price action pans out in the next couple of weeks.  A lot of “ducks” are lining up (the EW term would be confluence).  I’m not the only one seeing this either…

So, does that line up with what you’re seeing?


Regards,


Magdoran


----------



## Magdoran (10 February 2007)

tech/a said:
			
		

> BHP is at a crossroad. Conflicting short term signals.
> The last day is bullish low volume testing the high means little or no selling supply.The 2 previous days Thursday sees supply with sellers winning the day.
> Wednesday saw a huge day with heaps of volume taking all sellers.



This is harder than it looks to flesh out and make clear, isn’t it?

Yes, there are ambiguities, and agree it’s at the crossroads.



			
				Magdoran said:
			
		

> This bullish price action may also cease from this point, having hit key resistance, and hit a miscellaneous time point (this odd time truncation is really obscure, and took me a long time researching to figure out, but a fair percentage of this pattern type fails here).




I do see a scenario where this is a top, and say a gap down happens, you could get a kind of island reversal here...

The commodity markets have taken a beating over the last few months.  If oil and many of the metals continue down, I can conceive of a scenario where a rout happens if a panic move gets going...  I think this is a very real possibility.

The question is, is there enough new money coming in from regular superannuation payments, as well as overseas investment, as well as investment funds in general to keep the bull market going?

If you look at the cycles in the weekly, between the 20th-24th Feb there is a “confluence” in time and price coming up...  either I’m totally getting this wrong, or a bearish move of some sort occurs around this time.  

My guess is an exhaustive bullish blow off into a high...  but it could distribute up to this point and give a false break too, that’d be my second guess.  If not these two, then my third guess would be we may see a crazy bullish drive which catches all the pessimists by surprise.  The least likely of 4 scenarios is business as usual, as it has been going.  If that happens, I will need to totally reassess my projections as the price action unfolds.  It is possible for an extension in time to April 1, which is the next critical time I can see...

I think I need a holiday!


Mag


----------



## tech/a (11 February 2007)

Really depend on your timeframe,Moggi.

Short term --- blowoff--- so Mark was a little early.
Longer term bullish so could be seen as a cheap time to buy in on the pull back for long term holds.


----------



## Magdoran (11 February 2007)

tech/a said:
			
		

> Really depend on your timeframe,Moggi.
> 
> Short term --- blowoff--- so Mark was a little early.
> Longer term bullish so could be seen as a cheap time to buy in on the pull back for long term holds.



Yes, Daffy,


Absolutely, different time frames are at work.  I’m not sure if BHP is long term bullish or not (and which “long term” are we talking about???).  A lot will depend on how the commodity markets pan out in say the next 3 months, and then how they recover if they pull back over the next 6 months to a year (that’s long enough in the future for me!).  I have a suspicion that the economic slow down in the US may have a (negative?) mid term impact on commodities and commodity based stocks.

Also, the XAO/XJO are looking tired, and XMJ looks like it may rally up to a lower high and may retest (and even surpass) the current major low.

Looking at BHP in the weekly chart, wavepicker and I were discussing this at length, and painted a scenario where BHP continues bullishly very briefly, then pulls back to test the low.  Where support comes in if this is the case will tell us a lot about potential time and price patterns and EW structure.

But my instinct is that there will be an attempt in the very short term to close that bullish gap.  I suspect the bears won’t be able to do it, and the time for a limited long is on a higher low… but there is some risk of course.  

A high that becomes a lower high to the existing major high may be bearish, and this whole move up may have been a counter trend to a bearish move… could also be the start of a bullish resumption… either way the pattern will give plenty of swing trading opportunities, but in each case I’d be gingerly taking profits since the market in this area is so volatile (I don’t know how people with large long term positions can stand the strong swings, and can tolerate the huge risks involved – they must have a very long term view, and really discount the possibility of an ’87 style crash).

Suspect some sort of pull back Monday based on the Friday night market action in commodities and indexes.  Then a bullish attempt.  The price and time increments are there, just have to interpret the price action within this playing field.


Regards,


Magdoran


----------



## Kauri (11 February 2007)

I was looking for a quick short on thurs but fridays inside bar coupled with the low RR has me as an observer now. Plus I don't generally like shorter time frame trades due to the gappiness that comes with ADR's.


----------



## tech/a (11 February 2007)

Pretty right I think *Kauri*---even if this current possible wave 1 is not quite complete.
Will know tommorow but think its pretty well done.

*Moggi * interesting to see where the different types of analysis intersect.
Bit of Gann,VSA and Elliot.


----------



## Gringotts Bank (18 January 2013)

SYD at $3.01.  Would match up with its large Aug 2011 swing in size and time, making it a low risk entry.


----------



## Gringotts Bank (21 February 2013)

Gringotts Bank said:


> SYD at $3.01.  Would match up with its large Aug 2011 swing in size and time, making it a low risk entry.




Toot toot.

Some new ones I like:

NST at current price
RED at 80c
RDF at current price
CXU at current price
BLY at approx 1.66
PVM at 57c


----------



## Gringotts Bank (21 February 2013)

RSG at 1.17 
EVN at current price
OGC at 2.02
NCM at 20.20


----------



## DJG (22 February 2013)

How do you guys find potential swing trade setups, do you use a screener?
If so, what kind of criteria do you had to it in order to get a small enough sample of potential lows/highs (depending if you're shorting or not) at swing points?

Always been curious over this.

I look at your recent recommendations, I do like them.
I was pissed off when I didn't get the break through resistance of CCL, it was such a easy picking as well I thought.

Thanks,


----------



## Gringotts Bank (22 February 2013)

DJG said:


> How do you guys find potential swing trade setups, do you use a screener?
> If so, what kind of criteria do you had to it in order to get a small enough sample of potential lows/highs (depending if you're shorting or not) at swing points?
> 
> Always been curious over this.
> ...




I look at the downwards legs back through a stock's history and get a feel for how far and how fast it can move from the most recent high pivot.  Amibroker does most of this for me, but you can just eyeball it.  Plot some pivot points on your chart.  I like a stock to be ranging or in a long term uptrend - this ensures the nest swing up will be of decent size.

CCL was a very good candidate for a swing trade over the last few months.


----------



## DJG (22 February 2013)

Gringotts Bank said:


> I look at the downwards legs back through a stock's history and get a feel for how far and how fast it can move from the most recent high pivot.  Amibroker does most of this for me, but you can just eyeball it.  Plot some pivot points on your chart.  I like a stock to be ranging or in a long term uptrend - this ensures the nest swing up will be of decent size.
> 
> CCL was a very good candidate for a swing trade over the last few months.





Yeah wasn't bad aye!

So you don't actually use much in the way of software screeners instead just look through charts and until you like what you see?
Where do you start?


----------



## CanOz (23 February 2013)

Two guys that i subscribe to eyeball the charts, hundreds at a time sometimes...

Yup, eyeball....
	

		
			
		

		
	




With Amibroker you just keep hitting the down arrow key while on the symbols (watch-lists are good)

You'll be surprised how many patterns you'll pick up.

CanOz


----------



## howardbandy (23 February 2013)

Or -- You can use a system.  

Swing trades are often mean reversion trades.  Here is an example:
http://www.blueowlpress.com/WordPress/trading-systems/mean-reversion-based-on-rsi/

Regards,
Howard


----------



## Gringotts Bank (23 February 2013)

DJG said:


> Yeah wasn't bad aye!
> 
> So you don't actually use much in the way of software screeners instead just look through charts and until you like what you see?
> Where do you start?




Any software will allow you to screen for say 20 day ROC, and you just rank them according to biggest losers.  Add a condition of daily turnover of say >$1mill.  Then set up your screen with either Fib retracements, pivots or zig-zag.  I'm in the process of creating an automatic "buy zone" for each stock which is based on likely retracement levels.  Then just setting conditional orders for the ones I like.


----------



## Gringotts Bank (23 February 2013)

Something like this helps to visualize swings.  This is CCL.


----------



## DJG (23 February 2013)

Thanks for the information guys, I should really get Amibroker setup properly. I really like the charting it offers but for some reason I can never get all the data in it. I gave up asking the Ami customer service, they explained it a bit but just went over what they already said and it didn't help much.
I've got all the companies, however I have no price data on each.

I should also probably pay for the full version to get intraday, EOD etc.. the lot.

Any help is appreciated.

Thanks,
Dan


----------



## CanOz (23 February 2013)

DJG said:


> Thanks for the information guys, I should really get Amibroker setup properly. I really like the charting it offers but for some reason I can never get all the data in it. I gave up asking the Ami customer service, they explained it a bit but just went over what they already said and it didn't help much.
> I've got all the companies, however I have no price data on each.
> 
> I should also probably pay for the full version to get intraday, EOD etc.. the lot.
> ...




The no hassle way to get this done is by subscribing to Premium Data. Its so easy to setup and maintain. I have been a subscriber for years on and off. Their service is great, they're Australian...Simple, easy to follow instruction on how to setup.

No hassle, no headache, just good quality data installed in Amibroker easily.

www.premiumdata.net

CanOz


----------



## tech/a (23 February 2013)

Howard.

I think it important to point out your disclosure here.

_The beginning and ending dates are chosen intentionally so that the period has very little net price change. SPY closed at 126.31 on 1/28/1999, and closed at 126.66 on 10/31/2011._

Perfect for displaying the benefit of trading a Mean Reversion System V a Trend Following system when conditions are best suited to a Mean Reversion System and of course Visa Versa.

Unfortunately we dont have the benefit of hindsight selection when trading the future!
Application of the very same system trading forward over a 10 yr period in a screaming bull or bear run in all likely hood wont produce anywhere near the same excellent results for a Mean Reversion system.

Having said that 
Your book is in my personal view TIMELY as the likely hood of a ranging market V a long term trending market for the next 5-10 yrs is high on the longer term time scale.


----------



## captain black (23 February 2013)

DJG said:


> Thanks for the information guys, I should really get Amibroker setup properly. I really like the charting it offers but for some reason I can never get all the data in it. I gave up asking the Ami customer service, they explained it a bit but just went over what they already said and it didn't help much.
> I've got all the companies, however I have no price data on each.
> 
> I should also probably pay for the full version to get intraday, EOD etc.. the lot.
> ...




G'day Dan, I mentioned Amibroker in the PM I sent you before I spotted your post here. A +1 to what CanOz said regarding PremiumData, everything is there to make the setup as simple as possible. There's an Amibroker FAQ thread on the forum here too with plenty of helpful people around to get you up and running. Happy to take any PM's too if you run into trouble.

Cheers
Steve


----------



## captain black (23 February 2013)

I should add that I don't use Premium Data personally as I've had a good setup with JustData for many years and have my own scripts I use for sorting their ASCII data but for someone starting out I'd recommend PremiumData as the easy data solution for Amibroker after seeing first hand other people's setups with it.


----------



## Gringotts Bank (23 February 2013)

DJG said:


> Thanks for the information guys, I should really get Amibroker setup properly. I really like the charting it offers but for some reason I can never get all the data in it. I gave up asking the Ami customer service, they explained it a bit but just went over what they already said and it didn't help much.
> I've got all the companies, however I have no price data on each.
> 
> I should also probably pay for the full version to get intraday, EOD etc.. the lot.
> ...




See "How do I..." thread.


----------



## DJG (24 February 2013)

CanOz said:


> The no hassle way to get this done is by subscribing to Premium Data. Its so easy to setup and maintain. I have been a subscriber for years on and off. Their service is great, they're Australian...Simple, easy to follow instruction on how to setup.
> 
> No hassle, no headache, just good quality data installed in Amibroker easily.
> 
> ...




Yeah I might have to give there 3 week trial a crack and see how it goes. What have you paid for on it? A quick look shows you can select different 



Gringotts Bank said:


> See "How do I..." thread.




Just about to reply and PM you now..


----------



## CanOz (24 February 2013)

DJG said:


> Yeah I might have to give there 3 week trial a crack and see how it goes. What have you paid for on it?




Futures, ASX and US stocks, forex.

CanOz


----------



## DJG (24 February 2013)

CanOz said:


> Futures, ASX and US stocks, forex.
> 
> 
> CanOz




And that's a monthly fee?


Re: Screening for swing trades, could a price touching the 30 (RSI) and moving up be a potential criteria for a screen? Also, touching the 70 and moving down if you were shorting?

Only problem I though with this was its after the entry and pivot point has happened. Is eyeballing really the best way?


----------



## CanOz (25 February 2013)

DJG said:


> And that's a monthly fee?
> 
> 
> Re: Screening for swing trades, could a price touching the 30 (RSI) and moving up be a potential criteria for a screen? Also, touching the 70 and moving down if you were shorting?
> ...




Actually i paid all up front for 6 months plus i bought the history, originally.

You can use indicators to narrow down the search sure. MACD crosses or Stoc divergence are good screens too. Plenty of free code on the Amibroker forum for these things.

When i traded stocks EOD discretionary for a couple of years i used some of Nick's picks as well as some of my own screening picks. I would narrow them down with the screens and then eyeball them for support/resistance and volume.

Cheers,


CanOZ


----------



## DJG (25 February 2013)

CanOz said:


> Actually i paid all up front for 6 months plus i bought the history, originally.
> 
> You can use indicators to narrow down the search sure. MACD crosses or Stoc divergence are good screens too. Plenty of free code on the Amibroker forum for these things.
> 
> ...




Ah nice, I may have to look into it all then and get a good grip with those few criteria.
What sort of criteria were you setting with the MACD cross-overs and Stoc Divergences'?

Thanks mate


----------



## CanOz (25 February 2013)

DJG said:


> Ah nice, I may have to look into it all then and get a good grip with those few criteria.
> What sort of criteria were you setting with the MACD cross-overs and Stoc Divergences'?
> 
> Thanks mate




Here's a triangle scan...i've got heaps of these things.


```
// Triangle search Extended

/*This scan/exploration extends the triangle search by Graham Kavanagh
The original scans for triangles using Highest High AND Lowest Low over a 20 bar period,
 then next High over a chosen period after these HHV AND LLV. He requires the order of the 
highs AND lows are to be in alternate order and his test will pick up ascending, descending
 AND equal triangles. His 'variable' d1 (set to 20)is the number of days to lookback and search 
for the last Highest High, AND d2 is the gap after this HH to start searching for the next HH
 after the first. Similarly for the Lowest lows
The variables z? represent the highs, AND w? the lows.

This extended program adds a number of options,as follows:-
a. It automatically searches over different lookback periods between d1max and d1min, set to
60 and 20 (but easily changed) and records all succeses. Because of the nature of triangles,a 
single value for d1 can miss many valid cases.
b. Where the triangle criteria are satisfied on successive days, only the last of these is retained
in order to reduce the amount of output.
c. The user can toggle between searches based on the data H and L, or the highs and lows of the candle body.
d. The lengthy test to yield a "buy" in the original has been broken down into 7 separate conditions, 
allowing the user to easily change the conditions. Thus, Condition 3 tests for the triangle shape. This can
use a more liberal test via the parameter toggle that has been added. Similarly, Cond5 is a volume test which
can now be left in or excluded.
Finally, the user should note that conds 6 and 7 test that the general price trend is up. If interested in
potential downward moves, a user might want to delete these from the "buying" test.
*/

d1max = 60;
d1min = 20;
Buy = 0;


for (d1=d1min;d1<d1max;d1++)
{
d2=4;
Hi = H;
Lo = L;
Body = ParamToggle("Use candle body rather than H & L","No|Yes",  0);
if(Body == 1)
{
Hi = Max(O,C);
Lo = Min(O,C);
}
z1=HHV(Hi,d1);
za1=HHVBars(Hi,d1);
zb1=za1-d2;
z2=HHV(Hi,zb1);
za2=HHVBars(Hi,zb1);
w1=LLV(Lo,d1);
wa1=LLVBars(Lo,d1);
wb1=wa1-d2;
w2=LLV(Lo,wb1);
wa2=LLVBars(Lo,wb1);

aa1=LastValue(Hi);
aa2=LastValue(Lo);

C3 = ParamToggle("Use a more liberal triangle shape test?", "No|Yes",0);
ExVol = ParamToggle("Exclude volume test?","No|Yes",0);

Cond1 = ((z1>=z2 AND w2>w1) OR(z1>z2 AND w2>=w1));//Allows for horizontal top or bottom
Cond2 = za1>za2 AND wa1>wa2;//Automatically satisfied if za1,za2,wa1 and wa2 all exist
//Cond3 ensures triangle shape
Cond3 =((za1>wa1 AND wa1>za2 AND za2>wa2) OR (wa1>za1 AND za1>wa2 AND wa2>za2)) ;//Original
if(C3 == 1)
Cond3 =((za1>wa1 AND wa1>za2) OR (wa1>za1 AND za1>wa2)) ;//a more liberal test

Cond4 = aa1<z2 AND aa2>w2 ;// Triangle shape continues to last Value

Cond5 = Ref(Volume,-za1) > MA(Volume,d2);
if(ExVol == 1) Cond5 =1; 
//Conditions 6 & 7 require close price trend to be up
Cond6 = Ref(MA(Close,d1),-za1) > Ref(MA(Close,d1),-2*za1) ;
Cond7= MA(Close,d1) > Ref(MA(Close,d1),-2*za1); 
Buying = Cond1 AND Cond2 AND Cond3 AND Cond4 AND Cond5 AND Cond6 AND Cond7;
Buy = Buy + Buying;
}
for(i=1;i<BarCount;i++)
if(Buy[i]>=1)
{
Buy[i-1]=0;
Buy[i] = 1;
}
//Retain only the last of consecutive buy signals

Filter=Buy;
/*
NumColumns = 8;

Column0 = z1;
Column1 = z2;
Column2 = w1;
Column3 = w2;
Column4 = za1;
Column5 = za2;
Column6 = wa1;
Column7 = wa2;
*/

NumColumns = 8;
Column0 = Cond1;
Column1 = Cond2;
Column2 = Cond3;
Column3 = Cond4;
Column4 = Cond5;
Column5 = Cond6;
Column6 = Cond7;
Column7 = Buy;
```

Heres the MACD Stoc Scan...Exploration i believe...


```
/* SWING- TRADING*/
global O, H, L, C;
	O1 = Ref(O,-1);O2 = Ref(O,-2);
	H1 = Ref(H,-1);H2 = Ref(H,-2);
	L1 = Ref(L,-1);L2 = Ref(L,-2);
	C1 = Ref(C,-1);C2 = Ref(C,-2);

Cond1 = Cross( MACD( 12, 26 ), Signal( 12, 26, 9 ) ) <=3OR MACD( 12, 26 ) > 0.5 AND ( MACD( 12, 26 )>Signal( 12, 26, 9 ) ) ;
Cond2 =RSIa( Close, 9 ) > 40  ;

Cond3=Cross( StochK( 14, 3 ), StochD( 14, 3, 3 ) ) OR(StochK( 14, 3 ) > ( StochD( 14, 3, 3 ) )) OR ( StochK( 14, 3 )>25) ;
Cond4 = ( Cross( PDI(), MDI() ) ) OR( Cross( PDI(), ADX( 14 ) ) )AND ( PDI()> MDI() ) AND ( PDI()> ADX( 14 )) ; 

Cond5=ROC( Close, 10) > 0.5;
Cond6=  CCIa( Close, 14 ) > 50;
Cond7= ((C>O) AND
((C-O)/(.001+H-L)>.6)) OR
 (C>O AND H==C AND
O==L) OR
 (C>O AND
C==H)OR
 (C>O AND
O==L)  OR ((O1>C1) AND
(C>O) AND (C>= O1) AND (C1>= O) AND ((C-O)>(O1-C1))) OR 
GapUp()OR ((O1>C1) AND (C>O)
AND (C<= O1) AND (C1<= O) AND ((C-O)<(O1-C1)))
OR ((O2>C2)
AND (C1>O1) AND (C1<= O2) AND (C2<= O1) AND ((C1-O1)<(O2-C2)) AND (C>O) AND
(C>C1) AND (O>O1))OR 
 ((C1<O1) AND
(((O1+C1)/2)<C) AND (O<C) AND (O<C1) AND (C<O1) AND
((C-O)/(.001+(H-L))>0.6)) ;



Buy=Cond1 AND Cond2 AND Cond3 AND Cond4 AND Cond5 AND Cond6 AND Cond7;


/*
The MACD crosses below the Signal on or after the previous 3 bars */

Cond10 = ( Cross( Signal( 12, 26, 9 ), MACD( 12, 26 ) ) )OR
   MACD( 12, 26 ) > Ref( Signal( 12, 26, 9 ) * -2, -1 );
Cond11=  Cross( StochD( 14, 3, 3 ), StochK( 14, 3 ) );
/*Cond12=Cross( ADX( 14 ), PDI() )OR  Cross( MDI(), PDI() ) OR Cross( MDI(), ADX( 14 ) )OR( (PDI()>MDI()) OR (PDI()>ADX(14)))OR MDI()<ADX( 14 ) >PDI() ;*/
Cond13 = ROC( Close, 10 ) < 25  AND RSIa( Close, 14 ) < 70 AND  CCIa( Close, 14 ) < 100;

Cond14 =  (O>C AND H==O AND C>L) OR(O>C AND
(O-C)/(.001+H-L)>.6) OR (O>C AND (H==O AND
C==L) OR (O>C AND C==L)OR( C>O AND C==H)OR(((H-L)>4*(O-C)) AND ((H-C)/(.001+H-L)>= 0.75) AND ((H-O)/(.001+H-L))>= 0.75)); 





Sell=Cond10 AND Cond11 AND Cond13/* AND Cond12*/ AND Cond14 ;
```


----------



## DJG (26 February 2013)

How the hell do people code those things?

Just copy it into the formula editor?


----------



## tech/a (26 February 2013)

DJG said:


> How the hell do people code those things?
> 
> Just copy it into the formula editor?




Yes

I do understand the comment though!
The best way I found to learn code is the write what you want to do in plain
English. Then write the code/variables and operators to match.

When writing---segment your code and test each bit so you can see if its doing what you want it to then join it up.

If anyone has a better idea let me know as I am just about to do the journey from Metastock to Amibroker!


----------



## captain black (26 February 2013)

tech/a said:


> I am just about to do the journey from Metastock to Amibroker!




Enjoy the journey tech 

If you get stuck the Amibroker FAQ thread here is a good place to ask questions:

https://www.aussiestockforums.com/forums/showthread.php?t=1679

Howard's free Intro. to Amibroker pdf is a good read to get a handle on the basics of setting it up.

http://introductiontoamibroker.com/book.html

Nick's forum has an Amibroker section too that's got a lot of good info in it.


----------



## tech/a (26 February 2013)

captain black said:


> Enjoy the journey tech
> 
> If you get stuck the Amibroker FAQ thread here is a good place to ask questions:
> 
> ...




Thanks Captain.

Strangley----I am looking forward to it.
I have all of Bandys works.
What I dont have is time! There is no positive expectancy there!---for any of us.
In the meantime as has been the case for a couple of years now--other things have priority.

Ill make sure I a menace to those FAQ threads!


----------



## CanOz (26 February 2013)

DJG said:


> How the hell do people code those things?
> 
> Just copy it into the formula editor?




Yeah, exactly. Just cut and paste it into the editor and then save to your custom formula folder or a new one you make up. Most of these were copied from the Amibroker user group. There are likely heaps of better scans there now.

Have fun, you can blow away a whole day if your not careful! lol!

CanOz


----------



## captain black (26 February 2013)

tech/a said:


> Ill make sure I a menace to those FAQ threads!




  I look forward to it! I've always found your VSA posts thought provoking over the years so happy to help you with any Amibroker related questions.


----------



## captain black (26 February 2013)

CanOz said:


> Have fun, you can blow away a whole day if your not careful! lol!




lol! It's even possible to blow away 10+ years playing around with it... (Amibroker that is... )


----------



## tech/a (26 February 2013)

captain black said:


> lol! It's even possible to blow away 10+ years playing around with it... (Amibroker that is... )




Great!!!
Ill reach my expiry date!

So how then did you learn?
Dont tell me its the families native language!


----------



## captain black (26 February 2013)

tech/a said:


> So how then did you learn?
> Dont tell me its the families native language!




lol, my wife would say it's my second language!

When I first started with Amibroker TJ was putting out a "tips" newsletter up until around 2002. They're still in the Amibroker members area, a bit outdated now but still worth a look.

There's also AFL's published in S&C magazine and posted in the members area each month. There's the equivalent Metastock version as well which may help in your coding some of your Metastock stuff into AFL.

The AFL library has a good collection and working through the indicator/system/exploration etc. examples there gives a good insight into how Amibroker array processing works.

There's a good collection of AFL's on this site now too:

http://www.wisestocktrader.com/indicators

You already understand system development etc. so you'll pick things up a lot quicker than most and you'll be able to spot the crap and ignore it quicker than others too. Unfortunately it's like everything else, there's really no shortcuts... 10,000 hours 

Oh, I should add that there's plenty of written and video tutorials on the support page:

http://www.amibroker.com/support.html

The Amibroker Yahoo group is a must to join too:

http://finance.groups.yahoo.com/group/amibroker/

Set it to send you each post via email, much easier to sort through that way.


----------



## howardbandy (28 February 2013)

There are some example AmiBroker programs on my blog site and in the free chapters of my books.  
http://www.blueowlpress.com/WordPress/
http://www.introductiontoamibroker.com/
http://www.meanreversiontradingsystems.com/book.html

Also, outlines of the platform independent system development process useful for developing systems, analyzing their risk, profit potential, health, and safe position size.

Regards,
Howard


----------

