compute ema10 1min 5min from intraday 1sec - need help

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:

We work extremely hard to keep things positive on our forums.

We do not tolerate rude behavior, trolling, or vendor advertising in posts.

We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.

We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

compute ema10 1min 5min from intraday 1sec - need help

Hi! I am creating own trading system. I have classic formula to compute ema (exponencial moving average) using last ema value if exists else use SMA (simple moving average) value. When ema10, ema20 - the number 10, 20 define value for multiplier.

i want create this strategy using c++:

If stock 5min 20 ema crosses above the 5min 50 ema....and if the call option 1min 10ema crosses the 1min 20ema....place option in alert window

I am getting intraday record for my stock/option every 1 second in cycle (or in another period when i need). I need to know how to compute for example 1min or 5min ema10 from my input data.

[Q1] if 1min ema10..than i need:
A) compute ema10 1 time per every 1 minute ? (using input to new ema value before 1min)
B) compute it in every iteration when data come (i get data every 1 sec) and then i need to store computed value 1 time per minute?

[Q2] when starting to compute 1minute ema10 i need to compute simple moving average SMA from first x values[maybe10] and use SMA as first ema input. From this i conclude: i will get first ema10 1min after 10 x 1 minutes = 10minutes? I am creating short term trader and i think this is too long init time for ema10 1min. Is this correct computing process?

Thanks for helping me

Last edited by slovakfreelancer; August 12th, 2013 at 01:58 AM.
Reason: correcting

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

1. If stock 5min 20 ema crosses above the 5min 50 ema....and if the call option 1min 10ema crosses the 1min 20ema....place option in alert window

i read intraday data about stock and option every 1 sec... i need to know how to compute 1min or 5min ema from my input data.

if 1min ema..than i need to compute it 1 time per every minute ? or i need to compute it in every iteration when data come (every 1 sec) and then store this value 1 time per minute?