Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


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 (2) Thread Tools Display Modes
  #331 (permalink)  
Old 09-02-2006, 08:41 AM
AnasFX's Avatar
Junior Member
 
Join Date: Jul 2006
Posts: 5
AnasFX is on a distinguished road
Quote:
Originally Posted by phoenix
in that loop you can check all related whit the order... function

try search the word "order" in the "search" tab of the "Navigation" window
you will find all function about order

to compair with the bar time use Time[0] or iTime(..) function

like if(orderclosetime()>Time[0]) blockopen=true;
Ok it worked, but now the problem is performance. Checking the whole history takes time. I did a backtest for a year and a half period and I noticed that it is slow. The reason is that I am checking all orders in history and compare thier close price and close time. So, is there anyway to limit the history search to make it search only the recent orders? Can I increase the performance anyhow?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #332 (permalink)  
Old 09-02-2006, 09:44 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Question How do you Transfer Variable value from indicator to An EA??

////////////////////INDICATOR VALUES/////////////////////////

HourChannel_v1.MQ4
Setup: Hours = 3;

double Width=0;

Width = price_p0-price_02;


Comment("",
"\n",

"\n","Current High Channel = ",price_p0,

"\n","Current Low Channel = ",price_02,
"\n","Current Width = ",Width
);
///////////////////////////////////////////////////////////////////////////////////


////////////////////////////////NEED HELP BELOW//////////////////////////////


>>>How do I create a statement to transfer the "Width" variable value from the Hour Channel indicator into an EA????


double val= iCustom(NULL,0,"HoursChannel_v1", (NOW WHAT??)

Please Lend Me Your Expertise - Important!!

Last edited by iscuba11; 09-03-2006 at 08:20 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #333 (permalink)  
Old 09-02-2006, 07:28 PM
Warren's Avatar
Junior Member
 
Join Date: Jan 2006
Posts: 9
Warren is on a distinguished road
How to Disable EA on the definite day

Dear colleagues!

Are there exist possibilities to create piece of code which can disable opreation of Expert Advisor on the definite week's day, for example: Monday, Tuesday...etc.?

I'm not a programmer and that's why I ask for Your advice & help

Best regards,
Warren
__________________
Short Term Pain for Long Term Gain!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #334 (permalink)  
Old 09-03-2006, 01:07 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
PHP Code:
if (UseHourTrade)

      {      
 
int a=0;
 
int b=0;
 
int c=0;
       
if(!(
Hour()>=FromHourTrade1 && Hour()<=ToHourTrade1)) a=1

if(!(
Hour()>=FromHourTrade2 && Hour()<=ToHourTrade2)) b=1

if(!(
Hour()>=FromHourTrade3 && Hour()<=ToHourTrade3)) c=1

if(
a==&& b==&& c==1)   

      {
      
      
Comment(
      
"\n","  * SOLAR WIND EXPERT ADVISOR *",
      
"\n",
      
"\n""      - PROGRAM IN SLEEP CYCLE - ",
      
"\n",
      
"\n","        > NON-TRADING HOURS! <");
      
      return(
0);
      }
      } 

Adapt this code using below:

PHP Code:
int DayOfWeek( ) 
Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6of the last known server time.
NoteAt the testingthe last known server time is modelled
Sample:
  
// does not work on holidays.
  
if(DayOfWeek()==|| DayOfWeek()==6) return(0); 
extern bool UseHourTrade=false; Change statements to: UseDayOfWeek=false;

extern bool Monday=true;

extern bool Tuesday=true;

extern bool Wednesday=true;

extern bool Thursday=True;

extern bool Friday=True;

Good Luck! P.S. || is the same as (or). Try substituting Hour() with: if(!(DayOfWeek()=2 && Tuesday=true)) a=1;


I am not an expert at coding, but this should get you in the ballpark!

Last edited by iscuba11; 09-03-2006 at 07:32 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #335 (permalink)  
Old 09-03-2006, 06:45 PM
Warren's Avatar
Junior Member
 
Join Date: Jan 2006
Posts: 9
Warren is on a distinguished road
To iscuba11 !

Thanks a Lot for Your response!
__________________
Short Term Pain for Long Term Gain!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #336 (permalink)  
Old 09-03-2006, 07:40 PM
european's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 284
european is on a distinguished road
Choppy or flat market

Anybody can recommend indicator that shows choppy or flat market, when not to trade


euro
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #337 (permalink)  
Old 09-04-2006, 02:30 AM
Member
 
Join Date: Dec 2005
Posts: 71
richx7 is on a distinguished road
JMA Slope

JMA Slope on the bottom shows good and flat trading.
Attached Images
File Type: bmp jma slope.bmp (1.64 MB, 100 views)
Attached Files
File Type: mq4 JMASlope.mq4 (11.4 KB, 23 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #338 (permalink)  
Old 09-04-2006, 03:57 PM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 289
phoenix is on a distinguished road
Quote:
Originally Posted by AnasFX
Ok it worked, but now the problem is performance. Checking the whole history takes time. I did a backtest for a year and a half period and I noticed that it is slow. The reason is that I am checking all orders in history and compare thier close price and close time. So, is there anyway to limit the history search to make it search only the recent orders? Can I increase the performance anyhow?
you may try
OrderSelect(HistoryTotal(),SELECT_BY_POS,MODE_HIST ORY);

but i'm not sure for this one , i think it will pick up the last order in whole history

cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #339 (permalink)  
Old 09-10-2006, 03:57 PM
ping's Avatar
Junior Member
 
Join Date: Aug 2006
Posts: 5
ping is on a distinguished road
hallo folk...

can anybody help me..
i have some indicator to create EA....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #340 (permalink)  
Old 09-11-2006, 02:18 AM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 289
phoenix is on a distinguished road
Quote:
Originally Posted by phoenix
you may try
OrderSelect(HistoryTotal(),SELECT_BY_POS,MODE_HIST ORY);

but i'm not sure for this one , i think it will pick up the last order in whole history

cheers
edited of mine fault..it has to be
OrderSelect(HistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
histogram, forex, ZUP_v1.mq4

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
Posted By For Type Date
OzFx System:) - Page 639 This thread Refback 06-21-2008 10:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 12:46 PM


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



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