[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 1069

 
goldtrader:

Let's perform a simple experiment proving that the drawdown in a separate (each) trade does NOT show up on the balance/equity graph.

Let's write an Expert Advisor of two lines of code:

Let's run it on the EURUSD D1 chart from May 1, 2010 to August 1, 2010. It will have to buy EUR at 1.2200 without a stop and close the position at take profit at 1.3000 We will see the drawdown on the balance/equity chart and on the visualization chart:

As you can see, on the visualization chart (upper in the screenshot) drawdown is visible, and on the balance/equity chart it is NOT. There is only one trade there. Let's look at the tester report:

In the tester report, the drawdown is FIGURING.

I hope the question is now cleared?

.

Perhaps, there is a question "WHY is it done that way?" This is a question not for us, the users, but for MT4 developers. In my opinion, this is wrong because the balance/equity chart does not show overbetting.

Alexander, thank you very much! Very detailed and thorough, thank you very much for your work. Don't the MT4 developers answer here?
 

Colleagues, maybe someone has come across this.

Is there a limit to the number of files opened at the same time? 4 is OK, 5 is open, but it doesn't write to it. I can't figure out what's wrong.

 

There is a problem. A deal should be opened when passing through the upper (buy) or lower (sell) boundary of the indicator corridor.

double barier = 0.08; // boundaries of the corridor.

R() - indicator function

Function for checking the condition of crossing the upper or lower bound ary:

int RFilter()

{

if ( R(2)> -barier && R(1) < -barier ) return (-1);

if ( R(2)< barier && R(1) > barier ) return (1);

}

The Expert Advisor opens a position immediately when the indicator passes a boundary (irrespective of which one). If it is up - buy, if it is down - sell.

 
dzhini:

There is a problem. The deal should be opened when passing through the upper (buy) or lower (sell) boundary of the indicator corridor.

...

It actually happens that the EA opens a position immediately when the indicator passes the boundary (it doesn't matter which one). If it goes up - buy, if it goes down - sell.

Increase the value of the barier variable slightly
 
costy_:

Question for connoisseurs

Can I create my own trading tool for my tester?

Replace EURUSD30_2.fxt with mine or something else.

metaquotes\tester\history\EURUSD30_2.fxt

I tried to create simple_csv2fxt, but tester has replaced the file with its own one.

Maybe someone has some experience of creation, thank you.

There is, there is. And there is a good article on the subject.
 
Reshetov:
Increase the value of the barier variable slightly
Didn't help. Could this be due to a sign assignment error?
 
dzhini:
Not helpful. Could it be due to a sign assignment error?

You can read coffee grounds or something else, as there is obviously not enough information.

1. an indicator or oscillator:

2. If oscillator, does it have limits or not? If it does, what are its highs and lows?

3. Perhaps the problem lies not in the code of the above function but in the code of its interpretation?

Since there are no telepaths here, and all the necessary information you have is classified, the question is the answer. I.e. based on the information you provided, increasing the variable should have solved the problem.

 
Reshetov:

You can read coffee grounds or something else, as there is clearly insufficient information.

1. an indicator or oscillator:

2. If it is an oscillator, is it limited or not? If it does, what are its maximum and minimum?

3. Perhaps the problem lies not in the code of the above function, but in the code of its interpretation?

Since there are no telepaths here and you have all the necessary information classified as secret, the question is the answer. I.e. at a glance, judging by the information you provide, increasing the variable should have solved the problem.

This is an indicator with the following formula:

double R(int shift)
{
double coef1 = 100.0 * (iMA(NULL, 0, perfast, 0,MODE_LWMA, PRICE_CLOSE, shift) - iMA(NULL, 0, perslow, 0, MODE_LWMA, PRICE_CLOSE, shift)) * iATR(NULL, 0, perslow, shift);
double coef2 = coef1 / iMA(NULL, 0, perslow, 0, MODE_LWMA, PRICE_CLOSE, shift) / iATR(NULL, 0, perslow, shift);
double main =(MathExp(2.0 * coef2) - 1.0) / (MathExp(2.0 * coef2) + 1.0);

return (main);

}

Constraints: (-1;1)

 
dzhini:

This is an indicator with this formula:

double R(int shift)
{
double coef1 = 100.0 * (iMA(NULL, 0, perfast, 0,MODE_LWMA, PRICE_CLOSE, shift) - iMA(NULL, 0, perslow, 0, MODE_LWMA, PRICE_CLOSE, shift)) * iATR(NULL, 0, perslow, shift);
double coef2 = coef1 / iMA(NULL, 0, perslow, 0, MODE_LWMA, PRICE_CLOSE, shift) / iATR(NULL, 0, perslow, shift);
double main = (MathExp(2.0 * coef2) - 1.0) / (MathExp(2.0 * coef2) + 1.0);

return (main);

}

Constraints: (-1;1)

Your function must work correctly according to the conditions mentioned in the comments:

int RFilter()

{

if ( R(2)> -barier && R(1) < -barier ) return (-1); // Short pose if the indicator value on the previous bar is higher than the lower bar and the current one is lower than this bar

if ( R(2)< barier && R(1) > barier ) return (1); // Long pose if the indicator value is below the upper barrier on the previous bar and is above it on the current bar

return(0); // Do nothing in all other cases.

}

 
Reshetov:

Then your function should work correctly for the conditions in the comments:

int RFilter()

{

if ( R(2)> -barier && R(1) < -barier ) return (-1); // Short pose, if the indicator value on the previous bar is higher than the lower bar and the current one is lower than this bar

if ( R(2)< barier && R(1) > barier ) return (1); // Long pose if the indicator value is below the upper barrier on the previous bar and is above it on the current bar

return(0); // No action in all other cases.

}

But it doesn't work :(