PureBytes Links
Trading Reference Links
|
Chris - that's it!!!! Thank you so much. That is EXACTLY what I was trying to achieve. Brilliant ! :)
I've changed the MA time periods to match the ones I use, and shortened the lookback period to 3 days, and it gives me exactly the patterns I'm looking for without a whole lot of false positives.
Outstanding work - VERY much appreciated. You should submit that one to the AmiBroker file library if you're happy for others to download it and use it.
Thank you again Chris - great stuff and typical of the helpful mob that hang out on this forum :)
Regards, NightStalker.
--- In amibroker@xxxxxxxxxxxxxxx, kris45mar <kris45mar@xxxx> wrote:
>
> Nightstalker:
>
> Been playing with MMAs for a while now. I find them difficult to code.
> (The time it took me to come up with this is about 5 times as long as an eyeball of all the charts in my watchlist might take, but still worth the exercise)
>
> Exploration:
>
> *****
> /* Exploration for Guppy MMA Cross over, shorts having just crossed the Longs AND spreading apart.
> The divergence of short MMAs may lead or lag the crossover.
> Use differing values for the lookback p, and the MinCP and MaxCP values. Also the DG value.
> These values get most of the setups you described in my 50c to 300c watchlist.
> Add your own price/volume filters. */
>
>
> /* Set the no of days ago
> Long value returns fewer results.
> shorter value returns more results.*/
>
> p = Cross_no_days_ago = 4;
>
> MinCP = Minimum_CrossPeriod = 0.5 * p; /* you may choose different values here*/
> MaxCP = Maximum_CrossPeriod = 2 * p; /* choose different values here.*/
>
> /* Add the values of the short and long Guppy MMAs, as a proxy for the long and short MMAs. Adjust to suit your own ema values.*/
> sumShort = ( EMA(C,3) + EMA(C,5) + EMA(C,8) + EMA(C,10) + EMA(C,12) + EMA(C,15) ) ;
> sumLong = ( EMA(C,30) + EMA(C,35) + EMA(C,40) + EMA(C,45) + EMA(C,50) + EMA(C,60) );
>
> /*Shorts cross the Longs*/
> Cond1 = Cross(Sumshort,Sumlong);
>
>
> Diff = EMA(C,3) - EMA(C,15);
> DG = DivergingGreens = Sum( Diff > Ref(Diff,-1), p) == p;
> /*choose different values here eg p/2 to find more candidates */
>
> Filter =
> BarsSince(Cond1) == p /* your conditions exactly. Few results*/
> // BarsSince(Cond1) > MinCP and BarsSince(Cond1) <= MaxCP /*finds more results, less strict criteria */
> AND
> Diff > 0 /* for bullish, rising Short MMMAs.*/
> AND
> DG
> AND
> EMA(C,15) > Max(EMA(C,30),EMA(C,60))/*short MMAs must stay above the reds. Some retracement is possible.*/
> ;
>
> AddColumn(Ref(Diff,-4),"Diff-4",1.3);
> AddColumn(Ref(Diff,-3),"Diff-3",1.3);
> AddColumn(Ref(Diff,-2),"Diff-2",1.3);
> AddColumn(Ref(Diff,-1),"Diff-1",1.3);
> AddColumn(Diff,"Diff",1.3);
>
> Plot(Sumshort,"sumshort",colorGreen,1);
> Plot(Sumlong,"sumlong",colorRed,1);
>
> *****
> This is all I have been able to come up with.
> If you come up with something better, let me know.
>
> ChrisB
>
>
>
>
> ---------------------------------
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
------------------------ 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/
|