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

 
Поиск - MQL5.community
Поиск - MQL5.community
  • www.mql5.com
Поиск выполняется с учетом морфологии и без учета регистра. Все буквы, независимо от того, как они введены, будут рассматриваться как строчные. По умолчанию наш поиск показывает страницы...
 

Not sure what the problem is...

I use two points to calculate the indicator line,StartTime andEndTime

When I do the first calculation - everything is clear... But when I change the calculation boundaries to the lower side (StartTime to the right orEndTime to the left), it recalculates and leaves the old lines on the chart outside the boundaries ...

The idea is that I want the analysis to be done in a new line, but the old data is still there (((

I've been searching all day for a way to clear the buffer array before feeding me new data, but this function doesn't seem to exist...

Please advise why the indicator buffer stays drawn on the chart, although the data has been changed.

for(int Z = iBarShift(NULL,0,StartTime); Z>=iBarShift(NULL,0,EndTime); Z--) {

Buffer1[Z] = iMA(NULL,0,1,0,0,0,Z);}
 
Nikita Zubarov:

I don't understand what the problem is...

I use two points to calculate the indicator line,StartTime andEndTime

When I do the first calculation - everything is clear... But when I change the calculation boundaries to the lower side ( StartTime to the right orEndTime to the left), it recalculates and leaves the old lines on the chart outside the boundaries ...

The idea is that I want the analysis to be done in a new line, but the old data is still there (((

I've been looking for a way to clear the buffer array before feeding me new data, but this function doesn't seem to exist...

Can you tell me why the indicator buffer stays drawn on the chart, although the data has been changed.

ArrayInitialize() by zero or EMPTY_VALUE

 
Alexey Viktorov:

ArrayInitialize() zero or EMPTY_VALUE

Thank you!, it's working!!!

Been messing around for half a bloody day((( and there's 1 line...

ArrayInitialize(Buffer1, 0.0);
 

How to know the order open price in MQL5?

In MQL4 it was OrderOpenPrice()

found, your division, to rewrite the owl I will have to study the whole language of five....

double
 latestOpenPrice = PositionGetDouble
 ( POSITION_PRICE_OPEN
 );
 
Igor Makanu:

use 2 magic numbers and for each magic number do accounting and modifications with a warrant

Thank you very much.

 
Pul-Adgi Mo-UlStan:

How to know the order open price in MQL5?

In MQL4 it was OrderOpenPrice()

found, your division, to rewrite the owl I'll have to study the whole language of five....

POSITION_PROFIT

Current profit

double


?????? Profit in what??? in pips?, in deposit currency?????

or profit/loss in money??? You won't know anything till you finish the owl, it's not very well written...

I have one more question. You cannot just put Bid and Ask in 5. Do I have to write Name?

Ask

It gets the current price of Ask.

doubleAsk()const

Returned value

Current Ask price.

Note

The symbol must be pre-selected byName method.

It's a bit crazy, but...

SymbolInfoDouble(SYMBOL_BID) - this is just to get Bid price, the language is not more complicated than in MT4...

I've already spent a whole day trying to transfer the ready code of the owl and the indicator from MT4 to MT5. i've already written 2 EAs from scratch on mt4 with different algorithms....

psc. bear with me, shhhhh. ok this is only because i need a quick test of mt5...

Too bad there is no converter.....

 
Pul-Adgi Mo-UlStan:

POSITION_PROFIT

Current profit

double


?????? Profit in what??? in pips?, in deposit currency?????

or profit/loss in money???? you won't know anything till you finish the owl, documentation is poorly written...

I have one more question. You cannot just put Bid and Ask in 5. Do I have to write Name?

Ask

It gets the current price of Ask.

doubleAsk()const

Returned value

Current Ask price.

Note

The symbol must be pre-selected byName method.

It's a bit crazy, but...

SymbolInfoDouble(SYMBOL_BID) - this is just to get Bid price, the language is not more complicated than in MT4...

I've already spent a whole day transferring the ready code of the owl and indicator from mt4 to mt5. i've already written 2 EAs from scratch on mt4 with different algorithms....

psc. bear with me, shhhhhhh. ok this is only because i need a quick test of mt5...

Too bad there is no converter.....

have you tried using macro substitutions at the beginning of the programme?
for example:

#define  Ask SymbolInfoDouble(SYMBOL_BID)

and you won't have to change anything.
In fact, after working in MQL5 for a long time you will get annoyed with MQL4. I know how it is.

 
Nikolai Semko:

In fact, after working in MQL5 for a long time you will be just as annoyed by MQL4. I know it myself.

I already do! I wrote my code as I used to do in MT4 - well, I like its brevity.... i cannot optimize the first part of the idea - there are too many parameters, MQL4 does not want to optimize it!

I had to quickly fix the code for MT5, but the speed and capabilities are dozens of times different.... Alas, MT5 is undoubtedly better suited for the development of TS

 
Igor Makanu:

It's already annoying! I wrote the code as I used to under MT4 - well, I like its brevity.... I cannot optimize the first part of the idea - there are too many parameters, MT4 does not want to optimize it!

I had to quickly fix the code for MT5, but the speed and capabilities are dozens of times different.... Alas, MT5 is undoubtedly better suited for the development of TS

I don't understand why there's so much hype around the tester. I only need it for a single pass. All optimisation has to take place within the program.
The last time we tried to fool with tester on search of parameters was 7-8 years ago.
Reason: