Questions from Beginners MQL4 MT4 MetaTrader 4 - page 197

 
GlaVredFX:

Unfortunately, my indexer is based on MQL4 and this function is only a small part of it.

That's why it would be not so efficient to implement MQL5, and it would be long and problematic to rewrite the whole thing.

What do you want to search for min/max, for indicator or EA?

 
Vitaly Muzichenko:

What do you want to do a min/max search for, an indicator or an EA?

For the indicator.

Artyom Trishkin:

The indicator is rewritten in MQL5 in half an hour on average. With a cup of coffee.


It needs to be finalised first, it has more than one function, it has MA, Pivot, Mat functions.

In a word, it combines at least 3 indicators. It has not been completed to its logical end yet.

I don't consider MQL5 very well. In fact I don't understand MQL4 and MQL5 is out of the question.

 
GlaVredFX:

for the indicator.

Artyom Trishkin:

An indicator is rewritten in MQL5 in half an hour on average. With a cup of coffee.


It needs to be finalised first, there is more than one function, it has MA, Pivot and Mat functions.

In a word, it combines at least 3 indicators. It has not been completed to its logical end yet.

I don't really understand MQL5, or rather I don't fully understand MQL4 and MQL5 is completely out of the question.

You should address your questions to the specialMQL4 and MetaTrader 4 section.

I will post it to avoid confusion ...

 
Vladimir Karputov:

You should have asked your questions in theMQL4 and MetaTrader 4 sections

I will move it to avoid confusion.

Thanks, it took me a while to figure out what to do and how to do it.

 
GlaVredFX:

Thank you, it's just that I haven't been here long enough to know what's going on.

About right, but this is for an EA. ReplaceiLow andiHigh, andBars with arrays and rates_total withOnCalculate()

 bool flagH=false,flagL=false;
 double ArrHigh=0,ArrLow=DBL_MAX;
 bool StopLow=true,StopHigh=true;
 
 int bars=Bars(NULL,PERIOD_CURRENT);
   for(int i=0; i<bars; i++) {
    double ma=MA(NULL,PERIOD_CURRENT,89,0,MODE_EMA,PRICE_CLOSE,i); 
    double high=iHigh(NULL,PERIOD_CURRENT,i);
    double low=iLow(NULL,PERIOD_CURRENT,i);
   // Low
    if(StopLow) {
     if(ma>low) {
      if(ArrLow>low) {
        ArrLow=low;
        flagL=true;
       }
      }
      if(flagL && ma<low) {
      // Print(i,"=",low,"=",ma);
        StopLow=false;
      }
    }
    
   // High
    if(StopHigh) {
     if(ma<high) {
      if(ArrHigh<high) {
        ArrHigh=high;
        flagH=true;
       }
      }
      if(flagH && ma>high) {
       // Print(i);
        StopHigh=false;
      }
    }
    if(!StopLow && !StopHigh)
     break;
   }
   
  Comment(ArrLow+"="+ArrHigh);
    
 }
 
Vitaly Muzichenko:

Approximately, but this is for an EA. ReplaceiLow andiHigh, as well asBars with arrays and rates_total withOnCalculate()

Thanks a lot, it seems like it's what I need.

 
GlaVredFX:

for the indicator.

Artyom Trishkin:

The indicator is rewritten in MQL5 in half an hour on average. With a cup of coffee.


It needs to be finalised first, there is more than one function, it has MA, Pivot and Mat functions.

In a word, it combines at least 3 indicators. It has not been completed to its logical end yet.

I don't consider MQL5 very well. In fact, I'm not yet fully aware of MQL4 and MQL5 is out of the question for me.

It may seem strange, but MQL5 is the same as MQL4. There is no difference in complexity between them. There are small differences in terms of trading functions and methods of working with indicators. trifles.

And here's another thing: those who write cross-platform codes are surprised to discover that it's easier to write in MQL5, while in MetaTrader4 they have to write a lot of code to implement the same functionality available in MetaTrader5, while in MQL5 everything is already standard. So maintaining the code compatibility for both platforms imposes limitations on the functionality at all, or we have to create it for 4 by a quite complex and voluminous code.

 
Can I ask which platform is better,MetaTrader 5 orMetaTrader 4?
 
88992740:
Can I ask which platform is better,MetaTrader 5 andMetaTrader 4?

For now Metatrader 5, if Metatrader 6 ever comes, it will be better.

 
Good afternoon. I've stopped saving my drawings. After pressing "save as drawing" selection window comes up, I select mode and nothing else happens. Vin10 b1260 roboforex. Help, help please
Reason: