MQL4 및 MQL5에 대한 초보자 질문, 알고리즘 및 코드에 대한 도움말 및 토론 - 페이지 719

 
Artyom Trishkin :

OrderModify() 전에 시작 가격 과 새로운 중지 가격을 인쇄하십시오.

그리고 당신의 무례한 "아니요?" 도움이 필요하면 혼자 보관하십시오. 그러나 바로 이 스레드에서 모든 트롤에 대해 완벽하게 작동하는 템플릿을 게시했습니다. 검색할 수 있습니다.

무례한 "아니?" 죄송합니다. 여기에 아무것도 넣지 않았습니다.

 
         if ((fMarketOrderss( OP_SELL )>= 1 )) { 
       if ( (( Bid -Opens)/ma+Times/ 1440 ) > SELL ) {
if ( OrderSend ( Symbol (), OP_SELL , 0.01 , Bid , 3 , 0 , 0 , NULL , 321 , 0 , 1 )> 0 ){} }}

말하다! SELL 장소의 숫자가 순서대로 오도록 하려면 어떤 기능을 추가해야 할까요? 미결 거래가 있으면 거래가 설정됩니다. 이 거래가 열리는 방법은 2 등으로 설정됩니다. 트랜잭션이 없으면 이 수치는 0으로 재설정됩니다.

 
Artyom Trishkin :

OrderModify() 전에 시가와 새로운 정가의 값을 출력합니다.

같은 값을 씁니다. 그렇다면 !=에 대한 검사가 통과하는 이유를 말씀해 주시겠습니까?

 
Andrey Sokolov :

같은 값을 씁니다. 그렇다면 !=에 대한 검사가 통과하는 이유를 말씀해 주시겠습니까?

실수 비교 에 대해 읽어보세요.

 
Artyom Trishkin :

실수 비교 에 대해 읽어보세요.

나는 읽으러 갔다. 감사해요
 
Andrey Sokolov :
나는 읽으러 갔다. 감사해요

비교만 하지 말고 "이동할 때가 되지 않았나?", 즉 필요 이상인 것은 "n>=p"인지 확인한다.

 
Vitaly Muzichenko :

비교만 하지 말고 "이동할 때가 되지 않았나?", 즉 필요 이상인 것은 "n>=p"인지 확인한다.

감사해요
 
안녕하세요, 색상 레벨 표시기가 있습니다. 하나의 차트에 이 표시기 2개를 던지려고 할 때 문제가 발생합니다. 즉, 첫 번째 표시기의 창이 사라지고 두 번째 표시기의 창이 표시되고 객체 생성 - 직사각형, 2개의 객체가 생성됩니다. 하나는 하나의 표시기이고 두 번째는 다른 표시기입니다. 이 표시기의 여러 부분을 차트에서 사용할 수 있고 개체가 올바르게 작성되도록 이 문제를 어떻게 고칠 수 있습니까? 코드에서 무언가를 변경하거나 반대로 추가할 수 있습니까? 예시
파일:
 

내가 할 수 있는 최선을 다해 조립된 표시기
인덱스가 +/- 0.4% 영역에 있을 때 예를 들어 직사각형으로 막대를 강조 표시하는 데 도움이 필요합니다.
또는 적어도 코드 자체
내 지표 코드

 //+------------------------------------------------------------------+
