오실레이터에 코드를 넣는 방법 - 페이지 9

 
Vladimir Karputov :

거짓말과 도발 :).

코드베이스의 RUSSIAN 부분에 대한 링크가 제공되었지만(ru 부분에는 버전 1.001의 파일이 있음) 어떤 이유로 코드베이스의 ENGLISH 부분에서 버전 1.000을 다운로드했습니다. 또한 기억하십시오: 각 코드에는 토론을 위한 특별한 주제가 있으며 코드에 대한 질문이 나오는 것은 특별한 주제에 있습니다.

명확히 해주세요 ... 링크를 다시 클릭했는데 버전이 하나뿐입니다 .. 아니면 그냥 농담하는 건가요 ??

 
스카이프를 원하면 내 말을 믿지 않으면 실수를 보여주세요
 
   else if(risk>0.0)
     {
      if(m_money!=NULL)
         delete m_money;
      m_money=new CMoneyFixedMargin;
      if(m_money!=NULL)
        {
         if(!m_money.Init(GetPointer(m_symbol),Period(),m_symbol.Point()*digits_adjust))
            return(INIT_FAILED);
         m_money.Percent(risk);
        }
      else
        {
         Print(__FUNCTION__,", ERROR: Object CMoneyFixedMargin is NULL");
         return(INIT_FAILED);
        }
     }
//---
   return(true);
  }
 
덕분에 다 찾았습니다
 

추가된 수준

   signal.AddFilter(filter0);
//--- Set filter parameters
   filter0.StochPeriodK(Signal__StochPeriodK);
   filter0.StochPeriodD(Signal__StochPeriodD);
   filter0.StochPeriodSlow(Signal__StochPeriodSlow);
   filter0.StochApplied(Signal__StochApplied);
   filter0.StochLevelUP(InpLevelUP);
   filter0.StochLevelDOWN(InpLevelDOWN);  
 //+------------------------------------------------------------------+
//|                                             expert_777_stoch.mq5 |
//|                        Copyright 2011, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2011, MetaQuotes Software Corp."
#property link        "http://www.mql5.com"
#property version    "1.00"
//+------------------------------------------------------------------+
//| Include                                                          |
//+------------------------------------------------------------------+
#include <Expert\Expert.mqh>
//--- available signals
#include "777_Stoch_M.mqh"
//--- available trailing
#include <Expert\Trailing\TrailingNone.mqh>
//--- available money management
#include <Expert\Money\MoneyFixedLot.mqh>
//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
//--- inputs for expert
input string          Expert_Title           = "Expert_777_Stoch" ; // Document name
ulong                 Expert_MagicNumber     = 19240 ;             //
bool                  Expert_EveryTick       = false ;             //
//--- inputs for main signal
input int             Signal_ThresholdOpen   = 10 ;                 // Signal threshold value to open [0...100]
input int             Signal_ThresholdClose  = 10 ;                 // Signal threshold value to close [0...100]
input double          Signal_PriceLevel      = 0.0 ;               // Price level to execute a deal
input double          Signal_StopLevel       = 90.0 ;               // Stop Loss level (in points)
input double          Signal_TakeLevel       = 36.0 ;               // Take Profit level (in points)
input int             Signal_Expiration      = 4 ;                 // Expiration of pending orders (in bars)
input int             Signal__StochPeriodK   = 5 ;                 // 777_Stoch(5,3,3,...)
input int             Signal__StochPeriodD   = 3 ;                 // 777_Stoch(5,3,3,...)
input int             Signal__StochPeriodSlow= 3 ;                 // 777_Stoch(5,3,3,...)
input ENUM_STO_PRICE Signal__StochApplied   = STO_LOWHIGH ;       // 777_Stoch(5,3,3,...)
input double          InpLevelUP             = 80 ;                 // Stochastic signal (level UP)
input double          InpLevelDOWN           = 20 ;                 // Stochastic signal (level DOWN)
//--- inputs for money
input double          Money_FixLot_Percent   = 10.0 ;               // Percent
input double          Money_FixLot_Lots      = 0.1 ;               // Fixed volume
//+------------------------------------------------------------------+
 от уровней 80 - 20  евро\бакс 30минут этот год






80 20

EURUSDM30

레벨 50 - 50 euro\bucks 올해 30분

50 50

파일:
 
그건 그렇고, 당신은 마법사 MQL5에 대한 자신의 거래 신호 모듈을 작성할 수 있습니다. 예: SignalMAAboveBelow 3 (이동 평균에 해당)이지만 각 지표에 대한 거래 신호 모듈을 작성할 수 있습니다.
SignalMAAboveBelow 3
SignalMAAboveBelow 3
  • www.mql5.com
Модуль торговых сигналов на базе модуля сигналов индикатора Moving Average.
 

오늘 저는 MQL5 Wizard 를 사용하여 Expert Advisor를 생성하는 방법을 공부하는 데 하루 종일 보냈습니다 . https://www.mql5.com/ru/articles/367

흥미로운 것

YROK 2

 //+------------------------------------------------------------------+
//|                                                       YROK 2.mq5 |
//|                                  Copyright 2021, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Ltd."
#property link        "https://www.mql5.com"
#property version    "1.00"
//+------------------------------------------------------------------+
//| Include                                                          |
//+------------------------------------------------------------------+
#include <Expert\Expert.mqh>
//--- available signals
#include "MOI YROK.mqh"
#include "SampleSignal.mqh"
//--- available trailing
#include <Expert\Trailing\TrailingNone.mqh>
//--- available money management
#include <Expert\Money\MoneyFixedLot.mqh>
//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
//--- inputs for expert
input string          Expert_Title             = "YROK 2" ;     // Document name
ulong                 Expert_MagicNumber       = 941 ;         //
bool                  Expert_EveryTick         = false ;       //
//--- inputs for main signal
input int             Signal_ThresholdOpen     = 10 ;           // Signal threshold value to open [0...100]
input int             Signal_ThresholdClose    = 10 ;           // Signal threshold value to close [0...100]
input double          Signal_PriceLevel        = 0.0 ;         // Price level to execute a deal
input double          Signal_StopLevel         = 50.0 ;         // Stop Loss level (in points)
input double          Signal_TakeLevel         = 50.0 ;         // Take Profit level (in points)
input int             Signal_Expiration        = 4 ;           // Expiration of pending orders (in bars)
input int             Signal__StochPeriodK     = 5 ;           // CCP_Stoch(5,3,3,STO_LOWHIGH,...)
input int             Signal__StochPeriodD     = 3 ;           // CCP_Stoch(5,3,3,STO_LOWHIGH,...)
input int             Signal__StochPeriodSlow  = 3 ;           // CCP_Stoch(5,3,3,STO_LOWHIGH,...)
input ENUM_STO_PRICE Signal__StochApplied     = STO_LOWHIGH ; // CCP_Stoch(5,3,3,STO_LOWHIGH,...)
input double          Signal__StochLevelUP     = 80 ;           // CCP_Stoch(5,3,3,STO_LOWHIGH,...)
input double          Signal__StochLevelDOWN   = 20 ;           // CCP_Stoch(5,3,3,STO_LOWHIGH,...)
input double          Signal__Weight           = 1.0 ;         // CCP_Stoch(5,3,3,STO_LOWHIGH,...) Weight [0...1.0]
input int             Signal_MaCross_FastPeriod= 13 ;           // My_MA_Cross(13,MODE_SMA,21,...) Period of fast MA
input ENUM_MA_METHOD Signal_MaCross_FastMethod= MODE_SMA ;     // My_MA_Cross(13,MODE_SMA,21,...) Method of fast MA
input int             Signal_MaCross_SlowPeriod= 21 ;           // My_MA_Cross(13,MODE_SMA,21,...) Period of slow MA
input ENUM_MA_METHOD Signal_MaCross_SlowMethod= MODE_SMA ;     // My_MA_Cross(13,MODE_SMA,21,...) Method of slow MA
input double          Signal_MaCross_Weight    = 1.0 ;         // My_MA_Cross(13,MODE_SMA,21,...) Weight [0...1.0]
//--- inputs for money
input double          Money_FixLot_Percent     = 10.0 ;         // Percent
input double          Money_FixLot_Lots        = 0.1 ;         // Fixed volume
//+------------------------------------------------------------------+
//| Global expert object                                             |
//+------------------------------------------------------------------+
CExpert ExtExpert;
//+------------------------------------------------------------------+
//| Initialization function of the expert                            |
//+------------------------------------------------------------------+
int OnInit ()
  {
//--- Initializing expert
   if (!ExtExpert.Init( Symbol (), Period (),Expert_EveryTick,Expert_MagicNumber))
     {
       //--- failed
       printf ( __FUNCTION__ + ": error initializing expert" );
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
//--- Creating signal
   CExpertSignal *signal= new CExpertSignal;
   if (signal== NULL )
     {
       //--- failed
       printf ( __FUNCTION__ + ": error creating signal" );
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
//---
   ExtExpert.InitSignal(signal);
   signal.ThresholdOpen(Signal_ThresholdOpen);
   signal.ThresholdClose(Signal_ThresholdClose);
   signal.PriceLevel(Signal_PriceLevel);
   signal.StopLevel(Signal_StopLevel);
   signal.TakeLevel(Signal_TakeLevel);
   signal.Expiration(Signal_Expiration);
//--- Creating filter CCP_Stoch
   CCP_Stoch *filter0= new CCP_Stoch;
   if (filter0== NULL )
     {
       //--- failed
       printf ( __FUNCTION__ + ": error creating filter0" );
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
   signal.AddFilter(filter0);
//--- Set filter parameters
   filter0.StochPeriodK(Signal__StochPeriodK);
   filter0.StochPeriodD(Signal__StochPeriodD);
   filter0.StochPeriodSlow(Signal__StochPeriodSlow);
   filter0.StochApplied(Signal__StochApplied);
   filter0.StochLevelUP(Signal__StochLevelUP);
   filter0.StochLevelDOWN(Signal__StochLevelDOWN);
   filter0.Weight(Signal__Weight);
//--- Creating filter MA_Cross
   MA_Cross *filter1= new MA_Cross;
   if (filter1== NULL )
     {
       //--- failed
       printf ( __FUNCTION__ + ": error creating filter1" );
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
   signal.AddFilter(filter1);
//--- Set filter parameters
   filter1.FastPeriod(Signal_MaCross_FastPeriod);
   filter1.FastMethod(Signal_MaCross_FastMethod);
   filter1.SlowPeriod(Signal_MaCross_SlowPeriod);
   filter1.SlowMethod(Signal_MaCross_SlowMethod);
   filter1.Weight(Signal_MaCross_Weight);
//--- Creation of trailing object
   CTrailingNone *trailing= new CTrailingNone;
   if (trailing== NULL )
     {
       //--- failed
       printf ( __FUNCTION__ + ": error creating trailing" );
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
//--- Add trailing to expert (will be deleted automatically))
   if (!ExtExpert.InitTrailing(trailing))
     {
       //--- failed
       printf ( __FUNCTION__ + ": error initializing trailing" );
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
//--- Set trailing parameters
//--- Creation of money object
   CMoneyFixedLot *money= new CMoneyFixedLot;
   if (money== NULL )
     {
       //--- failed
       printf ( __FUNCTION__ + ": error creating money" );
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
//--- Add money to expert (will be deleted automatically))
   if (!ExtExpert.InitMoney(money))
     {
       //--- failed
       printf ( __FUNCTION__ + ": error initializing money" );
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
//--- Set money parameters
   money.Percent(Money_FixLot_Percent);
   money.Lots(Money_FixLot_Lots);
//--- Check all trading objects parameters
   if (!ExtExpert.ValidationSettings())
     {
       //--- failed
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
//--- Tuning of all necessary indicators
   if (!ExtExpert.InitIndicators())
     {
       //--- failed
       printf ( __FUNCTION__ + ": error initializing indicators" );
      ExtExpert.Deinit();
       return ( INIT_FAILED );
     }
//--- ok
   return ( INIT_SUCCEEDED );
  }
//+------------------------------------------------------------------+
//| Deinitialization function of the expert                          |
//+------------------------------------------------------------------+
void OnDeinit ( const int reason)
  {
   ExtExpert.Deinit();
  }
//+------------------------------------------------------------------+
//| "Tick" event handler function                                    |
//+------------------------------------------------------------------+
void OnTick ()
  {
   ExtExpert. OnTick ();
  }
//+------------------------------------------------------------------+
//| "Trade" event handler function                                   |
//+------------------------------------------------------------------+
void OnTrade ()
  {
   ExtExpert. OnTrade ();
  }
//+------------------------------------------------------------------+
//| "Timer" event handler function                                   |
//+------------------------------------------------------------------+
void OnTimer ()
  {
   ExtExpert. OnTimer ();
  }
//+------------------------------------------------------------------+
Создай торгового робота за 6 шагов!
Создай торгового робота за 6 шагов!
  • www.mql5.com
Вы не знаете, как устроены торговые классы, и пугаетесь слов "Объектно-ориентированное программирование"? На самом деле вовсе не обязательно всё это знать, чтобы написать свой собственный модуль торговых сигналов - достаточно следовать простым правилам. Всё остальное сделает Мастер MQL5, и вы получите готовый торговый робот!
파일:
YROK_2.zip  11 kb
 
Vladimir Karputov :
그건 그렇고, 당신은 마법사 MQL5에 대한 자신의 거래 신호 모듈을 작성할 수 있습니다. 예: SignalMAAboveBelow 3 (이동 평균에 해당)이지만 각 지표에 대한 거래 신호 모듈을 작성할 수 있습니다.

고맙습니다! 링크를 위해

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

귀하의 거래 모듈   신호 - 감사합니다!

SignalMAA위 3 미만

 

여기에서 나는 표준 클래스에서 입력하여 반나절을 죽였습니다. 그것은 나쁜 클래스와 전문가가 아닌 것으로 나타났습니다.

----------------------

MQL5\Include\Expert\Signal\에 이 파일을 설치해야 합니다.

그런 다음 이것으로 전문가를 만드십시오.

YROK 4

YROK 4hhhh

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\

파일이 폴더에 설치된 후 - 메타 편집기를 다시 로드하십시오.

파일: