How to backtest a manual trading system? - page 2

 
RaptorUK:

No, Slippage is an int and is a number of points. The original code is correct if slippage is meant to be 3 points.

There is no need and it may confuse . . . OrderSend() returns -1 in the event of an error or returns the ticket number in the event of success. So if the ticket == EMPTY there was also a failed OrderSend()

What about error reporting ? What are Function return values ? How do I use them ?


"Reis": Please disregard my Slippage correction. I was wrong and "RaptorUK" is correct.

Slippage: You are correct! Sorry my bad! Should have tested the code myself. Thanks.

EMPTY: That is exactly my point since EMPTY = -1, it is easier to validate the Ticket as it is the result of the error by the OrderSend(). If OrderSend() does not return a valid ticket, then it is always due to a error (hence -1 or EMPTY). Obviously a return of 0 or NULL could be considered an undefined situation, but in reading the manual and following it by the letter, then 0 or NULL could be considered a valid ticket number even if in practice it may not be so.

 
FMIC: No need for the snide attitude!

Excuse me but the OP said "I've done what WHReder told me to." He didn't do ANYTHING. All he did was add a meaningless timestamp print statement. He has never stated a problem. He has not added tracing statements, or variable dumps. He doesn't want to do the work. He doesn't want to learn. He wants someone to do it for him.

You want to jump in, fine. Try and help him BUT without doing all the work yourself. If you do it for him, he learns nothing, and the next post you will have to help him again.

But don't give me an attitude when I refuse to give the answer to him instead of making him learn. English as a second language is irrelevant. I "scolding him" because he LIED. Not because he misunderstood. Not because he tried and failed. Because he did NOTHING.

"‘Tis the season to be happy!!!" Give a man a fish vs teach a man to fish. Think about what the season is really about

 
FMIC:


EMPTY: That is exactly my point since EMPTY = -1, it is easier to validate the Ticket as it is the result of the error by the OrderSend(). If OrderSend() does not return a valid ticket, then it is always due to a error (hence -1 or EMPTY). Obviously a return of 0 or NULL could be considered an undefined situation, but in reading the manual and following it by the letter, then 0 or NULL could be considered a valid ticket number even if in practice it may not be so.

If the OrderSend() isn't called due to a coding error and the ticket number is tested it will be -1, a ticket number of -1 tells us that OrderSend() failed . . . "Returns number of the ticket assigned to the order by the trade server or -1 if it fails." . . . but it didn't fail, it was never called, initialising the ticket number variable to -1 is misleading. Better to initialise it to an invalid value such as -999
 
WHRoeder:

Excuse me but the OP said "I've done what WHReder told me to." He didn't do ANYTHING. All he did was add a meaningless timestamp print statement. He has never stated a problem. He has not added tracing statements, or variable dumps. He doesn't want to do the work. He doesn't want to learn. He wants someone to do it for him.

WHRoeder,

You are really pissed with this topic, aren´t you? But why?

You´ve told that I don´t want to learn. But you don´t know me. You don´t know how much I know. You know nothing about any difficulties I may be facing. So are you some kind of a prophet or seer, or what?

I thought about some ways to prove to you that I really want to learn, that I´m trying hard, but I remember that I don´t have to prove anything to you.

On the other hand, even if I wanted someone to do the job for me, what is the problem with that? Am I doing something wrong to ask? People ask help for the others all the time on internet on the foruns, social network etc.

Is there any rule here that says I can´t ask people for help or for an EA? If is there this rule, please show me. Remember, no one is forced to help me or anybody here. But I´m sure that there is a rule here that says that everybody must be polite with each other and you are not, at least with me.

But now let´s talk about you. What is really happening with you, man? Why are you so pissed of with my asking? Why is this bothering you so much? Do you have any kind of interest with this forum? Do you sell any kind of service here? Are you a professional coder? If so, no problem until the time you start acting in way to force people buy your service, ok? Remember, this is a forum for helping people with anything about MetaTrader. It is free. If you want to earn money coding, no problem. But this is not the place to sell or force people to buy for your service, ok?

Now is time to stop. Actually everything I write here is another way to tell you what I´ve told you in the thread before, but I think you did not understand...

 
RaptorUK:
If the OrderSend() isn't called due to a coding error and the ticket number is tested it will be -1, a ticket number of -1 tells us that OrderSend() failed . . . "Returns number of the ticket assigned to the order by the trade server or -1 if it fails." . . . but it didn't fail, it was never called, initialising the ticket number variable to -1 is misleading. Better to initialise it to an invalid value such as -999


Raptor and FMIC,

First of all thank you very much for your effort. I´ll start working in what you told me on afternoon. As soon as a got any result I came here to tell you.

Thank you once more.

P.S.: Raptor I´ve sent a PM for you.

 
Reis:

WHRoeder,

You are really pissed with this topic, aren´t you? But why?

You´ve told that I don´t want to learn. But you don´t know me. You don´t know how much I know. You know nothing about any difficulties I may be facing. So are you some kind of a prophet or seer, or what?

I thought about some ways to prove to you that I really want to learn, that I´m trying hard, but I remember that I don´t have to prove anything to you.

On the other hand, even if I wanted someone to do the job for me, what is the problem with that? Am I doing something wrong to ask? People ask help for the others all the time on internet on the foruns, social network etc.

Is there any rule here that says I can´t ask people for help or for an EA? If is there this rule, please show me. Remember, no one is forced to help me or anybody here. But I´m sure that there is a rule here that says that everybody must be polite with each other and you are not, at least with me.

But now let´s talk about you. What is really happening with you, man? Why are you so pissed of with my asking? Why is this bothering you so much? Do you have any kind of interest with this forum? Do you sell any kind of service here? Are you a professional coder? If so, no problem until the time you start acting in way to force people buy your service, ok? Remember, this is a forum for helping people with anything about MetaTrader. It is free. If you want to earn money coding, no problem. But this is not the place to sell or force people to buy for your service, ok?

Now is time to stop. Actually everything I write here is another way to tell you what I´ve told you in the thread before, but I think you did not understand...


It is the way you try to learn....

We now see your basic level is that low you always fail making your EA

before you open a trade you haven't check the trades you already have ....

then how can you go try to open (again and again) a new trade ??

Also we see you don't know how to handle failures you get

every new tick you make

int TicketBuyEURUSD = 0;
int TicketSellEURUSD = 0;
 

Guys,

This is the last time I write here so I´m writing to ask you not to answer this topic anymore. As I won´t read it anymore.

This is not a place for me since I was told that I can not answer when someone is disrespectful, impolite or even when I´m scolded and called liar

Thank you all that tried to help me.

And don´t worry, today I succeed in backtesting my system. Unfortunately it was not on MT4. It was on a big Excel spread sheet.

Have you all a wonderful week.

 
deVries:


It is the way you try to learn....

We now see your basic level is that low you always fail making your EA

before you open a trade you haven't check the trades you already have ....

then how can you go try to open (again and again) a new trade ??

Also we see you don't know how to handle failures you get

every new tick you make



The man is still on his first baby steps. Consider this his "Hello World" EA. He is still trying to wrap his head around the first steps about how to place and close an order. He has not yet reached that stage of development to start checking for previous trades, money management, position sizing, the list goes on and on ...

He still has a long way to go! He just needs a little help to get his first EA to work reasonable so that he will be able to start to walk.

You can't expect him to start coding advanced concepts right from the word go.

Let's be patient and help him with some small stuff. He will soon start walking on his own and coding more advanced stuff.

Right now, all he is concerned about is making a small EA to facilitate his backtest of manual trades for which he already has a table of open and close dates.

Nothing fancy, just some training wheels!

 
Reis:

Guys,

This is the last time I write here so I´m writing to ask you not to answer this topic anymore. As I won´t read it anymore.

This is not a place for me since I was told that I can not answer when someone is disrespectful, impolite or even when I´m scolded and called liar

You were NOT told that, please don't misrepresent what I wrote . . . you were also not called a "liar" . . . that word does not appear in this thread until your post above.
 
Reis:

Guys,

This is the last time I write here so I´m writing to ask you not to answer this topic anymore. As I won´t read it anymore.

This is not a place for me since I was told that I can not answer when someone is disrespectful, impolite or even when I´m scolded and called liar

Thank you all that tried to help me.

And don´t worry, today I succeed in backtesting my system. Unfortunately it was not on MT4. It was on a big Excel spread sheet.

Have you all a wonderful week.


still you haven't found out what's wrong with your code.....

how do you find the trades you already opend ??

why don't you use a magicnumber to recognize the trades of your EA ??

do we have to say your coding is well when it isn't ??

Reason: