| New signals service! | |
|
|||||||
| 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 |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Qstn on EA fundamentals TIA for your reply/answers.
Is there any FAQ for EA/Strategy tester?
Please provide the link if any. I am trying to write/test an EA where the logic will be tested at close of each 4 hour bar. Is there any facility like this on EA? Does EA checks for each tick only? Or it can be modified to check some parameters only after a close of 4 hour bar. For example I am trying to buy/sell based on a EMA cross of 5/21 but I want to do that only at the closing of a 4 hour bar and not for the every tick as being done in EA/Indicator. Thanks in advance for your time/replies. Kent |
|
|||
|
In order to trade on the beginning of an open bar only, add the following code:
static datetime timeprev; // at top of program if(timeprev==Time[0]) { //at beginnign of start() return(0); //only execute on new bar } else if (timeprev==0) { timeprev=Time[0]; //prevents execution when loading EA onto chart } else { timeprev=Time[0]; H4Processing(); SendMail(); } |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Fundamentals | superman | Analytics | 8 | 10-25-2006 04:14 PM |
| MT4 problem..need answers... | hosam | Metatrader 4 | 1 | 02-03-2006 02:11 AM |