코딩하는 방법? - 페이지 93

 

thx 하지만 이유를 설명해 주시겠습니까?

구매 조건 = BuyValueCurrent1 != EMPTY_VALUE

왜 empty_value인가?

 

어쨌든 작동하지 않으며 이해하지 못하고 이해하지 못합니다.

여기 내 변수가 있습니다

BuyValueCurrent = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,1); // braintrend1 [/PHP]
BuyValueCurrent2 = iCustom(NULL,TimeFrame,IndicatorName2,NumBars,0,1); // braintrend2

and here is the statement

[PHP] BuyCondition = (BuyValueCurrent != EMPTY_VALUE && BuyValueCurrent2 != EMPTY_VALUE);

지표(Braintrend2stop 및 BrainTrend1Stop)가 SELL인 경우에도 완전히 퍼지 결과를 제공합니다.

 
clarc:
나는 위치를 열고 관리하는 EA를 가지고 있지만 이 신호가 새로운 위치에 나올 때마다 표시기에 동일한 신호를 여러 번 주고 EA를 엽니다. 하지만 두 번째 또는 세 번째 등의 위치를 원하지 않습니다. 첫 번째만 - EA가 이러한 다중 항목을 피하기 위해 매직 넘버와 페어를 기반으로 오픈 포지션을 확인하는 것이 가능합니까?

아이디어는 다음과 같습니다.

정수 CountLongs()

{

정수 수 = 0;

인트레이드;

int trades=OrdersTotal();

for(trade=0;trade<trades;trade++) {

OrderSelect(무역,SELECT_BY_POS,MODE_TRADES);

if(OrderSymbol()!=Symbol() || OrderMagicNumber() != MagicNumber) 계속;

if(OrderType()==OP_BUY) count++;

} //---- 을 위한

리턴(카운트);

}

정수 CountShorts()

{

정수 수 = 0;

인트레이드;

int trades=OrdersTotal();

for(trade=0;trade<trades;trade++) {

OrderSelect(무역,SELECT_BY_POS,MODE_TRADES);

if(OrderSymbol()!=Symbol() || OrderMagicNumber() != MagicNumber) 계속;

if(OrderType()==OP_SELL) count++;

} //---- 을 위한

리턴(카운트);

}

그리고 start() 함수에서:

if(CountLongs() == 0 && CountShorts() == 0) {

여기에서 귀하의 입국 조건

}

도움이 되기를 바랍니다.

FerruFx

 
payback:
어쨌든 작동하지 않으며 이해하지 못하고 이해하지 못합니다.

여기 내 변수가 있습니다

BuyValueCurrent = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,1); // braintrend1 [/PHP]
BuyValueCurrent2 = iCustom(NULL,TimeFrame,IndicatorName2,NumBars,0,1); // braintrend2

and here is the statement

[PHP] BuyCondition = (BuyValueCurrent != EMPTY_VALUE && BuyValueCurrent2 != EMPTY_VALUE);
지표(Braintrend2stop 및 BrainTrend1Stop)가 SELL인 경우에도 완전히 퍼지 결과를 제공합니다.

나는 당신의 지표 Braintrend1과 2를 모릅니다. 나는 매수 조건이 충족될 때 차트에 화살표를 그리는 것으로 가정했습니다. MT4에서 기본 버퍼의 값은 "EMPTY-VALUE"라는 이름의 상수이므로 화살표가 없으면 iCustom()이 반환하는 값은 이 상수이고 화살표가 있으면 반환된 값은 화살표가 있는 가격입니다. 놓다.

내가 이해한 바와 같이 두 지표가 모두 화살표를 표시할 때 매수하고 싶습니까?

 

네 바로 제가 하고 싶은 것입니다

 
payback:
네 바로 제가 하고 싶은 것입니다

따라서 iCustom() 구문을 확인 하십시오.

 

내가 무엇을 확인해야합니까? 어쩌면 내가 뭔가를 그리워

double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)

구매 신호가 있으면 버퍼 0에 저장되고 그렇지 않으면 비어 있고 버퍼 1에는 판매 신호 가 있다고 가정합니다.

 
payback:
내가 무엇을 확인해야합니까? 어쩌면 내가 뭔가를 그리워
double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)
구매 신호가 있으면 버퍼 0에 저장되고 그렇지 않으면 비어 있고 버퍼 1에는 판매 신호가 있다고 가정합니다.

여기에 귀하의 indic을 게시, 내가 볼 것입니다.

 

알았어!

그리고 설명해주세요

 
payback:
알았어! 그리고 설명해주세요

BrainTrend1Stop.mq4를 엽니다.

파일 시작 부분에서 다음을 찾을 수 있습니다.

extern int NumBars=500;

extern int EnableAlerts=0;

extern int SignalID=0;[/PHP]This means that you have to fill those three parameters as arguments in the iCustom() call, like this:

BuyValueCurrent = iCustom(NULL,0,"BrainTrend1Stop",NumBars,EnableAlerts,SignalID,0,1); // braintrend1

[/PHP]About the buffer's number, you can see this:

#property indicator_color1 Magenta

#property indicator_color2 Aqua[/PHP]So the buffer 0 is Magenta and the buffer 1 is Aqua.

Thus if the Buy arrow's color is Aqua, the buffer's number is 1 and the iCustom call is:[PHP]BuyValueCurrent = iCustom(NULL,0,"BrainTrend1Stop",NumBars,EnableAlerts,SignalID,1,1); // braintrend1
A little lower you have:[PHP] SetIndexEmptyValue(1,0.0);

This means that the default empty value for the buffer 1 is set to 0.0; so when there is no arrow, the value returned by the iCustom() call will be 0.0.

So you should know the presence of the arrow checking its value against 0, like this (if the second indic follows the same behavior):[PHP]BuyCondition = (BuyValueCurrent > 0 && BuyValueCurrent2 > 0);

두 번째 지표에 대해서는 스스로 같은 분석을 할 수 있어야 한다고 생각합니다.