Questions from Beginners MQL5 MT5 MetaTrader 5 - page 250

 
Reshetov:

This way.

What library? What variables?

https://www.mql5.com/ru/code/310 file acandlepatterns.mqh , there I would like to insert a variable thatcan be changed when optimising an EA. For example 3.0 to be changed in EA parameters.

//+------------------------------------------------------------------+
//| Checks formation of Hammer candlestick pattern          |
//+------------------------------------------------------------------+
bool CCandlePattern::CheckPatternHammer()
  {
//--- Hammer
   if((MidPoint(1)<CloseAvg(2))                                  && // down trend
      (MathMin(Open(1),Close(1))>(High(1)-(High(1)-Low(1))/3.0)) && // body in upper 1/3
      (Close(1)<Close(2)) && (Open(1)<Open(2)))                     // body gap
      return(true);
//---
   return(false);
  }
Мастер MQL5 - Торговые сигналы свечных паттернов Bullish Harami/Bearish Harami + Stochastic
Мастер MQL5 - Торговые сигналы свечных паттернов Bullish Harami/Bearish Harami + Stochastic
  • votes: 4
  • 2011.03.10
  • MetaQuotes Software Corp.
  • www.mql5.com
Торговые сигналы свечных моделей "Bullish Harami/Bearish Harami" (Бычья и медвежья модели Харами) с подтверждением от индикатора Stochastic.
 
abeiks:

For example, make 3.0 modifiable in the EA parameters.

What prevents you from doing this? make an input variable, put it in place of 3.0 and change it as you like
 
sergeev:
what's stopping you? make an input variable, put it in place of 3.0 and change as you like

input variable changes in the library, how will I see it in theEAparameters?

These are two different files.

 
abeiks:

input variable the variablechanges in the library, how would I see it in theExpert Advisorparameters?

These are two different files.

are you afraid to try it, or have you forgotten how a variable is written instead of 3.0?

If you are afraid of violating the library, then inherit the class.

you don't know how to pass an instance variable to the class - so create your own variable inside the class and initialize it when creating that instance variable.

 
sergeev:

are you afraid to try it, or have you forgotten how a variable is spelled instead of 3.0?

If you are afraid of breaking the library, then inherit the class.

If you don't know how to pass an instance variable to a class, then create your own variable inside the class and initialize it when creating that instance variable.

Thank you! Clearly this isnot for beginners.

 
abeiks:

Thank you! It's clear that this not for beginners.

and have you generated an expert?
 
sergeev:
and you've generated an expert?
Yes.
 
You understand something about code/classes, don't you?
 
sergeev:
You understand something about code/classes, don't you?

That's the thing: classes are something I can't understand. I've read the articles, but I still don't get it.

 
then ask for the whole code to be posted.
Reason: