Problems with Time() - page 6

 
CFx:

Can you write consistently profitable Trade Logic across ALL market types, because you made the effort to learn?

No, I'm still learning. But I know how not to be an Ass . . . I see you are still learning that skill.

I just wrote some test code to try and help you and I ran it through the Strategy Tester . . . why did I do that ? with an attitude like yours I really don't know why I bothered . . .

But anyway, I'll tell you what I found, I can still do that as I have mastered the "not being an Ass skill".

Day(), DayOfWeek(), TimeDay() and TimeDayOfWeek() all seem to work correctly in the Straegy Tester (build 427) . . . did you really mean to use Day() in your code or should your code building thing . . whatever it is that you use to code for you, should it have used DayOfWeek() ? the first, Day() gives a value 0 - 31, the second DayOfWeek() gives a value of 0 - 6 Sunday is 0

Comment("Day() of the month: ",Day(), " Day of week(): ", DayOfWeek(), "\n", "TimeDay Current: ", TimeDay(TimeCurrent() ), " TimeDay of week Current: ", TimeDayOfWeek(TimeCurrent()) );
 
CFx:

So, I should be getting something other than "modeled" server time.

No. You get modelled Server Time because you should be running the Strategy Tester while disconnected from your Broker's Server . . so there is no actual Server time . . hence what you get is modelled. If you were still connected to your Broker and you wanted to get actual Server time then you would get the time from your Broker's Server at the actual time you ran your EA in the Strategy Tester and that probably wouldn't be much good to you.

So be happy that the Server time you get is modelled.

 
RaptorUK:

No, I'm still learning. But I know how not to be an Ass . . . I see you are still learning that skill.

I just wrote some test code to try and help you and I ran it through the Strategy Tester . . . why did I do that ? with an attitude like yours I really don't know why I bothered . . .

But anyway, I'll tell you what I found, I can still do that as I have mastered the "not being an Ass skill".

Day(), DayOfWeek(), TimeDay() and TimeDayOfWeek() all seem to work correctly in the Straegy Tester (build 427) . . . did you really mean to use Day() in your code or should your code building thing . . whatever it is that you use to code for you, should it have used DayOfWeek() ? the first, Day() gives a value 0 - 31, the second DayOfWeek() gives a value of 0 - 6 Sunday is 0


Well, I'd say that by the way you have responded to me, you have failed at not being an Ass. However, there is a distinct difference (and disadvantage) to being a Smart Ass. Being just an Ass, is benign at best. But, being a Smart Ass, is the equivalent of standing in front of Bruce Lee, and calling him out of his name to his face. Or, standing in front of self made millionaire, and telling him that he's flat broke. Or, standing in front of combat veteran, and telling him that he's gutless. Or, standing in front of a Professor of Applied Mathematics, and telling him that he knows nothing about logical constructs. That's being a Smart Ass.

Second, I can help turn anyone into a successful trader - I've done it five (5) times already. Those people wish to be kept anonymous, before you ask. I'm not here because I am wanting for trade logic skills. I came here, to get some help with some MQL, because I am not an MQL developer and I do not have the time to learn a programing language, to the point where I can extend my creative problem solving skills using the language. I spend my time working on advancing the art of creating trade logic and watching my daily position unfold in the market. Creating new trading concept, is my forte. Being heads down in MQL, has not made me profitable. Maybe that has worked for you, however.

Third, I don't test in Build 427. Another assumption that only an Ass would make. I have to test under Build 409, and there is a good reason for that (I won't get into it here). I said before - I have tried ALL of the Time() based functions in MQL related to the need of the EA and none of them have worked: Day(), TimeHour, TimeMinute, DayOfWeek, etc.

I get the distinction between Day() and DayOfWeek(), as I always READ the MQL Documentation before making a post requesting help. I don't just run into a forum and ask for help. I typically exhaust ever source I can search on the web, and I try ever configuration I can imagine, including WRONG configurations such as TimeHour and TimeHour sequentially, just to see if I get some kind of traceable difference in behavior from the EA.

When all else fails, I logon and ask for help. Smart Ass people do the exact opposite of what I have done - and you should be able to detect the difference.

 
RaptorUK:

No. You get modelled Server Time because you should be running the Strategy Tester while disconnected from your Broker's Server . . so there is no actual Server time . . hence what you get is modelled. If you were still connected to your Broker and you wanted to get actual Server time then you would get the time from your Broker's Server at the actual time you ran your EA in the Strategy Tester and that probably wouldn't be much good to you.

So be happy that the Server time you get is modelled.


That's actually not correct.

The script that I use provides the tester engine with the actual historical server time. The process required that I convert .csv files to .hst files, and then .hst to .fxt files. The Tester engine is fed not only market ticks (Bid/Ask), but the associated Date/Time with each tick. Data/Time is fed along with Bid/Ask ticks to the Tester. I did not design the testing script, but it produces 99% modeling and most importantly, the Candle Build for each time frame is true to the historical market. In other words, because the Date/Time is being passed along with the ticks to the Tester, each .hst file generated comes with the actual market volume footprint as produced by the market on the Data/Time associated with each bar.

I should be getting the actual historical server time, connected or disconnected from the brokers back-end. This is what the script does and this is how I am able to do multi-time frame backtesting.

 
CFx:

That's actually not correct.

The script that I use provides the tester engine with the actual historical server time. The process required that I convert .csv files to .hst files, and then .hst to .fxt files. The Tester engine is fed not only market ticks (Bid/Ask), but the associated Date/Time with each tick. Data/Time is fed along with Bid/Ask ticks to the Tester. I did not design the testing script, but it produces 99% modeling and most importantly, the Candle Build for each time frame is true to the historical market. In other words, because the Date/Time is being passed along with the ticks to the Tester, each .hst file generated comes with the actual market volume footprint as produced by the market on the Data/Time associated with each bar.

I should be getting the actual historical server time, connected or disconnected from the brokers back-end. This is what the script does and this is how I am able to do multi-time frame backtesting.

Sorry you are missing some of the facts.

I have used dukascopy tick data too, process by the eareview scripts and yes I understand how they work. When you test using the Strategy Tester on the 31st of May 2012 and the data you are using is 2008 the Server Time given to you is from 2008, this is a Modelled Server time and not an actual server time . . the actual Server time is a datetime from 2012 not 2008.

By the way, the 99% modelling quality figure is meaningless . . . it's just a figure that is written into the fxt file . . . read the stuff at eareview and you will see this for yourself. You don't need tick data to do multi timeframe back testing . . . you can't look at any timeframe lower than M1 . . . I do agree though that tick data should be used as a final acid test of an EA. Perhaps we can agree on that.

 
CFx:

Third, I don't test in Build 427. Another assumption that only an Ass would make.

It's not an assumption I made . . . I was simply letting you know what Build I tested in . . I though it was relevant.
 
CFx:

I get the distinction between Day() and DayOfWeek(),

Do you ? your code in your OP shows you trying to close a trade if the Day is 1 or 2 etc . . well April 1st 2012 was a Sunday, your code is not going to close a trade on a Sunday . . . now if you meant DayOfWeek() instead of Day() that might have made sense . . .

Day() == 1 || Day() == 2 || Day() == 3 || Day() == 4 && TimeHour(TimeCurrent()) >=23 && TimeMinute(TimeCurrent()) >=57 || Day() == 5 && TimeHour(TimeCurrent()) >=21 && TimeMinute(TimeCurrent()) >=57

Note: The problem is that all trades remain open Monday through Thursday, through 23:57. Also, all trades remain open on Friday, through 21:57.

where is your check for the Month ? you can't determine if Day() == 4 is a Friday if you don't determine what the Month is . . . and what about the other 3 weeks of the Month ? do you seriously expect me to believe you only trade the first 5 days of the Month ? even if they are a Saturday or Sunday ?

 
CFx:

It does NOT work. The kind of mentality that would automatically assumed that it does work, is probably the same mentality that thinks it knows how to trade when it doesn't.


That isnt the kind of mentality I have, although you have done a pretty good job of displaying the kind you have,

I didnt assume anything, I said it works because I KNOW it works.

Strategy Tester:

 
Can any body explain me about what is Function return values ? And how it works in details plz....
 
Jonathan:
Can any body explain me about what is Function return values ? And how it works in details plz....
I created a thread just for you: What are Function return values ? How do I use them ?
Reason: