코딩 도움말 - 페이지 384

 

컴파일할 때 오류/경고가 표시됩니다. 누군가가 이것을 최신 MT4 빌드와 호환되도록 만들 수 있습니까? 이 오류가 큰 문제가 아닌 한...

많은 감사

즈보즈만

파일:
 
jbozman:
컴파일할 때 오류/경고가 표시됩니다. 누군가가 이것을 최신 MT4 빌드와 호환되도록 만들 수 있습니까? 이 오류가 큰 문제가 아닌 한...

많은 감사

즈보즈만

즈보즈만

지금 사용해보십시오 : price_lines_jlmv_1.mq4

파일:
 
mladen:
jbozman 지금 사용해보십시오 : price_lines_jlmv_1.mq4

오류가 없습니다. 컴파일되고 괜찮아 보입니다. 당신은 바위.

제이

 

도와주세요 ... 컴파일하면 ... 오류가 없습니다

그러나 Expert Tab 메타 트레이더에는 오류가 있습니다.

2014.11.02 15:20:17.495 array out of range in '#MTF__B.mq4' (84,25)[/PHP]

[PHP]

//+------------------------------------------------------------------+

//| #MTF__B.mq4 |

//| Copyright 2014, MetaQuotes Software Corp. |

//| https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright 2014, MetaQuotes Software Corp."

#property link "https://www.mql5.com"

#property version "1.00"

#property strict

#property indicator_chart_window

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 clrDodgerBlue

#property indicator_color2 clrDeepPink

#property indicator_width1 0

#property indicator_width2 0

//---- input parameters

/*************************************************************************

PERIOD_M1 1

PERIOD_M5 5

PERIOD_M15 15

PERIOD_M30 30

PERIOD_H1 60

PERIOD_H4 240

PERIOD_D1 1440

PERIOD_W1 10080

PERIOD_MN1 43200

You must use the numeric value of the timeframe that you want to use

when you set the TimeFrame' value with the indicator inputs.

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

PRICE_CLOSE 0 Close price.

PRICE_OPEN 1 Open price.

PRICE_HIGH 2 High price.

PRICE_LOW 3 Low price.

PRICE_MEDIAN 4 Median price, (high+low)/2.

PRICE_TYPICAL 5 Typical price, (high+low+close)/3.

PRICE_WEIGHTED 6 Weighted close price, (high+low+close+close)/4.

You must use the numeric value of the Applied Price that you want to use

when you set the 'applied_price' value with the indicator inputs.

**************************************************************************/

extern int TimeFrame=30;

extern int barn=1000;

double ExtMapBuffer1[];

double ExtMapBuffer2[];

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicator line

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(0,DRAW_ARROW,0,5);

SetIndexStyle(1,DRAW_ARROW,0,5);

SetIndexArrow(0,158);

SetIndexArrow(1,158);

return(0);

}

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

int start()

{

datetime TimeArray[];

int i,limit,y=0,counted_bars=IndicatorCounted();

// Plot defined time frame on to current time frame

ArrayCopySeries(TimeArray,MODE_TIME,NULL,TimeFrame);

limit=Bars-counted_bars;

for(i=0,y=0;i<limit;i++)

{

if (Time<TimeArray[y]) y++; ///// line of error here ...

/***********************************************************

Add your main indicator loop below. You can reference an existing

indicator with its iName or iCustom.

Rule 1: Add extern inputs above for all neccesary values

Rule 2: Use 'TimeFrame' for the indicator time frame

Rule 3: Use 'y' for your indicator's shift value

**********************************************************/

ExtMapBuffer1=iCustom(NULL,TimeFrame,"indicator",1,4,0,y) ;

ExtMapBuffer2=iCustom(NULL,TimeFrame,"indicator",1,4,1,y) ;

}

//

return(0);

}

//+------------------------------------------------------------------+

감사해요

 
rizkyd:
도와주세요 ... 컴파일하면 ... 오류가 없습니다

그러나 Expert Tab 메타 트레이더에는 오류가 있습니다.

2014.11.02 15:20:17.495 array out of range in '#MTF__B.mq4' (84,25)[/PHP]

[PHP]

//+------------------------------------------------------------------+

//| #MTF__B.mq4 |

//| Copyright 2014, MetaQuotes Software Corp. |

//| https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright 2014, MetaQuotes Software Corp."

#property link "https://www.mql5.com"

#property version "1.00"

#property strict

#property indicator_chart_window

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 clrDodgerBlue

#property indicator_color2 clrDeepPink

#property indicator_width1 0

#property indicator_width2 0

//---- input parameters

/*************************************************************************

PERIOD_M1 1

PERIOD_M5 5

PERIOD_M15 15

PERIOD_M30 30

PERIOD_H1 60

PERIOD_H4 240

PERIOD_D1 1440

PERIOD_W1 10080

PERIOD_MN1 43200

You must use the numeric value of the timeframe that you want to use

when you set the TimeFrame' value with the indicator inputs.

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

PRICE_CLOSE 0 Close price.

PRICE_OPEN 1 Open price.

PRICE_HIGH 2 High price.

PRICE_LOW 3 Low price.

PRICE_MEDIAN 4 Median price, (high+low)/2.

PRICE_TYPICAL 5 Typical price, (high+low+close)/3.

PRICE_WEIGHTED 6 Weighted close price, (high+low+close+close)/4.

You must use the numeric value of the Applied Price that you want to use

when you set the 'applied_price' value with the indicator inputs.

**************************************************************************/

extern int TimeFrame=30;

extern int barn=1000;

double ExtMapBuffer1[];

double ExtMapBuffer2[];

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicator line

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(0,DRAW_ARROW,0,5);

SetIndexStyle(1,DRAW_ARROW,0,5);

SetIndexArrow(0,158);

SetIndexArrow(1,158);

return(0);

}

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

int start()

{

datetime TimeArray[];

int i,limit,y=0,counted_bars=IndicatorCounted();

// Plot defined time frame on to current time frame

ArrayCopySeries(TimeArray,MODE_TIME,NULL,TimeFrame);

limit=MathMin(Bars-counted_bars,Bars-1);

for(i=0,y=0;i<limit;i++)

{

if (Time<TimeArray[y]) y++; ///// line of error here ...

/***********************************************************

Add your main indicator loop below. You can reference an existing

indicator with its iName or iCustom.

Rule 1: Add extern inputs above for all neccesary values

Rule 2: Use 'TimeFrame' for the indicator time frame

Rule 3: Use 'y' for your indicator's shift value

**********************************************************/

ExtMapBuffer1=iCustom(NULL,TimeFrame,"indicator",1,4,0,y) ;

ExtMapBuffer2=iCustom(NULL,TimeFrame,"indicator",1,4,1,y) ;

}

//

return(0);

}

//+------------------------------------------------------------------+

감사해요

이 줄을 바꿔보십시오

limit=막대-counted_bars;

이것으로 :

limit=MathMin(MathMax(막대 계산_막대,2*TimeFrame/Period()),막대-1);

 
mladen:
이 줄을 바꿔보십시오

limit=막대-counted_bars;

이것으로 :

limit=MathMin(MathMax(막대 계산_막대,2*TimeFrame/Period()),막대-1);

감사합니다

 

안녕 믈라덴

이 EA를 코딩하는 데 문제가 있습니다. 항목 규칙 이 전에 한 번도 해본 적이 없기 때문입니다.

예를 들어 이 거래에서는 녹색 화살표와 빨간색 화살표가 동시에 나타나므로 진입 규칙을 작성하는 것이 간단합니다. 그래서 다음 양초가 열리면 매도 포지션을 취합니다.

그러나 이 다음 예에서는 먼저 빨간색 화살표가 없는 녹색 화살표를 얻습니다. 그래서 저는 빨간 화살표가 나타날 때까지 거래를 하지 않습니다. 게다가 녹색 화살표 뒤와 빨간색 화살표 이전에 있는 모든 양초는 UP이어야 합니다. 그렇지 않으면 유효한 거래가 아니기 때문입니다.

도대체 이 특정 규칙을 어떻게 코딩합니까? 현재 촛불에 대해 코딩하는 방법을 알고 있지만 이러한 조건을 지정하는 방법을 모르겠습니다. 어떤 도움이라도 좋을 것입니다!

파일:
capture1.jpg  19 kb
capture.jpg  22 kb
 
Jason2005:
안녕 믈라덴

이 EA를 코딩하는 데 문제가 있습니다. 항목 규칙이 전에 한 번도 해본 적이 없기 때문입니다.

예를 들어 이 거래에서는 녹색 화살표와 빨간색 화살표가 동시에 나타나므로 진입 규칙을 작성하는 것이 간단합니다. 따라서 다음 양초가 열리면 매도 포지션을 취합니다.

그러나 이 다음 예에서는 먼저 빨간색 화살표가 없는 녹색 화살표를 얻습니다. 그래서 저는 빨간 화살표가 나타날 때까지 거래를 하지 않습니다. 게다가 녹색 화살표 뒤와 빨간색 화살표 이전에 있는 모든 양초는 UP이어야 합니다. 그렇지 않으면 유효한 거래가 아니기 때문입니다.

이 특정 규칙을 도대체 어떻게 코딩합니까? 현재 촛불에 대해 코딩하는 방법을 알고 있지만 이러한 조건을 지정하는 방법을 모르겠습니다. 어떤 도움이라도 좋을 것입니다!

제이슨

해당 화살표를 생성하는 코드에서 논리적 조건을 복사하지 않는 이유는 무엇입니까?

 
mladen:
Jason 해당 화살표를 생성하는 코드에서 논리적 조건을 복사하지 않겠습니까?

무슨 말인지 잘 이해가 안가네요...

내가 찾으려고 하는 것은 내 매수 또는 매도 조건에서 EA가 빨간색 화살표가 나타날 때(즉, 트리거) 조건이 이전에 녹색 화살표가 있어야 하고 모든 촛불이 그 화살표는 필요한 것에 따라 UP 또는 DOWN이어야 합니다. 근데 저 초록색 화살표가 언제 나타날지 모르니...

 
Jason2005:
나는 당신이 말하는 것을 잘 이해하지 못합니다 ... 내가 찾으려고하는 것은 내 구매 또는 판매 조건에서 빨간색 화살표가 나타날 때 (즉, 트리거) 조건을 EA가 이해하도록하는 것입니다. 이전에 녹색 화살표가 있어야 하고 해당 화살표를 따르는 모든 양초는 필요한 항목에 따라 위 또는 아래여야 한다는 것입니다. 하지만 저 초록색 화살표가 언제 나타날지 모르니...

안녕하세요 Jason2005님,

빨간색과 녹색 화살표는 표시기의 버퍼에 있는 값입니다. EA가 아닙니다....

EA에서 iCustom을 사용하여 버퍼에서 지표 값을 호출한 다음... 거래 전략에 사용하십시오.

이 포럼에는 EA에서 iCustom을 사용하는 방법에 대한 좋은 게시물이 많이 있습니다...

그동안...여기에 지표를 첨부하면...누군가가 iCustom 문에서 사용할 수 있는 지표 버퍼 를 보여주는 데 도움을 줄 수 있습니다.

도움이 되었기를 바랍니다,

로버트

사유: