Questions from Beginners MQL5 MT5 MetaTrader 5 - page 901

 
Sile Si:

No doubt, the EA attached to si modifies vtbr. Puts a T/P position on the quotes of its instrument "si"

If I attach an EA to vtbr, it does not modify si, it works only on its instrument


Any explanation for this?

There is no modification in the code other than this:

This is very strange. Given the character filter

            if(m_position.Symbol()==Symbol())

this shouldn't be the case.

 

Tell me, is the conditional compilation used correctly to use this code for mt4 and mt5?

string TFstring(ENUM_TIMEFRAMES TF)
{
   string sTF=(TF==PERIOD_M1?"M1":(TF==PERIOD_M5?"M5":(TF==PERIOD_M15?"M15":(TF==PERIOD_M20?"M20":(TF==PERIOD_M30?"M30":
              (TF==PERIOD_H1?"H1":(TF==PERIOD_H4?"H4":(TF==PERIOD_D1?"D1":(TF==PERIOD_W1?"W1":(TF==PERIOD_MN1?"MN1":"--"))))))))));
   #ifdef __MQL5__  
      if(sTF=="--") 
         sTF=(TF==PERIOD_M2?"M2":(TF==PERIOD_M3?"M3":(TF==PERIOD_M4?"M4":(TF==PERIOD_M6?"M6":(TF==PERIOD_M10?"M10":(TF==PERIOD_M12?"M12":
             (TF==PERIOD_H2?"H2":(TF==PERIOD_H3?"H3":(TF==PERIOD_H6?"H6":(TF==PERIOD_H8?"H8":(TF==PERIOD_H12?"H12":sTF)))))))))));
   //#else 
   //   sTF=sTF;
   #endif
   return(sTF);
}
 
Vladimir Karputov:

and parameters of the'TrendCreate' function

'TrendCreate' - function not defined _.mq4 218 3


Do you need to connect some library?

 
Iosif_Bragin:

Tell me, is the conditional compilation used correctly to use this code for mt4 and mt5?

It's easier to do this through aswitch statement.

And even in this implementation conditional compilation is useless. Because mql4 doesn't list such periods as M2, M20 and others that are present in mql5, hence, there will be no such a request.

Документация по MQL5: Основы языка / Операторы / Оператор-переключатель switch
Документация по MQL5: Основы языка / Операторы / Оператор-переключатель switch
  • www.mql5.com
может быть помечен целой константой, символьной константой или константным выражением. Константное выражение не может включать переменные или вызовы функций. Выражение оператора
 
Сергей:
'TrendCreate' - function not defined _.mq4 218 3


Is there a library that needs to be installed?

I do not know where you got my quote, but you must have got the wrong branch: questions about MQL5 are here

 
Alexey Kozitsyn:

What do you need the copied price(s) for?

I do everything by hand, of course I copy price levels that can be copied. What's funny, you can copy the stop, but you can't copy the price. They could make everything copied, right down to the bar, copy it, paste it into a calculator and calculate it quickly and efficiently.

 
built a smart EA in Metaeditor mt5, how to reformat it for mt4 ?
 
Anatoliy Peretyazhko:
I built a good Expert Advisor in Metaeditor mt5, how to reformat it for mt4 ?

The question is along the lines of "I bought a Mercedes. How do I turn it into a Zaporozhets?" :) .

Added: There is a special section for MQL4:MQL4 and MetaTrader 4

 
Vladimir Karputov:

The question is along the lines of "I bought a Mercedes. How do I turn it into a Zaporozhets?" :) .

Added: There is a special section for MQL4:MQL4 and MetaTrader 4

Not exactly. i wanted to connect to Copy fx from ROBOFOREX? and they only use mt4 accounts

 
What is the analogue of theTrendCreate function in mql4?
Reason: