Thread: MQL4 Learning
View Single Post
  #22 (permalink)  
Old 11-03-2006, 04:12 AM
Eaglehawk's Avatar
Eaglehawk Eaglehawk is offline
Senior Member
 
Join Date: Jun 2006
Posts: 141
Eaglehawk is on a distinguished road
Post how do i word this expression?

i'm (still) working on programming good friday's occurence. i've got the sequence of the full moon set, and i also have my variable, full moon, to be an integer, from a double, and i've encountered yet another dam in my river of thought. (man i hate it when i run into thoose!)

this last expression i've been working on in my good friday testing funciton involves using some c++ terms i've never seen in any refrence or other code, as i'm not a professional programmer, i'm groping in the dark really.

here's what i want the string to say. this is the wednessday before the sunday after the first full moon after march 21'st.

here's what i was thinking of when i started this expression step by step.
PHP Code:
// if the month = march, the day is greater than 21, otherwise, the month has to be april or may
if (((Month() == && Day() > 21) || (Month >= && Month() <= 5)
//this is a wednessday
&& DayOfWeek() == 3
//in 4 days, it will be a sunday (nigh certain this isn't proper grammar)
&& (Day() + /*makes*/ DayOfWeek() == 0)
//and that sunday will be after day3 (a variable i defined as a day when the moon is full)
> (Day() > day3)))
         {
          
gmonth day3;
          
gday month;          
         } 
the whole strand together is

PHP Code:
         if (((Month() == && Day() > 21) || (Month >= && Month() <= 5) && DayOfWeek() == && (Day() + /*makes*/ DayOfWeek() == 0) > (Day() > day3)))
         {
          
gmonth day3;
          
gday month;          
         } 
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk
REMEMBER,
"Genius is nothing but a greater aptitude for patience." –Benjamin Franklin

____________________________________

Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!!

http://sufx.core.t3-ism.net/ExpertAdvisorBuilder
Reply With Quote