Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2006, 03:41 PM
Junior Member
 
Join Date: Dec 2005
Posts: 11
onelesstick is on a distinguished road
Shifted Movig Average

Can someone please advise me on the following ?
When using a moving average in an EA it can be described as iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE ,0)
How does one alter this code to give the same moving average but shifted either forward or backwards ?
Many thanks for your kind assistance.
__________________
Have Patience - The second mouse gets the cheese
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-02-2006, 06:27 PM
Member
 
Join Date: Nov 2005
Posts: 49
4xCoder is on a distinguished road
This will shift a 5 period MA forward by 5 periods.
shift = 5;
ma = iMA(NULL,0,5,shift,MODE_EMA,PRICE_CLOSE ,0);

and for -5 periods,
shift = -5;
ma = iMA(NULL,0,5,shift,MODE_EMA,PRICE_CLOSE ,0);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-02-2006, 06:55 PM
Junior Member
 
Join Date: Dec 2005
Posts: 11
onelesstick is on a distinguished road
Thanks 4xCoder
if I understand you this means I can add something like:

ema = iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE ,0);
emaprevious = iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE ,1);

emashift = shift = 5;
iMA(NULL,0,5,shift,MODE_EMA,PRICE_CLOSE ,0);
emashiftprevious = shift = 5;
ima = iMA(NULL,0,5,shift,MODE_EMA,PRICE_CLOSE ,1);

to define them so that I can write an alert setup ?
__________________
Have Patience - The second mouse gets the cheese
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Average RSI xcooper Metatrader 4 15 08-23-2008 02:02 PM
XP Moving Average! codersguru Ema Cross 406 08-04-2008 03:50 AM
moving average danu Expert Advisors - Metatrader 4 1 05-31-2006 04:23 AM
How to calculate Moving Average of a Moving Average babarmughal Expert Advisors - Metatrader 4 2 05-15-2006 10:11 AM


All times are GMT. The time now is 07:13 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.