Forex



Go Back   Forex Trading > Discussion Areas > Metatrader 4
Forex Forum Register More recent Blogs 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 02-08-2007, 04:02 PM
boostrade's Avatar
Member
 
Join Date: Dec 2006
Posts: 43
boostrade is on a distinguished road
How to make an EA that trades only at control points?

Hi All,

Does anyone know how to make an EA that only trades at control points?
or only trade at every 5 minute? or every 10 minute?

Thank you!
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 02-08-2007, 11:22 PM
Member
 
Join Date: Jun 2006
Posts: 56
timbobo is on a distinguished road
It depends on your EA... You can make it only once on openning bar.
http://www.forex-tsd.com/metatrader-...tion-open.html
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 02-09-2007, 03:31 AM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 297
ralph.ronnquist is on a distinguished road
Quote:
Originally Posted by boostrade
Hi All,

Does anyone know how to make an EA that only trades at control points?
or only trade at every 5 minute? or every 10 minute?

Thank you!
The prinicpal code stanza for a time filter is like the below:
PHP Code:
static datetime last_time 0;
datetime now TimeCurrent();
if ( 
now last_time 60 ) {
    
// Too close in time since previous trading
    
return( );
}
last_time now
The static variable last_time is a keeper of the last time the execution went past the filter, which here is expressed as a required least time period (at least 5 minutes between now and the last time).

To synchronise with bar opening, you'd use Time[0], the opening time of the bar, rather than TimeCurrent(), which is the time stamp of the "tick", and with the filter condition saying "now-last_time > 0" (i.e., this tick is not just another tick during the same bar as of the previous tick).

You also have to choose where in the code to place the stanza; typically it would be after the management of opened trades, if any, and before the computations that gather information for the decision logic. That is, you tycpially will want the EA to manage open trades on every tick, but not have it waste cycles on other computations. Of course, if your EA uses indicators, then you also need to consider whether the indicators require all ticks, or is happy enough to be invoked at the trading rate.
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
Trade at control points boostrade Expert Advisors - Metatrader 4 2 02-13-2007 12:28 PM
Control Points inwestorthc Setup Questions 1 10-18-2006 12:27 PM
NewsTracker to control EAs around newstime phampton Expert Advisors - Metatrader 4 0 08-25-2006 02:46 AM


All times are GMT. The time now is 11:19 PM.



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