//|                           Copyright © 2018, forex-time@mail.ru   |
//|                        Copyright © 2018, mr.aliaksei@yandex.ru   |
//|                                         % Алексея Королькова.mq4 |
//+------------------------------------------------------------------+
#property copyright    "Copyright © 2018, forex-time@mail.ru"
#property copyright    "Copyright © 2018, mr.aliaksei@yandex.ru"
#property link          "http://axe44.opentraders.ru/bio/"
#property version      "1.10"
#property strict 
//+------------------------------------------------------------------+
//--- indicator settings
#property   indicator_separate_window
#property   indicator_buffers 3
#property   indicator_color1   LimeGreen
#property   indicator_color2   Red
#property   indicator_color3   Blue
#property   indicator_width1    2
#property   indicator_width2    2
#property   indicator_width3    2
#property   indicator_level1    0.0
#property   indicator_levelcolor DarkGray
//--- indicator parameters
input int InpFastEMA= 14 ;   // Fast EMA Period
input int Metod     = 1 ;   // Metod EMA Period 0-3
input string Pereferics= "" ; // Переферикс после названия основной пары. Например EURUSD.m где переферикс .m
//--- indicator buffers
double Buffer1[];
double Buffer2[];
double Buffer3[];
//--- right input parameters flag
bool    ExtParameters= false ;
string IndName= "% A.K (" + IntegerToString (InpFastEMA)+ ")" ;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ( void )
  {
   IndicatorDigits ( Digits + 1 );
//--- drawing settings
   SetIndexBuffer ( 0 ,Buffer1); SetIndexStyle ( 0 , DRAW_LINE );
   SetIndexBuffer ( 1 ,Buffer2); SetIndexStyle ( 1 , DRAW_LINE );
   SetIndexBuffer ( 2 ,Buffer3); SetIndexStyle ( 2 , DRAW_LINE );

//--- name for DataWindow and indicator subwindow label
   IndicatorShortName (IndName);
//--- check for input parameters
   if (InpFastEMA<= 1   )
     {
       Print ( "Wrong input parameters" );
      ExtParameters= false ;
       return ( INIT_FAILED );
     }
   else
      ExtParameters= true ;
//--- initialization done
   return ( INIT_SUCCEEDED );
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
int OnCalculate ( const int rates_total,
                 const int prev_calculated,
                 const datetime & time[],
                 const double & open[],
                 const double & high[],
                 const double & low[],
                 const double & close[],
                 const long & tick_volume[],
                 const long & volume[],
                 const int & spread[])
  {
     int i = rates_total-prev_calculated- 1 ;

     while (i >= 0 )  
      {
       double eurusd=((( iMA ( "EURUSD" +Pereferics, 0 ,InpFastEMA, 0 ,Metod, 0 ,i)+ 1 )/( iMA ( "EURUSD" +Pereferics, 0 ,InpFastEMA, 0 ,Metod, 1 ,i)+ 1 ))- 1 )* 10000 ;
       double eurjpy=((( iMA ( "EURJPY" +Pereferics, 0 ,InpFastEMA, 0 ,Metod, 0 ,i)+ 1 )/( iMA ( "EURJPY" +Pereferics, 0 ,InpFastEMA, 0 ,Metod, 1 ,i)+ 1 ))- 1 )* 10000 ;
       double usdjpy=((( iMA ( "USDJPY" +Pereferics, 0 ,InpFastEMA, 0 ,Metod, 0 ,i)+ 1 )/( iMA ( "USDJPY" +Pereferics, 0 ,InpFastEMA, 0 ,Metod, 1 ,i)+ 1 ))- 1 )* 10000 ;
       double eur=(eurusd+eurjpy)/ 2 ;
       double usd=(-eurusd+usdjpy)/ 2 ;
       double jpy=-(usdjpy+eurjpy)/ 2 ;
      Buffer1[i]=ND(eur, 1 );
      Buffer2[i]=ND(usd, 1 );
      Buffer3[i]=ND(jpy, 1 );

      Pair(IndName+ "EUR" , "EUR" , 54 , indicator_color1 );
      Pair(IndName+ "USD" , "USD" , 28 , indicator_color2 );
      Pair(IndName+ "JPY" , "JPY" , 5 ,Blue);
                  
      i--;}
return (rates_total);}
//+------------------------------------------------------------------+
//|ND - нормализация числа                                           |
//-------------------------------------------------------------------+
double ND( double value, int digits) {  
       return ( NormalizeDouble (value, digits));}  
//+------------------------------------------------------------------+
void Pair( string name, string txt, int shift, color col){
       int window= WindowFind (IndName);
       //если окно не найдено - "текстовые метки" будут созданы в окне графика
       if (window< 0 ) window= 0 ;
       ObjectCreate (name, OBJ_LABEL ,window, 0 , 0 , 0 , 0 , 0 , 0 );
           ObjectSet (name, OBJPROP_CORNER , 0 );
           ObjectSet (name, OBJPROP_XDISTANCE ,shift);
           ObjectSet (name, OBJPROP_YDISTANCE , 2 );
           ObjectSet (name, OBJPROP_CORNER , CORNER_RIGHT_UPPER );
       ObjectSetText (name,txt, 8 , "Arial" ,col);}
//+------------------------------------------------------------------+

코드를 추천받았는데 첨부하는 방법을 모르겠습니다:

 ObjectCreate (VLINE, OBJ_VLINE , 0 , 0 , 0 );
ObjectSet (VLINE, OBJPROP_COLOR , VLINE_COLOR);
ObjectSet (VLINE, OBJPROP_STYLE , VLINE_STYLE);

ObjectDelete (VLINE);

if (Bf< 0.4 && Bf>(- 0.4 ))
ObjectSet (VLINE, VLINE, VLINE);

미리 감사드립니다.

 
대신 가능합니까?
높음/낮음>1.02 메이크
높음>낮음*1.02
표시기에 더 나은 옵션