Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 222

 

Hello.

The EA was tested with the same settings the day before yesterday and yesterday. The code is the same, all parameters are the same, but the result is different.

The Expert Advisor opens trades at the set time without any additional conditions. We can see that the opening prices of trades differ significantly.

I have downloaded the same quotes archive both times from MetaQuotes Software Corp.

Files:
szcwya.zip  34 kb
 
gince:

How do I find two top/bottom fractals in a row? The picture below.

I tried to write an indicator, but I didn't think it through.

Maybe someone has seen such an indicator ready?


Are you sure that int GetFractal(string sy="0", int tf=0, int nf=0) functioncatches fractals correctly ? (there are EMPTY_VALUE values there )

Why such an inadequate overshoot?

1) it works on the appearance of a candle and not on a tick

2) to try two fractal arrays simultaneously instead of repeating a lot of times.

3) If the upper fractal is present, +1 to the value of the first variable, if the lower one, -1. ( Variants of results: - 1, 0, +1)

4) on the next fractal: if there is an upper fractal, then +1 to the value of the second variable; if there is a lower fractal, then -1. ( Results are as follows: - 1, 0, +1)

5) Look for the sum of the first and second variables:

a) less than 0 ( we have two lower fractals) YEAH!

b) greater than 0 ( we have two upper fractals) YEAH!!!

c) is equal to zero and one variable is equal to zero ( we have two lower and two upper fractals) YEAH!!!

6) reassign the value of the second variable to the first one and start the cycle from point 4)

 
aiculu:
Help, I did not understand how I did it, but I accidentally clicked something and a window disappeared with an overview of my open orders, how do I get it back?

Ctrl-T

 
Elektronik:

Ctrl-T


Thank you.)))
 
Antonius:

Hello.

The EA was tested with the same settings the day before yesterday and yesterday. The code is the same, all parameters are the same, but the result is different.

The Expert Advisor opens trades at the set time without any additional conditions. We can see that the opening prices of trades differ significantly.

I have downloaded the same quotes archive both times from MetaQuotes Software Corp.

You have the current spread selected in the tester - hence the difference, because when you start the test, the spread is used as it was when the test was started. Set the spread to a constant number.
 
ALXIMIKS:


Are you sure that int GetFractal(string sy="0", int tf=0, int nf=0) functioncatches fractals correctly? (there are EMPTY_VALUE values there )

Why such inadequate overkill?

1) work from the appearance of a candle, not from a tick

2) Do one search on two fractal arrays at once, instead of multiple searches.

3) If the upper fractal is present, then +1 to the value of the first variable, if the lower one, then -1.

4) Next fractal: if there is an upper fractal, then +1 to the second variable, if there is a lower fractal, then -1.

5) Look for the sum of the first and second variables:

a) less than 0 ( we have two lower fractals) YEAH!

b) greater than 0 ( we have two upper fractals) YEAH!!!

c) is equal to zero and one variable is equal to zero ( we have two lower and two upper fractals) YEAH!!!

6) reassign the value of the second variable to the first one and start a loop from point 4)

Instead of sarcasm, you'd better write a proper and optimised function to the person yourself. All you always show is negativity and mockery. Don't play smart: if you have an answer, write the code, if you don't have an answer, don't say anything. Overkill is going on there by the way...
 
artmedia70:
You have the current spread selected in the tester - hence the difference, because, when you run the test, the spread is used that which was at the time the test was run. Set the spread to a constant number.


The difference between trades opened on the same day, at the same time on different test days - varies.

For example,

Date, time The day before yesterday Today Difference
2011.10.05 13:151616.031622.89 -6.86
2011.10.12 13:151682.871682.89 -0.02
2011.10.19 13:151649.101659.66 -10.56


Yes and too high values for spread.

 
artmedia70:
Instead of sarcasm, you'd better write a proper and optimized function yourself. You always show only negativity and mockery. Do not play the smartass: if you have something to say, write the code, if you don't have an answer, don't say anything. Overkill is going on there by the way...


I had time - I came up with an algorithm for the task, described it in detail (maybe a little incorrect for some people - people are different in terms of comprehensibility).

sarcasm? I don't know, I was just trying to help.

code write someone? optimize more? (yes, I can, but is it worth it?)

(PS artmedia70, no offence, I respect your attitude and opinion in general - honestly, but the other day you yourself gave me code from iCustom-y to put it mildly not very optimised).

int a1=0,a2,a3,kilkict,frac,frac1=0;//frac - флаг существования фракталов, frac1- счетчик фракталов (+1 или 0 за цикл)

kilkict=iBars(sy, tf);

for (i=3; i<kilkict;i++){
  a2=0;frac=0;
  if(iFractals(sy, tf, MODE_UPPER, i)>0) {            
     if (Bufer0!=EMPTY_VALUE) {
         a2+=1;frac=1;frac1++;
        }
     }
  if(iFractals(sy, tf, MODE_LOWER, i)>0) {            
     if (Bufer0!=EMPTY_VALUE) {
        if(a2==0){frac1++; frac=1;}a2+=-1;
        }
     } if (frac==0){continue;}if (frac1==1){a1=a2;continue;}
  a3=a1+a2;
  if(a3<0)           { a1=a2;//Два фрактала вниз  подряд найдено// continue;}
  if(a3>0)           { a1=a2;//Два фрактала вверх подряд найдено // continue;}
  if(a3==0 && a1==0) { a1=a2;// Два фрактала подряд вверх и два фрактала подряд вниз найдено //}
}

Something like this should work if you insert it into the check for a new bar.

The code would be more optimal if you narrow down kilkict=iBars(sy,tf) after some number of fractals, so that you don't have to constantly look through all the bars.

 
ALXIMIKS:


I had time - I came up with an algorithm for the task, described (in detail, maybe a little incorrect for some people - people are different in terms of approachability).

sarcasm? I don't know, just to help.

write the code to someone? optimise more? (yes i can, but is it worth it? )

(p.s. artmedia70, no offence, I respect your attitude and opinion in general - honestly, but the other day you yourself gave the code from iCustom-y to put it mildly not very optimised).

Something like this should work if you insert it into the check for a new bar.

The more optimal code would be if we narrow down kilkict=iBars(sy,tf) after some number of fractals, so we don't have to constantly look through all the bars.

Yes, as they used to joke in KVVAIU, a real officer must inspire fear, both with his behaviour and his physical appearance.

Is it possible to make it "more optimal"?

 
ALXIMIKS:


I have had time - I have come up with an algorithm for the task, described it (in detail, maybe a bit incorrect for some people - people are different in terms of profitability).

sarcasm? I don't know, just to help.

write the code to someone? optimise more? (yes i can, but is it worth it? )

(p.s. artmedia70, no offence, I respect your attitude and opinion in general - honestly, but the other day you yourself gave the code from iCustom-y to put it mildly not very optimised).

Something like this should work if you insert it into the check for a new bar.

The code would be more optimal if kilkict=iBars(sy,tf) were narrowed down after a certain number of fractals, so as not to constantly go through all the bars.

Thank you. I've started to write according to your algorithm. But with flags, you're as close as I am to Peking. Thanks again.