[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 193

 
Andrey067:

Good day everyone!

Question about EAs. Looking through a lot of EAs, I want to understand how trades are automatically made. I think I have set everything correctly, I allow the EA to trade, I understand the idea, but there are no trades for some reason. Perhaps, it is applied to a certain symbol? Or a timeframe? How can I find out?


Defaults to the current instrument and works on the current timeframe, if not specified in the other parameters (if of course these parameters are used)
 
tara:

1. Missing part of the bars will be, because the result of comparison double==int depends on the particular int value that was previously placed in double. This is exactly what happens here: time (int) is written in double - for all numbers that are not degrees of two there is a loss of precision, which results in double3 != int3, although double4 == int4.

2. I understand that this is just someone's technical mistake, then repeatedly propagated. Actually you just should fix the OpenBar type on double. But sleep of reason breeds beasts: it's easier just to repeat somebody else's code and close your eyes :)

3. Incorrect solution in terms of memory allocation: a local variable static is enough, extra global variable is useless - software rubbish, although it is a trifle :(

It's strange, but I don't skip anything. I think I don't need to cite a log? PERIOD_H1, the digits in the "log" run from 0 to 23, sometimes up to 22.

Apparently it's all about the ghosting procedure of types.

You shouldn't do that. And I agree about memory, it is more correct (static + int).

 
Vinin:

Defaults to the current instrument and works on the current timeframe, if not specified in the parameters of the other (if of course these parameters are used)

Normal EA - two moving averages with periods of 4 and 12. The signals are their intersection. There were several such signals during the day on five minutes, but there were no trades. The situation is the same with other Expert Advisors. Or they only work on a real account and I connect them to a demo one?
 
Andrey067:

A normal EA is two moving averages with periods of 4 and 12. Signals are their intersection. There were several such signals during the day, but no trades. The situation is the same with other Expert Advisors. Or they only work on a real account, while I am connecting them to a demo one?

The error is only in the logic. It does not matter if it is Real or Demo, but there should be attempts to open. If the logs are empty, look for an error in the EA.
 
Vinin:

It remains to bring the code. I'm just sick of repeating the same thing in five pages. All the more so that the correct solution can be easily found via search


The code is given in the second post on the previous page. The subject of the discussion was compliance or inconsistency (functional) with this code of the "simplified" variant suggested on the previous page. The verdict: no match.

There was a mistake in my previous post (mechanical) - in point 2 it should be "datetime or int" instead of "double". Fixed it.

 
tara:

The code from the tutorial is given in the second post on this page. The subject of the discussion was the correspondence or inconsistency (functional) to this code proposed on the previous page "simplified" version. The verdict: no match.

I never use other people's codes (although I used to), I try to use only what I understand.

Waiting for your variant (not from textbook)

 

Can you guys tell me. I am testing a trend TS on MM on Martin, I specify an explicit period in the indices, i.e. for example, the minimum period to enter the market when the fractal is broken

// определение входа в рынок по пробою фрaктала        
      F1=iFractals(Symbol(), signal_period, MODE_UPPER, 2); 
        if (F1>0) F11 = F1; //Print (" F11 = ",   F11);}   
            
             
      F2=iFractals(Symbol(), signal_period, MODE_LOWER, 2); 
        if (F2>0) F22 = F2; // Print (" F22 = ",   F22);}
       

And the signal_period =

PERIOD_M30 30 30 minutes
This is a min value. I get signals to enter the market on different indices with different periods - this is the min.

Then I loaded it in the strategy tester of the terminal downloaded from the brokerage company with its quotes history, but finally I got different results, when testing with M30 or smaller timeframe - say, M15 or M1... How is it possible? The Expert Advisor is opening a new bar and it is tested at open prices... Please advise, who knows or has faced with similar ...

 
Roman.:

Can you guys tell me. I am testing a trend TS on MM on Martin, I specify an explicit period in the indices, i.e. for example, the minimum period to enter the market on a fractal breakdown

In this case signal_period =

PERIOD_M30 30 30 minutes
This is a min value. I get signals to enter the market on different indices with different periods - this is the min.

Then I am loading in the strategy tester of the terminal downloaded from this brokerage company with its quotes history, and as the result I get different test results when testing with M30 period or with a smaller one - say, M15 or M1... How is it possible? The Expert Advisor is opening a new bar and it is tested at open prices... Tell me, who knows or has faced with such...


On the second bar the fractal may be redrawn. It should be checked on the third bar
 
Vinin:

On the second bar, the fractal may be redrawn. We have to check on the third.

Mmm... Interesting. Victor, thank you. I'll check it.
 
Roman.:

Mmm... Interesting. Victor, thank you. I'll check it out.

As long as the CU holds out.
Reason: