Как вставить свой индикатор? - страница 2

 
ребят спасибо за советы но я пытаюсь впарить индюк forex_glaz
Aleksandr Klapatyuk:

если есть настройки индикатора - то да!

как в индикаторе с верху в низ - по очереди в( тут)

это как? можно плиз по русски а то я полный чайник в этом дела!!!!

делаю методом тыка!

 
Aleksandr Klapatyuk:

попробуйте в эксперт MACD Sample.mq5 который в терминале - вложить свой индикатор

тут можно пробовать - или  iMACD заработает или на iMA

а про период тут где???????????

 
Aleksandr Klapatyuk:

это наверное

- не запустит код ,без этого файла . будет выдавать ошибку  

Правда что-ли?

 
а что там должно в коде индюка быть?
 
Сергей Дыбленко:
ребят спасибо за советы но я пытаюсь впарить индюк forex_glaz

это как? можно плиз по русски а то я полный чайник в этом дела!!!!

делаю методом тыка!

Я такой же - учусь методом тыка .

я не умею объяснять - Извини ! но можно будет тебе всё понять - когда ты попробуешь методом тыка , разобраться как работает - этот эксперт

//+------------------------------------------------------------------+
//|                                                  MACD Sample.mq5 |
//|                   Copyright 2009-2017, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright   "Copyright 2009-2017, MetaQuotes Software Corp."
#property link        "http://www.mql5.com"
#property version     "5.50"
#property description "It is important to make sure that the expert works with a normal"
#property description "chart and the user did not make any mistakes setting input"
#property description "variables (Lots, TakeProfit, TrailingStop) in our case,"
#property description "we check TakeProfit on a chart of more than 2*trend_period bars"

#define MACD_MAGIC 1234502
//---
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>
#include <Trade\PositionInfo.mqh>
#include <Trade\AccountInfo.mqh>
//---
input double InpLots          =0.1; // Lots
input int    InpTakeProfit    =50;  // Take Profit (in pips)
input int    InpTrailingStop  =30;  // Trailing Stop Level (in pips)
input int    InpMACDOpenLevel =3;   // MACD open level (in pips)
input int    InpMACDCloseLevel=2;   // MACD close level (in pips)
input int    InpMATrendPeriod =26;  // MA trend period
//---
int ExtTimeOut=10; // time out in seconds between trade operations
//+------------------------------------------------------------------+

 MACD Sample.mq5 - он у тебя в терминале есть   

 

вот тут сигнал на BUY

//+------------------------------------------------------------------+
//| Check for long position opening                                  |
//+------------------------------------------------------------------+
bool CSampleExpert::LongOpened(void)
  {
   bool res=false;
//--- check for long position (BUY) possibility
   if(m_macd_current<0)   здесь можно удалить здесь можно удалить-------------------------------




      if(m_macd_current>m_signal_current)

так будет работать - от зигзага 

      if(m_macd_current>m_signal_current && m_macd_previous<m_signal_previous) здесь можно удалить здесь можно удалить------------------          if(MathAbs(m_macd_current)>(m_macd_open_level) && m_ema_current>m_ema_previous) здесь можно удалить здесь можно удалить----------------------            {             double price=m_symbol.Ask();             double tp   =m_symbol.Bid()+m_take_profit;             //--- check for free money             if(m_account.FreeMarginCheck(Symbol(),ORDER_TYPE_BUY,InpLots,price)<0.0)                printf("We have no money. Free Margin = %f",m_account.FreeMargin());             else               {                //--- open position                if(m_trade.PositionOpen(Symbol(),ORDER_TYPE_BUY,InpLots,price,0.0,tp))                   printf("Position by %s to be opened",Symbol());                else                  {                   printf("Error opening BUY position by %s : '%s'",Symbol(),m_trade.ResultComment());                   printf("Open parameters : price=%f,TP=%f",price,tp);                  }               }             //--- in any case we must exit from expert             res=true;            } //--- result    return(res);   } //+------------------------------------------------------------------+
 
Aleksandr Klapatyuk:

вот тут сигнал на BUY

вот я переделал - по-другому

//+------------------------------------------------------------------+
//| Check for long position opening                                  |
//+------------------------------------------------------------------+
bool CSampleExpert::LongOpened(void)
  {
   bool res=false;
//--- check for long position (BUY) possibility
   if(!Revers)
     {
      if(m_macd_current<m_signal_current)
        {
         for(uint i=0; i<maxLimits; i++)
           {
            TradeBuy(InpLots,false);
           }
         //--- in any case we must exit from expert
         res=true;
        }
     }
//--- check for long position (BUY) possibility
   if(Revers)
     {
      if(m_macd_current>m_signal_current)
        {
         for(uint i=0; i<maxLimits; i++)
           {
            TradeBuy(InpLots,false);
           }
         //--- in any case we must exit from expert
         res=true;
        }
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+

      if(m_macd_current>m_signal_current)

так будет работать - от зигзага 
 

 
так  наверное будет лучше и в разы понятнее............
Файлы:
Trend.mq4  15 kb
forex_glaz.mq4  80 kb
 
Сергей Дыбленко:
так  наверное будет лучше и в разы понятнее............
Тренд это робот а глаз это индюк
 

у тебя мт4 - а я на мт5 . у нас нечего не получится . 

у них разные коды . Извини! но я не смогу тебе помочь