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 09-08-2006, 01:12 PM
Member
 
Join Date: Aug 2006
Posts: 97
bwilhite is on a distinguished road
Simple (i think) question RE iMA

I've searched the forum concerning this question and the closest thing I've found to an answer was found here :
Is it possible?

Anyway, I'm trying to get a simple moving average (10 in this case) from a daily chart to show up on a lower time frame. Preferably hourly, but it shouldn't matter and I don't care which time frame.

If I code the indicator using iMA like so, :
SMA10Price[pos]= iMA(NULL,1440,10,0,MODE_SMA,PRICE_CLOSE,pos);

then I get a line, but it moves way much more than it should, zig-zagging about on the 60 min chart. Since it is supposed to be showing the value of the 10-day SMA and the daily bar only closes one time/day on the 60 min chart, it should retain the same value throughout a whole day.

I feel like I'm missing something here, because I've had a similar problem with all of the i... functions when I've tried using them. Would someone please help me out, since my other option is to code these solutions in a MUCH more cumbersome manner?

If necessary, I can post all of the code for the sample indicator. I could also post the chart...I'll have to figure out how to save my chart as a jpeg or something (I'll search the forums.)

Please help!

Thanks in advance,

Brandon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-08-2006, 01:30 PM
Member
 
Join Date: Aug 2006
Posts: 97
bwilhite is on a distinguished road
Here is the chart. I just did a printscreen and then saved as jpeg in paint. The wavy line is the value given by iMA. It shows up in the data window as CodersGurusCode, because basically it's the sample he posted elsewhere. The other lines are the open, high, low, close from the previous day (daily bar). I coded these without using iHigh, etc...because of the same problem I'm having with iMA. This is how my MA value should look...a straight line throught the day and then another straight line the next day...etc..

Any help is appreciated. Thank you.
Attached Images
File Type: jpg 10-day SMA on hourly.JPG (323.2 KB, 53 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-08-2006, 01:46 PM
Administrator
 
Join Date: Sep 2005
Posts: 15,796
Blog Entries: 31
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
It should be on this thread Multi Timeframe Indicators
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-08-2006, 04:30 PM
Member
 
Join Date: Aug 2006
Posts: 97
bwilhite is on a distinguished road
Thank you New_Digital. The code I downloaded from that thread seems to work. Now I just have to figure out the difference between the two.
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
SIMPLE-MACD-EA : An extremely simple EA based on 2 channels of MACD. Try it! investor_me Expert Advisors - Metatrader 4 31 07-30-2008 09:59 AM
Simple Question For Mql4 Programers: Changing The Di+ And Di- Periods Of Adx RJames5541 Metatrader Programming 9 07-31-2006 02:31 PM
A simple question from a newbye tradetrade Metatrader 4 1 07-18-2006 07:08 AM
Simple question of determining the time of day Fishtank Metatrader 4 2 04-04-2006 04:12 AM
my first EA, simple question ycomp Metatrader 4 3 01-24-2006 05:46 PM


All times are GMT. The time now is 12:06 AM.



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