Spread trading in Meta Trader - page 160

 

Hi all.

An EA (paired trailing stop) has been provided:

int init()  {//функция инициализации советника
//- На всякий случай напомним пользователю, если он забыл : 
gbNoInit=False; if (!IsTradeAllowed()) {
    Message("Для нормальной работы советника необходимо\n"+
            "Разрешить советнику торговать");
    gbNoInit=True; return;             }
  if (!IsLibrariesAllowed()) {
    Message("Для нормальной работы советника необходимо\n"+
            "Разрешить импорт из внешних экспертов");
    gbNoInit=True; return;   }
  if (!IsTesting()) {
    if (IsExpertEnabled()) Message("Советник будет запущен следующим  тиком");
    else Message("Отжата кнопка \"Разрешить запуск советников\"");
                    } 
    if (Symbol()!= Symbol_1) {
    Message("Текущий инструмент не соответствует заданному для Symbol_1");                
                            }                
             } // ========= конец функции  int init()

Now I found out that when I install an EA on a chart in a comment it says

For normal work of the Expert Advisor it is necessary to "Allow import from external EAs" +

And this is despite the fact that there is no call for external EAs in the code. Except
#include <stdlib.mqh> // MT4 Standard Library
#include <stderror.mqh> // MT4 Standard Library

==================================================

Can you tell me why the comment appears?

 

because stdlib.mqh describes functions called from an external file (#import "stdlib.ex4")

===

//+------------------------------------------------------------------+
//| stdlib.mqh |
//+------------------------------------------------------------------+
#import "stdlib.ex4"

string ErrorDescription(int error_code);
int RGB(int red_value,int green_value,int blue_value);
bool CompareDoubles(double number1,double number2);
string DoubleToStrMorePrecision(double number,int precision);
string IntegerToHexString(int integer_number);

=====

don't use them? remove them from your EA...


#include <stdlib.mqh> // MT4 standard library
#include <stderror.mqh> // MT4 standard library


 
I see. Thank you.
 
leonid553:

#include <stdlib.mqh> // MT4 standard library
Can you tell me why the comment appears?

In this ashqh the import from the library with the same name. That's why it appears. This pc itself is safe.
 

I propose next to show suitable pairs for spread trading via the very handy FreeStockCharts service.

An example of such a pair:

The menu shows an item that allows you to make a direct hyperlink to the selected chart. For example, the above chart is located at http://www.freestockcharts.com?emailChartID=0fbb7f36-c3a3-46a4-ae19-da7ce6c136ec

The service is good in that it provides the history with the visualization of a huge number of financial instruments for free and directly in the browser. There are possibilities of superimposing several charts on top of each other.

Note the bottom blue bar. It is very useful. The implementation of such a tool for MT5 would be desirable, as well as the possibility of displaying the vertical axis in percentages.

P.S. The above chart perfectly shows that legs (weighting coefficients) of FI should be dynamic (adapt).

 

Can you post the code of the whole EA, if it's not a secret, because you are discussing it and I can't find it in this thread?

 
sammi61:

Can you post the code of the whole EA, if it's not a secret, because you are discussing it and I can't find it in this thread?


If you mean steam trailing, it is not the whole code. The Expert Advisor (the latest, simplest version) can be found at http://www.procapital.ru/showthread.php?t=28081&page=56 along with its description at 829-834.
 

Why is the topic closed?

why is no one there?

 
all went to the front
 
Not a grail. Consequently, everyone became uninterested. =)
Reason: