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

Re: [amibroker] Re: EMA crossover help (math problem)



PureBytes Links

Trading Reference Links

Hi Mike --

Here is a short AFL code from one of the libraries.  You can use whatever lookback periods you want to.

-----------------------

// The Title of the graph will show the price required to generate a crossover of the EMAs. 
// for instance, if you want to Buy a stock if the 5 Day EMA crosses above the 10 Day EMA,
// you will know what price is needed to make that happen on the next
// Day by the figure that is displayed in the Title. 
// Take the Formula AND the AFL AND work it into your own favorite graphs.

Plot(Close, "Price", colorBlack, styleBar);
Plot(EMA(Close,5),"5-EMA",colorWhite,styleLine);
Plot(EMA(Close,10),"10-EMA",colorRed,styleLine);

//Formula for EMA Crossover Price
XR=(EMA(Close,5) * (2 / 6 - 1) - EMA(Close,10) * (2 / 11 - 1)) / (2 / 6 - 2 / 11);

Title = WriteVal (XR, format=1.2 ) + " Price Required for EMA Crossover";

-------------------

I am the author of "Quantitative Trading Systems."  Chapter 13 of my book shows several methods of anticipating crossovers, and other signals, for cases both where you know the formula and where either you do not know the formula or it is too complex to solve.

Thanks,
Howard
www.quantitativetradingsystems.com



On 10/8/07, gp_sydney < gp.investment@xxxxxxxxx> wrote:

Do a search on the Web to find the EMA formula that shows how to
calculate the next day's EMA value. Once you have that, you'd either
have to iteratively try different values to work it out, or possibly
apply a bit of simultaneous equation maths to solve for the next day's
price.

Regards,
GP

--- In amibroker@xxxxxxxxxxxxxxx, "mikedostal24" <mikedostal24@xxx> wrote:
>
> Hello,
> I want to find out what my future sell stop price would be using a 3
> day EMA and a 6 day EMA and figuring what price tomorrow would create
> the crossover point.
> I'm having a complete brain freeze on this and any help would be
> appreciated!
> Thanks!
> mike
>


__._,_.___

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___