Você está perdendo oportunidades de negociação:
- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Registro
Login
Você concorda com a política do site e com os termos de uso
Se você não tem uma conta, por favor registre-se
mas você pode me explicar por que
BuyCondition = BuyValueCurrent1 != EMPTY_VALUE
por que valor_vazio?
de qualquer forma, não funciona e não entendo e descubro por quê.
aqui estão minhas variáveis
and here is the statement
[PHP] BuyCondition = (BuyValueCurrent != EMPTY_VALUE && BuyValueCurrent2 != EMPTY_VALUE);dá resultados totalmente difusos mesmo quando o indicador (Braintrend2stop e BrainTrend1Stop) são vendidos
tenho uma EA que abre e maneja a posição, mas às vezes dá ao indicador o mesmo sinal múltiplo e a EA abre toda vez que este sinal sai uma nova posição - mas eu não quero uma segunda ou terceira e assim por diante e na posição, eu vou apenas a primeira - é possível que a EA verifique a posição aberta com base no número mágico e no par para evitar tais entradas múltiplas ?
Aqui está a idéia:
{
int contagem=0;
int trade;
int trades=OrdensTotal();
for(trade=0;trade<trades;trade++) {
OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()!=Symbol() || OrderMagicNumber() != MagicNumber) continua;
if(OrderType()==OP_BUY) count++;
} //---- para
devolução(contagem);
}
em CountShorts()
{
int contagem=0;
int trade;
int trades=OrdensTotal();
for(trade=0;trade<trades;trade++) {
OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()!=Symbol() || OrderMagicNumber() != MagicNumber) continua;
if(OrderType()==OP_SELL) count++;
} //---- para
devolução(contagem);
}E na função start():
if(CountLongs() == 0 && CountShorts() == 0) {
Sua condição de entrada aqui
}Esperança que ajuda.
FerruFx
de qualquer forma não funciona e eu não entendo e descubro por quê...
aqui estão minhas variáveis
and here is the statement
[PHP] BuyCondition = (BuyValueCurrent != EMPTY_VALUE && BuyValueCurrent2 != EMPTY_VALUE);Não conheço seu indiciador Braintrend1 e 2, apenas assumi que quando uma condição de compra é cumprida, eles desenham uma seta na tabela. Em MT4, o valor padrão do buffer é uma constante chamada "VAZIO-VALOR", portanto, se não houver seta o valor retornado por iCustom() é esta constante, e se houver seta o valor retornado é o preço onde a seta é colocada.
Como eu entendi, você quer comprar quando ambos os indiciados estão mostrando uma flecha, não é isso?
sim é exatamente o que eu quero fazer
sim, é exatamente o que eu quero fazer
Portanto, por favor, verifique sua sintaxe iCustom().
o que tenho que verificar? talvez eu perca alguma coisa
bem para o que eu suponho que se houver um sinal de compra ele é armazenado no buffer 0 ou está vazio e o buffer 1 tem o sinal de venda
o que tenho que verificar? talvez eu perca algo
Afixe seu indiciamento aqui, eu vou procurar.
ok thx!
e, por favor, explique
ok thx!e, por favor, explique
Open BrainTrend1Stop.mq4.
No início do arquivo, você pode encontrar :
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:
[/PHP]About the buffer's number, you can see this:
#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); // braintrend1This 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);Sobre o segundo indiciamento, acho que você deve ser capaz de fazer a mesma análise por si mesmo.