MQL4 및 MQL5에 대한 초보자 질문, 알고리즘 및 코드에 대한 도움말 및 토론 - 페이지 305 1...298299300301302303304305306307308309310311312...1953 새 코멘트 Alexey Viktorov 2017.09.08 09:02 #3041 mila.com : 고맙지만 null을 반환합니다. 이유는 무엇입니까? 그리고 다른 것은 있을 수 없습니다. 1970년보다 작은 컴퓨터는 없습니다. 브로커가 나열한 연도부터 시작하십시오. Vitaly Muzichenko 2017.09.08 09:40 #3042 Alexey Viktorov : 그리고 다른 것은 있을 수 없습니다. 1970년보다 작은 컴퓨터는 없습니다. 브로커가 나열한 연도부터 시작하십시오. 뭐, 보통은 정해져 있어, 우리 시대의 원년) Alexey Viktorov 2017.09.08 10:11 #3043 Vitaly Muzichenko : 뭐, 보통은 정해져 있어, 우리 시대의 원년) A -1은 BC 첫 해가 됩니다. Aleksey Vyazmikin 2017.09.08 17:00 #3044 Artyom Trishkin : CopyXXX() 사용 고맙습니다. MT5에서는 다음과 같이 차트를 이동할 수 있습니다. PlotIndexSetInteger(0,PLOT_SHIFT,InpChannelPeriod); MT4에서 컴파일하면 오류가 발생하지 않지만 아무 것도 작동하지 않습니다. MT4에 대한 아날로그가 있습니까? Alexey Viktorov 2017.09.08 17:17 #3045 Aleksey Vyazmikin : 고맙습니다. MT5에서는 다음과 같이 차트를 이동할 수 있습니다. PlotIndexSetInteger(0,PLOT_SHIFT,InpChannelPeriod); MT4에서 컴파일하면 오류가 발생하지 않지만 아무 것도 작동하지 않습니다. MT4에 대한 아날로그가 있습니까? Пользовательские индикаторы - Справочник MQL4 docs.mql4.com Пользовательские индикаторы - Справочник MQL4 Aleksey Vyazmikin 2017.09.08 18:00 #3046 Alexey Viktorov : 거기 선택 SetIndexShift(0,InpChannelPeriod); 그러나 효과는 상당히 다릅니다. 코드가 작동하지 않고 논리가 다른 곳에 있습니다 - xs ... Aleksey Vyazmikin 2017.09.08 18:12 #3047 누군가가 도움이 될 수 있습니다. 표시기의 본질은 평소와 같이 Donchian 채널 을 그린 다음 마지막 채널 값의 선을 음수 막대 뒤로 이동하는 것입니다. MT5에서는 다 잘 되는 것 같은데 MT4에서는 뭐가 잘못된건지 이해가 안가서 여기 저기 보냈는데 이단이 되네요. 값 계산은 따로 하긴 하지만 채널 자체를 옮깁니다 이동됩니다.... //+------------------------------------------------------------------+ //| Donchian_Channel.mq5 | //+------------------------------------------------------------------+ #property copyright "Vyazmikin Aleksey Vyacheslavovich" #property link "https://www.mql5.com/ru/users/-aleks-" #property version "1.00" #property strict #property indicator_chart_window #property indicator_buffers 2 #property indicator_plots 2 //--- plot Label1 #property indicator_label1 "High_Prognoz" ; #property indicator_type1 DRAW_LINE ; #property indicator_color1 clrAquamarine ; #property indicator_style1 STYLE_DOT ; #property indicator_width1 1 ; //--- plot Label2 #property indicator_label2 "Low_Prognoz" ; #property indicator_type2 DRAW_LINE ; #property indicator_color2 clrAquamarine ; #property indicator_style2 STYLE_DOT ; #property indicator_width2 1 ; //--- input parameters input int InpChannelPeriod= 48 ; // Period //--- indicator buffers double ExtHighBufferPrognoz[]; double ExtLowBufferPrognoz[]; //--- int i,limit,start; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit () { //--- indicator buffers mapping SetIndexBuffer ( 0 ,ExtHighBufferPrognoz, INDICATOR_DATA ); SetIndexBuffer ( 1 ,ExtLowBufferPrognoz, INDICATOR_DATA ); //--- set accuracy IndicatorSetInteger ( INDICATOR_DIGITS , _Digits ); //--- set first bar from what index will be drawn SetIndexDrawBegin ( 0 ,InpChannelPeriod); SetIndexDrawBegin ( 1 ,InpChannelPeriod); SetIndexShift ( 0 ,InpChannelPeriod); SetIndexShift ( 1 ,InpChannelPeriod); //--- return ( 0 ); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ 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[]) { //--- check for rates if (rates_total<InpChannelPeriod* 2 ) return ( 0 ); //--- preliminary calculations if (prev_calculated== 0 ) limit=InpChannelPeriod; else limit=prev_calculated; //--- the main loop of calculations for (i=limit;i<rates_total && ! IsStopped ();i++) { start=i-InpChannelPeriod; ExtHighBufferPrognoz[i-InpChannelPeriod]=high[ ArrayMaximum (high,InpChannelPeriod,start)]; ExtLowBufferPrognoz[i-InpChannelPeriod] =low[ ArrayMinimum (low,InpChannelPeriod,start)]; } for ( int x=rates_total-InpChannelPeriod;x<rates_total && ! IsStopped ();x++) { ExtHighBufferPrognoz[x]=ExtHighBufferPrognoz[rates_total-InpChannelPeriod]; ExtLowBufferPrognoz[x]=ExtLowBufferPrognoz[rates_total-InpChannelPeriod]; } //--- return value of prev_calculated for next call return (rates_total); } Alexey Viktorov 2017.09.08 18:48 #3048 Aleksey Vyazmikin : 누군가가 도움이 될 수 있습니다. 표시기의 본질은 평소와 같이 Donchian 채널을 그린 다음 마지막 채널 값의 선을 음수 막대 뒤로 이동하는 것입니다. MT5에서는 다 잘 되는 것 같은데 MT4에서는 뭐가 잘못된건지 이해가 안가서 여기 저기 보냈는데 이단이 되네요. 값 계산은 따로 하긴 하지만 채널 자체를 옮깁니다 이동됩니다.... 음, 악어 코드를 보세요. 교대가 거기에서 작동합니다. 그러나 아마도 논리가 다를 수 있습니다. Aleksey Vyazmikin 2017.09.08 20:04 #3049 Alexey Viktorov : 음, 악어 코드를 보세요. 교대가 거기에서 작동합니다. 그러나 아마도 논리가 다를 수 있습니다. 예, 교대 근무도 작동합니다. 배열을 시프트로 채우지만 채우기는 시프트가 없는 것처럼 보이지만 시프트 자체는 시각적으로 발생합니다. 코드의 첫 번째 부분은 마지막 막대에서 InpChannelPeriod 깊이까지 버퍼를 비워 둡니다. for (i=limit;i<rates_total && ! IsStopped ();i++) { start=i-InpChannelPeriod; ExtHighBufferPrognoz[i-InpChannelPeriod]=high[ ArrayMaximum (high,InpChannelPeriod,start)]; ExtLowBufferPrognoz[i-InpChannelPeriod] =low[ ArrayMinimum (low,InpChannelPeriod,start)]; } 그리고 두 번째 부분은 다음 전에 이 섹션을 채워야 합니다. for ( int x=rates_total-InpChannelPeriod;x<rates_total && ! IsStopped ();x++) { ExtHighBufferPrognoz[x]=ExtHighBufferPrognoz[rates_total-InpChannelPeriod]; ExtLowBufferPrognoz[x]=ExtLowBufferPrognoz[rates_total-InpChannelPeriod]; } 그러나 실제로는 다음과 같이 진행됩니다. Aleksey Vyazmikin 2017.09.08 20:09 #3050 MT5의 코드 #property strict #property indicator_chart_window #property indicator_buffers 2 #property indicator_plots 2 //--- plot Label1 #property indicator_label1 "Predicted_high_price"; #property indicator_type1 DRAW_LINE; #property indicator_color1 clrAquamarine; #property indicator_style1 STYLE_DOT; #property indicator_width1 1; //--- plot Label2 #property indicator_label2 "Predicted_low_price"; #property indicator_type2 DRAW_LINE; #property indicator_color2 clrAquamarine; #property indicator_style2 STYLE_DOT; #property indicator_width2 1; //--- input parameters input int InpChannelPeriod=48; // Period //--- indicator buffers double ExtHighBufferPrognoz[]; double ExtLowBufferPrognoz[]; //--- int i,limit,start; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,ExtHighBufferPrognoz,INDICATOR_DATA); SetIndexBuffer(1,ExtLowBufferPrognoz,INDICATOR_DATA); //--- set accuracy IndicatorSetInteger(INDICATOR_DIGITS,_Digits); //--- set first bar from what index will be drawn PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,InpChannelPeriod); PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,InpChannelPeriod); PlotIndexSetInteger(0,PLOT_SHIFT,InpChannelPeriod); PlotIndexSetInteger(1,PLOT_SHIFT,InpChannelPeriod); //--- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ 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[]) { //--- check for rates if(rates_total<InpChannelPeriod) return(0); //--- preliminary calculations if(prev_calculated==0) limit=InpChannelPeriod; else limit=prev_calculated; //--- the main loop of calculations for(i=limit;i<rates_total && !IsStopped();i++) { start=i-InpChannelPeriod; ExtHighBufferPrognoz[i-InpChannelPeriod]=high[ArrayMaximum(high,start,InpChannelPeriod)]; ExtLowBufferPrognoz[i-InpChannelPeriod]=low[ArrayMinimum(low,start,InpChannelPeriod)]; } for(int x=rates_total-InpChannelPeriod;x<rates_total && !IsStopped();x++) { //int calc=x--; ExtHighBufferPrognoz[x]=ExtHighBufferPrognoz[rates_total-InpChannelPeriod-1]; ExtLowBufferPrognoz[x]=ExtLowBufferPrognoz[rates_total-InpChannelPeriod-1]; } //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+ 결과: ZY: 코드가 변경되었습니다. ME가 변경되지 않았습니다. 1...298299300301302303304305306307308309310311312...1953 새 코멘트 트레이딩 기회를 놓치고 있어요: 무료 트레이딩 앱 복사용 8,000 이상의 시그널 금융 시장 개척을 위한 경제 뉴스 등록 로그인 공백없는 라틴 문자 비밀번호가 이 이메일로 전송될 것입니다 오류 발생됨 Google으로 로그인 웹사이트 정책 및 이용약관에 동의합니다. 계정이 없으시면, 가입하십시오 MQL5.com 웹사이트에 로그인을 하기 위해 쿠키를 허용하십시오. 브라우저에서 필요한 설정을 활성화하시지 않으면, 로그인할 수 없습니다. 사용자명/비밀번호를 잊으셨습니까? Google으로 로그인
고맙지만 null을 반환합니다. 이유는 무엇입니까?
그리고 다른 것은 있을 수 없습니다. 1970년보다 작은 컴퓨터는 없습니다. 브로커가 나열한 연도부터 시작하십시오.
그리고 다른 것은 있을 수 없습니다. 1970년보다 작은 컴퓨터는 없습니다. 브로커가 나열한 연도부터 시작하십시오.
뭐, 보통은 정해져 있어, 우리 시대의 원년)
뭐, 보통은 정해져 있어, 우리 시대의 원년)
CopyXXX() 사용
고맙습니다.
MT5에서는 다음과 같이 차트를 이동할 수 있습니다.
PlotIndexSetInteger(0,PLOT_SHIFT,InpChannelPeriod);
고맙습니다.
MT5에서는 다음과 같이 차트를 이동할 수 있습니다.
PlotIndexSetInteger(0,PLOT_SHIFT,InpChannelPeriod);
거기 선택
SetIndexShift(0,InpChannelPeriod);
누군가가 도움이 될 수 있습니다. 표시기의 본질은 평소와 같이 Donchian 채널 을 그린 다음 마지막 채널 값의 선을 음수 막대 뒤로 이동하는 것입니다.
MT5에서는 다 잘 되는 것 같은데 MT4에서는 뭐가 잘못된건지 이해가 안가서 여기 저기 보냈는데 이단이 되네요. 값 계산은 따로 하긴 하지만 채널 자체를 옮깁니다 이동됩니다....
누군가가 도움이 될 수 있습니다. 표시기의 본질은 평소와 같이 Donchian 채널을 그린 다음 마지막 채널 값의 선을 음수 막대 뒤로 이동하는 것입니다.
MT5에서는 다 잘 되는 것 같은데 MT4에서는 뭐가 잘못된건지 이해가 안가서 여기 저기 보냈는데 이단이 되네요. 값 계산은 따로 하긴 하지만 채널 자체를 옮깁니다 이동됩니다....
음, 악어 코드를 보세요. 교대가 거기에서 작동합니다. 그러나 아마도 논리가 다를 수 있습니다.
음, 악어 코드를 보세요. 교대가 거기에서 작동합니다. 그러나 아마도 논리가 다를 수 있습니다.
예, 교대 근무도 작동합니다.
배열을 시프트로 채우지만 채우기는 시프트가 없는 것처럼 보이지만 시프트 자체는 시각적으로 발생합니다.
코드의 첫 번째 부분은 마지막 막대에서 InpChannelPeriod 깊이까지 버퍼를 비워 둡니다.
그리고 두 번째 부분은 다음 전에 이 섹션을 채워야 합니다.
그러나 실제로는 다음과 같이 진행됩니다.
MT5의 코드
#property strict #property indicator_chart_window #property indicator_buffers 2 #property indicator_plots 2 //--- plot Label1 #property indicator_label1 "Predicted_high_price"; #property indicator_type1 DRAW_LINE; #property indicator_color1 clrAquamarine; #property indicator_style1 STYLE_DOT; #property indicator_width1 1; //--- plot Label2 #property indicator_label2 "Predicted_low_price"; #property indicator_type2 DRAW_LINE; #property indicator_color2 clrAquamarine; #property indicator_style2 STYLE_DOT; #property indicator_width2 1; //--- input parameters input int InpChannelPeriod=48; // Period //--- indicator buffers double ExtHighBufferPrognoz[]; double ExtLowBufferPrognoz[]; //--- int i,limit,start; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,ExtHighBufferPrognoz,INDICATOR_DATA); SetIndexBuffer(1,ExtLowBufferPrognoz,INDICATOR_DATA); //--- set accuracy IndicatorSetInteger(INDICATOR_DIGITS,_Digits); //--- set first bar from what index will be drawn PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,InpChannelPeriod); PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,InpChannelPeriod); PlotIndexSetInteger(0,PLOT_SHIFT,InpChannelPeriod); PlotIndexSetInteger(1,PLOT_SHIFT,InpChannelPeriod); //--- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ 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[]) { //--- check for rates if(rates_total<InpChannelPeriod) return(0); //--- preliminary calculations if(prev_calculated==0) limit=InpChannelPeriod; else limit=prev_calculated; //--- the main loop of calculations for(i=limit;i<rates_total && !IsStopped();i++) { start=i-InpChannelPeriod; ExtHighBufferPrognoz[i-InpChannelPeriod]=high[ArrayMaximum(high,start,InpChannelPeriod)]; ExtLowBufferPrognoz[i-InpChannelPeriod]=low[ArrayMinimum(low,start,InpChannelPeriod)]; } for(int x=rates_total-InpChannelPeriod;x<rates_total && !IsStopped();x++) { //int calc=x--; ExtHighBufferPrognoz[x]=ExtHighBufferPrognoz[rates_total-InpChannelPeriod-1]; ExtLowBufferPrognoz[x]=ExtLowBufferPrognoz[rates_total-InpChannelPeriod-1]; } //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+결과:

ZY: 코드가 변경되었습니다. ME가 변경되지 않았습니다.