Любые вопросы новичков по MQL4 и MQL5, помощь и обсуждение по алгоритмам и кодам - страница 2541

 
Nagmetov #:

То есть избежать данной разницы никак нельзя?

Можно, но не факт что будет открытие ордера.

 

double price = iClose(_Symbol,PERIOD_CURRENT,1); 
    if(EnableBuy &&
      (myMovingAverageArray1[0] > myMovingAverageArray2[0]) &&
      (myMovingAverageArray1[1] < myMovingAverageArray2[1])&&SymbolInfoDouble(_Symbol,SYMBOL_ASK)==price)
     {
      Comment("Time - ", iTime(_Symbol,PERIOD_CURRENT,1), " Price - ", iClose(_Symbol,PERIOD_CURRENT,1));
      Alert("BUY Signal");
      if(trade.PositionOpen(_Symbol, ORDER_TYPE_BUY, LotSize, SymbolInfoDouble(_Symbol,SYMBOL_ASK), stopLoss, takeProfit))
        {
         tradeOpened = true;
         lastTradeBar = currentBar; 
        }
     }

   if(EnableSell &&
      (myMovingAverageArray1[0] < myMovingAverageArray2[0]) &&
      (myMovingAverageArray1[1] > myMovingAverageArray2[1])&&SymbolInfoDouble(_Symbol,SYMBOL_BID)==price)
     {
       Comment("Time - ", iTime(_Symbol,PERIOD_CURRENT,1), " Price - ", iClose(_Symbol,PERIOD_CURRENT,1));
      Alert("SELL Signal");
      if(trade.PositionOpen(_Symbol, ORDER_TYPE_SELL, LotSize,SymbolInfoDouble(_Symbol,SYMBOL_BID), stopLoss, takeProfit))
        {
         tradeOpened = true;
         lastTradeBar = currentBar; // Запоминаем номер бара
        }
     }
  }


 
Рaра Нoth #:
Это другие шрифты из интернета.В терминале их не будет 
А как тогда данный шрифт появляется у пользователя, который покупает данный продукт, если автор не дает возможности скачать этот шрифт?
 
W1nd ReD #:
А как тогда данный шрифт появляется у пользователя, который покупает данный продукт, если автор не дает возможности скачать этот шрифт?
Возможно шрифт встроен в продукт.
 
Рaра Нoth #:
Это другие шрифты из интернета.В терминале их не будет 

https://www.mql5.com/en/docs/constants/objectconstants/wingdings

Вот суда зайди. Там будут коды символов.
 
Tretyakov Rostyslav #:

Нет. Все прописывай те в OnInit()

Вот, что получилось

#property indicator_chart_window
#property indicator_buffers 12
#property indicator_plots   7
//--- plot ZigZag 
#property indicator_label1  "ZigZag"
#property indicator_type1   DRAW_SECTION
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  3
//--- plot 
#property indicator_type2   DRAW_ARROW
#property indicator_color2  clrWhite
#property indicator_width3  5
#property indicator_color3  clrLime
#property indicator_width3  2
#property indicator_color4  clrBlue //C'0,128,255'
#property indicator_width4  7
#property indicator_type4   DRAW_ARROW
#property indicator_color5  clrRed //C'192,0,192'
#property indicator_width5  7
#property indicator_type5   DRAW_ARROW
#property indicator_color6  clrDodgerBlue //C'0,128,255'
#property indicator_width6  3
#property indicator_type6   DRAW_ARROW
#property indicator_color7  clrMediumVioletRed //C'192,0,192'
#property indicator_width7  3
#property indicator_type7   DRAW_ARROW

sinput string  EA_Params = "-- Параметры ZigZag --"; 
input int      period=34;
sinput string  EA_Params = "-- Параметры Signals"; 
input int    SRZZ = 60;
input string AlertsSection = ""; // == Alerts ==
input bool     Popup_Alert              = true; // Popup message
input bool     Notification_Alert       = false; // Push notification
input bool     Play_Sound               = false; // Play sound on alert
input string   Sound_File               = ""; // Sound file
// Buffers Signals:
double Lmt[];
double LZZ[];
double SA[];
double SM[];
double Up[];
double Dn[];
double pUp[];
double pDn[];
//--- indicator buffers ZigZag
double ZigBuffer[], trend[],HighBar[],LowBar[];

//----------------------------------------------------------------   
int OnInit()
   SetIndexBuffer(0, Lmt, INDICATOR_DATA);
   PlotIndexSetInteger(0, PLOT_ARROW, 167);
   PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, 0);
   ArraySetAsSeries(Lmt, true);  
   
   SetIndexBuffer(1,ZigBuffer,INDICATOR_DATA);
   SetIndexBuffer(2, LZZ, INDICATOR_DATA);
   if (DrawZZ)
   {
      PlotIndexSetInteger(2, PLOT_DRAW_TYPE, DRAW_SECTION);
      PlotIndexSetDouble(2, PLOT_EMPTY_VALUE, 0);
   }
   else PlotIndexSetInteger(2, PLOT_DRAW_TYPE, DRAW_NONE);
   ArraySetAsSeries(LZZ, true);
   
   SetIndexBuffer(3, Up, INDICATOR_DATA);
   PlotIndexSetInteger(3, PLOT_ARROW, 233); // Green up arrow
   PlotIndexSetDouble(3, PLOT_EMPTY_VALUE, 0);
   ArraySetAsSeries(Up, true);

   SetIndexBuffer(4, Dn, INDICATOR_DATA);
   PlotIndexSetInteger(4, PLOT_ARROW, 234); // Green up arrow
   PlotIndexSetDouble(4, PLOT_EMPTY_VALUE, 0);
   ArraySetAsSeries(Dn, true);
   
   SetIndexBuffer(5, pUp, INDICATOR_DATA);
   PlotIndexSetInteger(5, PLOT_ARROW, 104); // Green up markers
   PlotIndexSetDouble(5, PLOT_EMPTY_VALUE, 0);
   ArraySetAsSeries(pUp, true);

   SetIndexBuffer(6, pDn, INDICATOR_DATA);
   PlotIndexSetInteger(6, PLOT_ARROW, 104); // Red down markers
   PlotIndexSetDouble(6, PLOT_EMPTY_VALUE, 0);
   ArraySetAsSeries(pDn, true);

   SetIndexBuffer(7, SA, INDICATOR_CALCULATIONS);
   ArraySetAsSeries(SA, true);
   SetIndexBuffer(8, SM, INDICATOR_CALCULATIONS);
   ArraySetAsSeries(SM, true);
//   
   SetIndexBuffer(9,trend,INDICATOR_CALCULATIONS);
   SetIndexBuffer(10,HighBar,INDICATOR_CALCULATIONS);
   SetIndexBuffer(11,LowBar,INDICATOR_CALCULATIONS);
   //--- set short name and digits
   
   if (SR < 2) SR = 2;
   if (SRZZ <= SR)
   {
      Alert("SRZZ should be greater than SR (", SR, ")");
      return(INIT_FAILED);
   }
 
Игорь #:

https://www.mql5.com/en/docs/constants/objectconstants/wingdings

Вот суда зайди. Там будут коды символов.

Так это не те. Мне нужно вот эти

Файлы:
 
Tretyakov Rostyslav #:
Возможно шрифт встроен в продукт.
А есть пример какого либо кода, где можно посмотреть, как это было реализовано?
 
W1nd ReD #:
А есть пример какого либо кода, где можно посмотреть, как это было реализовано?

В справке смотрите

#resource 

Я встраиваю  индикаторы

#define ind_name "Indicators\\Indicator.ex4"
#resource "\\"+ind_name
 
Еще вопрос к программистам. Если я эксперт разобъю на разные файлы #include созданные мною, то будет ли работать данный эксперт у пользователя, который его купил 
 
Tretyakov Rostyslav #:

В справке смотрите

Я встраиваю  индикаторы

Спасибо за ответ!