Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 653

 
Konstantin Nikitin:

Or, you can write a locker ticket in the comment. It all depends on the ATS or what you want to achieve.

you can not put it in the order comment - it is not reliable, some servers wipe comments or add their own information there, it happens that at midnight the order comment disappears

Or to magik or global variables of the terminal - that's reliable.

 
Ghabo:

The fractals match completely.

The arrows on the regular fractals in the screenshot

by iFreeNumFractals puts first and last, the middle three do not.


I don't know what your arrow logic is, but if the iFreeNumFractals and Fractals data are identical, then the problem lies in getting the data right - look there.

 
#define  cycle  (1<<32) 

whether it will be faster in terms of number of iteration cycles than

#define  cycle  4294967296
what would be faster how to write a test to verify I can't think of
 
Artyom Trishkin:

I don't know what kind of logic you have there, but if the iFreeNumFractals and Fractals data are identical, then the problem lies in the fidelity of getting that data - look there.

There is no place to make a mistake - the variables f_up and f_dn must always contain the same value whether it is iFreeNumFractals or Fractals.

All further logic is based on comparing the price of the current bar with the priceof f_up. Maybe I do not see something

          f_up=iFractals(Symbol(),0,MODE_UPPER,i_i);
        //f_up=NormalizeDouble(iCustom(Symbol(),0,"iFreeNumFractals",1,2,2,2,2,0,i_i),Digits);
          f_dn=iFractals(Symbol(),0,MODE_LOWER,i_i);
        //f_dn=NormalizeDouble(iCustom(Symbol(),0,"iFreeNumFractals",1,2,2,2,2,1,i_i),Digits);
 
Aleksandr Egorov:

i open three buy orders, the price is 10 pips profit, i lock these three buy orders with three sell orders with the same volume, but if the price goes lower i already check for the profit of the sell orders and open a buy position, which is not needed

This is not the whole concept, we should not check for the profit of sell orders if the total buy order lot is equal to the sell order lot.

 
Ghabo:

There is no place to make a mistake - the variables f_up and f_dn must always contain the same value whether it is iFreeNumFractals or Fractals.

All further logic is based on comparing the price of the current bar with the priceof f_up. Maybe I'm missing something

What does the log say? The magazine "Experts"

 
Artyom Trishkin:

What does the journal say? Journal "Experts"

There are no errors in either version.

 
Ghabo:

...

All further logic is based on comparing the price of the current bar with the priceof f_up. Maybe I am missing something

How do you get the price in f_up, and then what do you compare?

 
Artyom Trishkin:

How do you get the price in f_up, and what do you then compare?

f_up=iFractals(Symbol(),0,MODE_UPPER,i_i);

In the next loop, I check 3 fractals and write them into the f variable

f=iFractals(Symbol(),0,MODE_UPPER,i_i);

The condition is full: if the upper fractal is above the MA and the next lower fractal is below the MA, then from this upper fractal I compare three fractals with any price of the current bar.

With a normal fractal, the algorithm works correctly. With iFreeNumFractals, some fractals do not seem to be visible. How do I know why?

 
can the EA look into the future?

I need the Expert Advisor to take the data for the last year, calculate the variance from it and then with the known variance, have the Expert Advisor test the last year in the tester.
Reason: