Go Back   Forex-TSD > Programming > MetaTrader Programming
Forex Forum Register More recent Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 10-19-2007, 01:51 AM
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 10-19-2007, 03:10 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 830
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 10-19-2007, 03:44 AM
davidke20's Avatar
Senior Member
 
Join Date: Sep 2006
Location: 38° 53′ 51.61″ N, 77° 2′ 11.58″ W
Posts: 1,503
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
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 03:15 PM.



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