Keeping Track of Winners/Loser for each day

 

Hi

I have several EA's i've programmed running on . They have a Daily tab where it breaks down the winners and losers for each particular day. It will give the stats for total winner/losers for Monday - Friday.

It's early days and my sample size is not that large but that particular daily stat on is showing that my system is performing extremely poorly on Fridays compared to the other days. Other days have 40-45% winners 55-60% losers on Monday-Thursday but only 10% winners 90% losers on Friday

I want to go back and do some back testing to keep track of winners/losers for each day and see if this is just a standard deviation for Fridays or if there is more to it.

I know I'll probably be using TimeDayOfWeek() function but I'm struggling with the logic of how to work out whether the trade that was closed was a profit or loss.

My system uses Pending Buy/Sell Stops.

Any suggestions will be greatly appreciated.


thx in Advance

Donex

 

If OrderProfit is positive, it was a winner, if negative, a loser.

You may also have to take into account swap and commissions if applicable

 

Thx GumRai

Still not sure how or when I check the OrderProfit. I only want to know when the order is closed, either it hits the s/l or t/p.

How do I know when an order closes for me to check if it was a winner or loser with the OrderProfit() ?

cheers

Donex

 
Donex:

Thx GumRai

Still not sure how or when I check the OrderProfit. I only want to know when the order is closed, either it hits the s/l or t/p.

How do I know when an order closes for me to check if it was a winner or loser with the OrderProfit() ?

cheers

Donex




In your OP, you simply asked about whether a trade had made a profit or loss.

There was a thread in the last few days discussing about whether a trade hit SL or TP

 

Ok thx for the thread helpful, but sorry still stuck, I'll try and explain more in detail

Now when I run my EA in a backtest for eg 1 year

I have the standard functions select orders in a loop and if there are open orders it will call the trailing function etc

I'm assuming I create another function to check the ticket and see if it's profit/loss and add to the day counter variables

but I only want to count them once, so should I just call this function in the deinit() function? will the ticket have a record of which day it was executed if I call it at the end of the test?

That's what I'm struggling with, when/how to check the closed order on the day it was executed and then closed, add to the appropriate counter variable and only check each closed order once.

At the end of the test I can simply print the day counter variables

 
Donex:

Ok thx for the thread helpful, but sorry still stuck, I'll try and explain more in detail

Now when I run my EA in a backtest for eg 1 year

I have the standard functions select orders in a loop and if there are open orders it will call the trailing function etc

I'm assuming I create another function to check the ticket and see if it's profit/loss and add to the day counter variables

but I only want to count them once, so should I just call this function in the deinit() function? will the ticket have a record of which day it was executed if I call it at the end of the test?

OrderOpenTime() OrderCloseTime() for the trades you find in the History pool . . .
 
RaptorUK:
OrderOpenTime() OrderCloseTime() for the trades you find in the History pool . . .


Yes of course, thx to all for the help. I think I've got it now.