Forex
Google

Go Back   Forex Trading > Programming > Metatrader Programming
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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 10-19-2007, 01:51 AM
eatrader eatrader is offline
Junior Member
 
Join Date: May 2006
Posts: 9
eatrader is on a distinguished road
What Code Do I Use To Set EA To Only Work On 30M Chart?

I have an EA and I just want it to work on the 30M chart eventhough it is on a 1H or 5M. Or diplay it only work on a 30 M chart. This is so I do not need to keep remembering which Timeframe I use on each EA I use. How do I code this??

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-19-2007, 03:10 AM
wolfe's Avatar
wolfe wolfe is offline
Senior Member
 
Join Date: Jan 2006
Posts: 673
wolfe is on a distinguished road
Quote:
Originally Posted by eatrader View Post
I have an EA and I just want it to work on the 30M chart eventhough it is on a 1H or 5M. Or diplay it only work on a 30 M chart. This is so I do not need to keep remembering which Timeframe I use on each EA I use. How do I code this??

Thanks
EA will only work on the chart it's attached to. However, if your EA is using indicators you can code them to call their values from a time frame other than the chart they are attached to.

Example would be if your EA is on a 1H or a 5M chart you could call a moving average from a 30M time frame.

iMA(NULL,PERIOD_M30,13,0,MODE_SMMA,PRICE_CLOSE,0);

Hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-19-2007, 03:44 AM
davidke20's Avatar
davidke20 davidke20 is offline
Senior Member
 
Join Date: Sep 2006
Location: 38° 53′ 51.61″ N, 77° 2′ 11.58″ W
Posts: 1,393
davidke20 is on a distinguished road
Or you can do this to avoid plotting the EA on the wrong chart

PHP Code:
Start()
{
if(
Period()!=30){Comment("Wrong time frame! M30 only");return(-1);}

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB 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
How can make code work every second ??? mercury_man General Discussion 4 09-16-2007 10:28 AM
Strategy Tester - virtual chart not active chart? joc_06 Expert Advisors - Metatrader 4 2 08-11-2007 03:49 PM
will this work? stevenali Suggestions for Trading Systems 6 07-24-2007 02:19 PM
Need Help With EA that does not work shorttermtrader Metatrader 4 0 05-02-2007 01:55 PM
Help me!!!! Why this EA doesn't work???? metastock Expert Advisors - Metatrader 4 3 02-17-2007 05:31 AM


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