A Friend coded this for me - Works great!!!
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==1 && b==1 && c==1)
{
Comment(
"\n"," * SOLAR WIND EXPERT ADVISOR *",
"\n",
"\n", " - PROGRAM IN SLEEP CYCLE - ",
"\n",
"\n"," > NON-TRADING HOURS! <");
return(0);
}
}
Note: Unfortunately, the solarwind indicator is useless to write an EA from - It repaints itself! All indicators that have ++ used in the logic loop are virtually useless to try to write an EA for, because they all repaint themselves and that messes up the EA timing and optimization. They may be ok visually, but they don't work well in an EA. Most indicators do repaint themselves. You must use an indicator that has -- in the logic loop, and even then other conditions can mess up a EA. This is why so many EA's end up not working!!!
Dave
<><<<
Last edited by iscuba11; 08-24-2006 at 04:08 AM.
|