Questions from a "dummy" - page 211

 
I'm stupid, but I want to be smart, so can you help me get started?
 
goldrail:
I'm stupid, but I want to be smart, so can you help me get started?
You have to start by being self-sufficient. Google for example... "how to trade forex."
 
lordlev:

Is it possible to implement it in MQL5 and how?

1) Saving of forward and backtest optimization results from Expert Advisor table? I.e. I want to save all 10 000 results during optimization, not just one run through the history.

2) Change the optimization settings from the Expert Advisor.

3) Go through 1 and 2 points and run a new optimization by new parameters.

Problem solved. This can be solved using the great .bat and .ini tools. It is strange that it is not implemented in MQL5.
 
Can you tell me where Metaeditor stores its settings? And most importantly, how do you transfer the editor's colour scheme from one to the other?
 
veti-k:
Thank you))
veti-k:
Hi, help solve a problem.

The essence of the problem is not correctly divide the prices!

Here's an example: 1.2829 + 1.2814 / 2 = 1.9236 which should be 1.2821.

Here's the code SUM = High[i+1] + Low[i+1] / 2;

Can you tell me where the error is?
SUM =( High[i+1] + Low[i+1] )/ 2.0;
 

Is there an analogue of OrderCloseBy function in MQL5?

https://docs.mql4.com/ru/trading/ordercloseby

I.e. is it possible to save on a spread when reversing a position, as it was possible in MQL4?

OrderCloseBy - Документация на MQL4
  • docs.mql4.com
OrderCloseBy - Документация на MQL4
 
solandr:

Is there an analogue of OrderCloseBy function in MQL5?

https://docs.mql4.com/ru/trading/ordercloseby

I.e. is it possible to save on a spread when reversing a position, as it was possible in MQL4?

It is not necessary on MT5 as the counter positions are overlapped automatically without a function call, similar to MT4 with a function call.
 

I wonder why addresses in PC memory need to be aligned (functions like _aligned_malloc())? What are the fundamental reasons? I can't figure it out. There's some kind of a reply all over the place, can someone send it to me somewhere?

 

I've run into another problem that I can't figure out.

I want to get the maximum and minimum values of the last closed months.

I put data into MaxVal and MinVal arrays:

CopyHigh(_Symbol, _Period, 0, ikolbar, MaxVal );

CopyLow(_Symbol, _Period, 0, ikolbar, MinVal );

Print on the screen:

for(iii=1; iii<ikolbar ;iii++)
{
Print(MinVal[ikolbar - 1 - iii], ", MaxVal[ikolbar - 1 - iii]);

}

I'm broadcasting in the tester on the monthly chart and in the log I'm getting...

Maximum and minimum price of the last day of each previous month:)

Very unexpected result.

If someone can explain why this is and how to avoid such unpredictable results, I would be very grateful.

p.s. It seems to be connected with the fact that the mode was "opening prices only". But why should it affect the search for historical data?

And is there a guarantee that if I test in this mode on smaller frames, the history will be found correctly?

 
MegaVoin:

I've run into another problem that I can't figure out.

I want to get the maximum and minimum values of the last closed months.

I put data into MaxVal and MinVal arrays:

CopyHigh(_Symbol, _Period, 0, ikolbar, MaxVal );

CopyLow(_Symbol, _Period, 0, ikolbar, MinVal );

Print on the screen:

for(iii=1; iii<ikolbar ;iii++)
{
Print(MinVal[ikolbar - 1 - iii], ", MaxVal[ikolbar - 1 - iii]);

}

I'm broadcasting in the tester on the monthly chart and in the log I'm getting...

Maximum and minimum price of the last day of each previous month:)

Very unexpected result.

If someone can explain why this is and how to avoid such unpredictable results, I would be very grateful.

p.s. It seems to be connected with the fact that the mode was "opening prices only". But why should it affect the search for historical data?

And is there any guarantee that if I test in this mode on smaller frames, the history will be found correctly?


Insert the code using the SRC. Try it like this:

CopyHigh(_Symbol, PERIOD_MN1, 0, ikolbar, MaxVal );
CopyLow (_Symbol, PERIOD_MN1, 0, ikolbar, MinVal ); 

double max=0.0, min=0.0;
for (iii=1; iii<ikolbar; iii++)
{  max=MathMax(max, MaxVal[iii]);
   max=MathMin(min, MinVal[iii]);
}

Print(“MaxVal = “,DoubleToString(max,_Digits),”, MinVal = “,DoubleToString(min,_Digits));
Reason: