[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: A Challenge for all you code wizards ... :)



PureBytes Links

Trading Reference Links

Here's a solution for you to code:

1. Use the Osaka plugin from the 3rdParty directory.

2. Sort the values for the 2 sets of MAs, decide what distance you 
need from the highest and lowest value of the green set to setup a 
squeeze condition (ensuring that your red set is not intersecting 
yet).  

[Remember, you have the red set sorted to so you'll be able to 
detect when the upper or lower boundary (depending upon whether 
you're talking about an uptrend or downtrend setup) is violated by 
the upper or lower boundary of green set.]

3. Look for the crossings of the green set into the red set on an 
expansion and determine what spread value you need (absolute value 
of highest ema value minus lowest ema value) to qualify for enough 
expansion to make a signal.

The logic is to partition, sort, set boundary conditions and compare 
key values (your main interest is in the border values, not 
necesarily the middle MA values).

Simple sorting can solve many complex-sounding problems.   You can 
code this yourself.  Take the Osaka plugin, look at the examples in 
the Readme.txt file included in the zip download, sort the two sets, 
decide on your boundary conditions and then what constitutes a 
signal of interest.   Then, put YOUR name on the code and give 
yourself a good pat on the back.   

At least try.  I don't think your problem is coding the solution.  
It's much earlier in the process than that.  It's in formulating a 
series of steps to accomplish your goal.

Steve


--- In amibroker@xxxxxxxxxxxxxxx, "original_nightstalker" 
<nightstalker@xxxx> wrote:
>
> I'm using AB latest beta, v4.75.6 on XP.  And I have a challenge 
for you :)
> 
> I'd like to be able to scan for what I call a "Green Squeeze".  
Using Guppy MMAs, the short term ones are coloured green, the longer 
term ones coloured red.  When the green MMAs come together - the 
Green Squeeze - then start to rise and fan out above the red MMAs, 
this is often an excellent early sign of a breakout.  I have a 
small .png file (SnagIt screen capture) of such a move, but don't 
know how to post graphics here.
> 
> The code for my MMAs pane in AmiBroker is as follows:
> 
>  MaxGraph = 11;
> /* green lines */
> Graph0= MA( Close, 3 );
> Graph1= MA( Close, 5 );
> Graph2= MA( Close, 7 );
> Graph3 = MA( Close, 9 );
> Graph4 = MA( Close, 11 );
> Graph5 = MA( Close, 13 );
> Graph0Style = Graph1Style = Graph2Style = Graph3Style =Graph4Style 
= Graph5Style = 1;
> Graph0Color = Graph1Color = Graph2Color = Graph3Color =Graph4Color 
= Graph5Color = colorGreen;
> 
> /* red lines */
> Graph6= MA( Close, 21 );
> Graph7= MA( Close, 24 );
> Graph8= MA( Close, 27 );
> Graph9 = MA( Close, 30 );
> Graph10 = MA( Close, 33 );
> Graph11 = MA( Close, 36 );
> Graph6Style = Graph7Style = Graph8Style = Graph9Style 
=Graph10Style = Graph11Style = 1;
> Graph6Color = Graph7Color = Graph8Color = Graph9Color 
=Graph10Color = Graph11Color = colorRed;
> 
> NOW - the challenge:  How can I scan for the situation where the 
green MMAs start to emerge from a squeeze and start to fan out above 
the red MMAs?  The Green ones must be rising, they must be breaking 
above the topmost red one, and they must be starting to fan out 
(separate) over a few days - say 3 or 4 days for example.
> 
> As a non-coder, how can I incorporate those criteria into a scan?
> 
> The winner gets the honour of getting his/her name on the scan, 
and I'm sure that TJ would be happy to have it in the AFL library on 
the website... ;)
> 
> Any help much appreciated.
> 
> Regards,  NightStalker.
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/