[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 429

 
costy_ >>:

Посмотрите на рисунок инд. начал отрисовку только со смещением в 60 баров на днях. Ниже часть кода. Вы хоть пробовали что то из того что рекомендовали? Пробуйте и у Вас все будет.


Tomorrow, i.e. today, but in the morning. The bashaka is not working at the moment.

 

no advisor will not... it's a manual job for you...

step by step, open the metaeditor, create a script (by pressing the leaf with a plus sign) - the wizard starts, select a custom script, call it something, click next or ok, a window opens, with a code template for the script, if it is not deleted of course... but it does not matter...

delete all the code and put the one above, which begins with the line #property show_inputs

You go to the terminal in the navigator, in the accounts, indicators, Expert Advisors, below there are scripts, find it and run, a window pops up, in the input parameters you specify the optimization end time, pair, period, number of bars from the end of optimization according to which the start time will be found, entered, press ok,

then look in the journal The Experts tab at the bottom of the terminal window where the Trade, account history

the script will show you the time, something like

2010.02.13 02:49:32 #1 CHFJPY,M1: 2010.02.09 22:59

This is the time you have to enter in the parameters of the Expert Advisor as the optimization start time, and the time that you have specified in the script as the optimization end time.


Don't forget to add the code to the Expert Advisor.

extern string startTime = "";
extern string endTime = "";

int StartTime = StrToTime( startTime), EndTime = StrToTime( endTime);

if (Time[0] < StartTime || Time[0] > EndTime) return(0);
 

the last two lines should be at the beginning of the start() function


In the tester, set the time before optimization starts and after it ends...

 
costy_ >>:

Посмотрите на рисунок инд. начал отрисовку только со смещением в 60 баров на днях. Ниже часть кода. Вы хоть пробовали что то из того что рекомендовали? Пробуйте и у Вас все будет.


The indicator is all pretty...

Make an EA with this code and see what it produces in the tester

int start(){
Print(TimeToStr(iTime(NULL,1440,60)));
}
 
Nde only by hand.
 

How is AbsoluteDrawDown calculated?

 
Helen >>:

Как подсчитывается AbsoluteDrawDown?


https://www.mql5.com/ru/articles/1486
 

In Code Base there is an Expert Advisor MA v.3.0. #150 only for EURUSD M1.mq4

Please explain what are the criteria for opening and closing positions in the EA?

At first glance, it seems to be simple, because we use three moving averages as indicators. However, we cannot visually see at which points the signals for actions of the EA appear.

 
costy_ >>:
Не только вручную.

Good morning! Thanks again for active participation costy_ and keekkenen in the post about the possibility of strategy tester (in optimization mode and test mode) on the last N bars. The Russian proverb: "wiser in the morning" (or "wiser"? what is the correct way?) has worked.

The solution is as follows:

extern bool Tester=false; //true - work in the strategy tester
extern datetime FinishDateTime = D'12.02.2010'; // End of work (for example, set the current time)
extern int History=100; //Bars for testing

int start()
if(Tester && (FinishDateTime-Time[0])/60/Period()>History) return;

In the "tester" mode, the following happens:

- the tester starts working from the time specified for it. And it doesn't know at that time the length of time series in the future (ahead). It does not know our real current time. There is no HIS for him. There is only Time[0], Time[1] etc., but no Time[-1].

- When you meet the above construct, it calculates the number of bars to the specified FinishDateTime time. THAT IS ALL!!!

All tested, everything works! Thanks to all and good luck.


 
xeon писал(а) >>

https://www.mql5.com/ru/articles/1486

Thanks, I've seen... AbsoluteDrawDown = InitialDeposit - MinimalBalance (or Equity? The report comes up with a different figure.