Download MetaTrader 5

Is it possible to calculate last 1 month return on OnTester function.

To add comments, please log in or register
rigorism
313
rigorism 2016.11.27 12:36 
Please tell me the code.
Alain Verleyen
Moderator
31085
Alain Verleyen 2016.11.27 13:50  
What have you tried ?
rigorism
313
rigorism 2016.11.28 13:54  

I think that OnTester function apply whole of back test period ,for example from 11/1/2011 to 11/1/2016.

But I want to know both whole result and specific period result, like from 10/1/2016 to 11/1/2016.

So is there something argument to specify the period in OnTester function.

 

double OnTester()

{

double ret = 0.0;

double ret = TesterStatistics(STAT_PROFIT);  ← It will show whole back test period's profit but I want to know last 1 month profit.

return(ret);

Alain Verleyen
Moderator
31085
Alain Verleyen 2016.11.28 14:05  
rigorism:

I think that OnTester function apply whole of back test period ,for example from 11/1/2011 to 11/1/2016.

But I want to know both whole result and specific period result, like from 10/1/2016 to 11/1/2016.

So is there something argument to specify the period in OnTester function.

 

double OnTester()

{

double ret = 0.0;

double ret = TesterStatistics(STAT_PROFIT);  ← It will show whole back test period's profit but I want to know last 1 month profit.

return(ret);

Yes you have to calculate it, see the link provided by WHRoeder.
rigorism
313
rigorism 2016.11.28 14:19  
Alain Verleyen:
Yes you have to calculate it, see the link provided by WHRoeder.

Dear Alain Varleyen

OK. Thank you for your answer. 

To add comments, please log in or register