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
Obrigado mntiwana e malden. mas por que eu tenho que comprar novamente? Você pode enviar estes indicadores em mensagens
Envie o e-mail original com um link que você recebeu quando comprou esse indicador para support@forex-tsd.com e, se tudo estiver correto, você receberá uma versão atualizada.
Certo mlanden. mas o indicador antes de nmc parece interessante do que depois de nmc . Será apenas meus sentimentos?
Certo mlanden. mas o indicador antes de nmc parece interessante do que depois de nmc . Será apenas meus sentimentos?
Os resultados da versão "nmc" não são alterados em comparação com a versão "prénmc" em absoluto. "nmc" significa "novo metatrader compatível".
tudo de bom
Por que ?
Mladen,
Por favor, pode me dar a razão pela qual esta ea não funciona.
//----------------------- PARÂMETRO EA
fio externo
Expert_Name = "---------- Ordem Pendente EA v1",
Expert_Name2 = "---------- Para o conjunto de preços atuais EntryLevel = 0";
duplo externo
Nível de entrada = 1,8600,
Distância = 100,
StopLoss = 50,
TakeProfit = 50,
TrailingStop = 50;
cordão externo
Order_Setting = "---------- Order Setting";
int. externo
NumberOfTries = 5,
Slippage = 5,
MagicNumber = 1234;
fio externo
MM_Parameters = "---------- Money Management";
duplo externo
Lotes =0,01;
bool externo
MM = falso, //Utilizar ou não a Gestão de Dinheiro
AccountIsMicro = verdadeiro; //Utilizar ou não Micro-Conta
int. externo
Risco = 0; //10%
fio externo
Test_Parameters= "---------- Parâmetro de teste posterior";
bool externo
Show_Settings = verdadeiro;
//----------------------- VARIÁVEL GLOBAL
estática int
TimeFrame = 0;
cordel
TicketComment = "PendingOrderEA v2",
LastTrade;
bool
TradeAllow = verdadeiro,
EntryAllow = true;
//+------------------------------------------------------------------+
//| função de iniciação de especialista |
//+------------------------------------------------------------------+
int init()
{
//----------------------- GERAR NÚMERO MÁGICO E COMENTÁRIO DO BILHETE
//_----------------------- FONTE : PENGIE
MagicNumber = subGenerateMagicNumber(MagicNumber, Symbol(), Period());
TicketComment = StringConcatenate(TicketComment, "-", Symbol(), "-", Period());
//----------------------- MOSTRA A CONFIGURAÇÃO EA NO GRÁFICO
//_----------------------- FONTE : CODERSGURU
if(Show_Settings) subPrintDetails();
else Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| função de desinicialização especializada |
//+------------------------------------------------------------------+
int deinit()
{
//----------------------- PREVINE A RECONTAGEM ENQUANTO O USUÁRIO MUDA O PERÍODO DE TEMPO
//_----------------------- FONTE : CODERSGURU
TimeFrame=Periodo();
retorno(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
duplo
// BuyLevel,
Nível de Venda;
int
cnt,
bilhete,
total;
//----------------------- SET BUY and SELL PRICE
if(EntryLevel==0) EntryLevel = Bid;
// BuyLevel = EntryLevel + Distance*Point;
SellLevel = Nível de Venda = EntryLevel - Distância*Ponto;
// if((BuyLevel-Ask)<10*Ponto || (Bid-SellLevel)<10*Ponto)
// {
// Comentário ("Preço ou Distância de Entrada Inválida");
// devolução(0);
// }
//----------------------- AJUSTAR LOTES SE USAR A GESTÃO DE DINHEIRO
if(MM) Lots = subLotSize();
//----------------------- ENTRY
//----------------------- TOTAL DE PEDIDOS COM BASE NO NÚMERO MÁGICO E SÍMBOLO
total = subTotalTrade();
//----------------------- DEFINIR O PEDIDO APENAS 1 VEZ
if(TradeAllow)
{
//----------------------- SE NÃO HOUVER COMÉRCIO
if(total<1 & && EntryAllow)
{
ticket = OrderSend(Symbol(),OP_SELLSTOP,Lots,SellLevel,SellLevel+StopLoss*Point,SellLevel-TakeProfit*Point,TicketComment,MagicNumber,0,Red);
// ticket = OrderSend(Symbol(),OP_BUYSTOP,Lots,BuyLevel,Slippage,BuyLevel-StopLoss*Point,BuyLevel+TakeProfit*Point,TicketComment,MagicNumber,0,Green);
EntryAllow = falso;
retornar(0);
}
if(total===1)
{
subDeleteOrder();
TradeAllow = falso;
}
}
//----------------------- TRAILING STOP SECTION
if(TrailingStop>0 && subTotalTrade()>0){
total = EncomendasTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELLL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber)
{
subTrailingStop(OrderType());
return(0);
}
}
}
retorno(0);
}
//----------------------- PROGRAMA FINAL
//+------------------------------------------------------------------+
//| DEFINIÇÕES DAS FUNÇÕES
//+------------------------------------------------------------------+
//----------------------- FUNÇÃO DE GERENCIAMENTO DE DINHEIRO
//_----------------------- FONTE : CODERSGURU
tamanho duplo subLotSize()
{
lote duploMM = MathCeil(AccountFreeMargin() * Risco / 1000) / 100;
if(AccountIsMicro==falso) // conta normal
{
if(lotMM < 0,1) lotMM = Lotes;
if((loteMM > 0,5) && (loteMM < 1)) loteMM = 0,5;
if(loteMM > 1,0) loteMM = MathCeil(loteMM);
if(lotMM > 100) lotMM = 100;
}
outra //micro conta
{
if(lotMM < 0,01) lotMM = Lotes;
if(loteMM > 1,0) loteMM = MathCeil(loteMM);
if(loteMM > 100) loteMM = 100;
}
retorno (loteMM);
}
//----------------------- NÚMERO DE PEDIDOS COM BASE NO SÍMBOLO E NA FUNÇÃO DE NÚMERO MÁGICO
int subTotalTrade()
{
int
cnt,
total = 0;
for(cnt=0;cnt<OrdersTotal();cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderType()<=OP_SELLL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber) total++;
}
retorno(total);
}
//----------------------- FUNÇÃO APAGAR PEDIDO
subDeleteOrder() vazio
{
int
cnt,
total = 0;
total = OrdensTotal();
for(cnt=total-1;cnt>=0;cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber)
{
switch(OrderType())
{
// caso OP_BUYLIMIT :
// caixa OP_BUYSTOP :
caso OP_SELLLIMIT : // caso OP_BUYSTOP : // caso OP_SELLLIMIT:
caso OP_SELLSTOP :
OrderDelete(OrderTicket());
}
}
}
}
//----------------------- FUNÇÃO TRAILING STOP
//_----------------------- FONTE : CODERSGURU
//----------------------- MODIFICADO : FIREDAVE
subTrailingStop(tipo int) vazio
{
if(Type===OP_BUY) // posição de compra é aberta
{
if(Bid-OrderOpenPrice()>Point*TrailingStop &&
OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
retornar(0);
}
}
if(Type===OP_SELL) // posição de venda é aberta
{
if(OrderOpenPrice()-Ask>Point*TrailingStop)
{
if(OrderStopLoss()>Ask+Point*TrailingStop || OrderStopLoss()==0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
retornar(0);
}
}
}
}
//----------------------- GERAR NÚMERO MÁGICO BASEADO EM SÍMBOLO E FUNÇÃO DE PERÍODO DE TEMPO
//_----------------------- FONTE : PENGIE
//----------------------- MODIFICADO : FIREDAVE
int subGenerateMagicNumber(int MagicNumber, string symbol, int timeFrame)
{
int isymbol = 0;
se (símbolo == "EURUSD") isymbol = 1;
caso contrário, se (símbolo == "GBPUSD") isymbol = 2;
ou se (símbolo == "USDJPY") isymbol = 3;
senão se (símbolo == "AUDCAD") isymbol = 4;
senão se (símbolo == "AUDUSD") isymbol = 5;
senão se (símbolo == "USDCAD") isymbol = 6;
senão se (símbolo == "EURGBP") isymbol = 7;
senão se (símbolo == "EURJPY") isymbol = 8;
senão se (símbolo == "EURCHF") isymbol = 9;
senão se (símbolo == "EURAUD") isymbol = 10;
senão se (símbolo == "EURCAD") isymbol = 11;
senão se (símbolo == "GBPUSD") isymbol = 12;
senão se (símbolo == "GBPJPY") isymbol = 13;
senão se (símbolo == "GBPCHF") isymbol = 14;
senão se (símbolo == "GBPAUD") isymbol = 15;
senão se (símbolo == "GBPCAD") isymbol = 16;
ou se (símbolo == "GBPCHF") isymbol = 17;
if(isymbol<10) MagicNumber = MagicNumber * 10;
return (StringToInteger(StringConcatenate(MagicNumber, isymbol, timeFrame)))
}
//----------------------- FUNÇÃO IMPRIMIR COMENTÁRIO
//_----------------------- FONTE : CODERSGURU
detalhes da subimpressão vazia()
{
string sComentário = "";
string sp = "----------------------------------------\n";
string NL = "\n";
sComment = "sp;
sComment = sComment + "TakeProfit=" + DoubleToStr(TakeProfit,0) + " | ";
sComment = sComment + "TrailingStop=" + DoubleToStr(TrailingStop,0) + " | ";
sComment = sComment + "StopLoss=" + DoubleToStr(StopLoss,0) + NL;
sComment = sComment + sp;
sComment = sComment + "Lots=" + DoubleToStr(Lots,2) + " | ";
sComment = sComment + "MM=" + subBoolToStr(MM) + " | ";
sComment = sComment + "Risk=" + DoubleToStr(Risk,0) + "%" + NL;
sComment = sComment + sp;
Comentário(sComentário);
}
//----------------------- VARIÁVEL BOOLEN PARA FUNÇÃO STRING
//_----------------------- FONTE : CODERSGURU
subBoolToStr (valor do bool)
{
se(valor) retornar ("Verdadeiro");
caso contrário, retornar ("Falso");
}
//----------------------- FUNÇÃO FINAL
Obrigado de antemão.
Jo
mladen,
espero que você esteja bem. o abaixo tem dois erros na compilação. gentilmente ajude
mladen,espero que você esteja bem. o abaixo tem dois erros na compilação. gentilmente ajude
doceiro752
Experimente agora : rstochalert-4tf_1.mq4
Caríssimos MLADEN,
(minhas perguntas são sempre sobre reparo de ajuda mais do que sobre codificação de ajuda)
tenho um pedido para entender.....ver em 2 fotos que adicionei,1 é com 1 erro e 2 avisos sobre a linha 70 e 72.... como você pode ver na foto 2, eu substituí e 1 erro e 1 aviso removido...... minha pergunta é...é correto fazer assim.... e segunda pergunta sobre o segundo aviso que ainda está atrás na linha 80...se saiu como está,sem problema no funcionamento?
com respeito a
mntiwana
Caríssimos MLADEN,
(minhas perguntas são sempre sobre reparo de ajuda mais do que sobre codificação de ajuda)
tenho um pedido para entender.....ver em 2 fotos que adicionei,1 é com 1 erro e 2 avisos sobre a linha 70 e 72.... como você pode ver na foto 2, eu substituí e 1 erro e 1 aviso removido...... minha pergunta é...é correto fazer assim.... e segunda pergunta sobre o segundo aviso que ainda está atrás na linha 80...se saiu como está,sem problema no funcionamento ?
com respeito a
mntiwanamntiwana
Dessa forma tudo está bem. você fez as mudanças OK
mntiwanathat way all is OK. você fez as mudanças OK
muito obrigado ao grande chefe por incentivar um estudante curioso.
meus melhores cumprimentos
Mladen,
Por favor, pode me dar a razão pela qual esta ea não funciona.
//----------------------- PARÂMETRO EA
fio externo
Expert_Name = "---------- Ordem Pendente EA v1",
Expert_Name2 = "---------- Para o conjunto de preços atuais EntryLevel = 0";
duplo externo
Nível de entrada = 1,8600,
Distância = 100,
StopLoss = 50,
TakeProfit = 50,
TrailingStop = 50;
cordão externo
Order_Setting = "---------- Order Setting";
int. externo
NumberOfTries = 5,
Slippage = 5,
MagicNumber = 1234;
fio externo
MM_Parameters = "---------- Money Management";
duplo externo
Lotes =0,01;
bool externo
MM = falso, //Utilizar ou não a Gestão de Dinheiro
AccountIsMicro = verdadeiro; //Utilizar ou não Micro-Conta
int. externo
Risco = 0; //10%
fio externo
Test_Parameters= "---------- Parâmetro de teste posterior";
bool externo
Show_Settings = verdadeiro;
//----------------------- VARIÁVEL GLOBAL
estática int
TimeFrame = 0;
cordel
TicketComment = "PendingOrderEA v2",
LastTrade;
bool
TradeAllow = verdadeiro,
EntryAllow = true;
//+------------------------------------------------------------------+
//| função de iniciação de especialista |
//+------------------------------------------------------------------+
int init()
{
//----------------------- GERAR NÚMERO MÁGICO E COMENTÁRIO DO BILHETE
//_----------------------- FONTE : PENGIE
MagicNumber = subGenerateMagicNumber(MagicNumber, Symbol(), Period());
TicketComment = StringConcatenate(TicketComment, "-", Symbol(), "-", Period());
//----------------------- MOSTRA A CONFIGURAÇÃO EA NO GRÁFICO
//_----------------------- FONTE : CODERSGURU
if(Show_Settings) subPrintDetails();
else Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| função de desinicialização especializada |
//+------------------------------------------------------------------+
int deinit()
{
//----------------------- PREVINE A RECONTAGEM ENQUANTO O USUÁRIO MUDA O PERÍODO DE TEMPO
//_----------------------- FONTE : CODERSGURU
TimeFrame=Periodo();
retorno(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
duplo
// BuyLevel,
Nível de Venda;
int
cnt,
bilhete,
total;
//----------------------- SET BUY and SELL PRICE
if(EntryLevel==0) EntryLevel = Bid;
// BuyLevel = EntryLevel + Distance*Point;
SellLevel = Nível de Venda = EntryLevel - Distância*Ponto;
// if((BuyLevel-Ask)<10*Ponto || (Bid-SellLevel)<10*Ponto)
// {
// Comentário ("Preço ou Distância de Entrada Inválida");
// retorno(0);
// }
//----------------------- AJUSTAR LOTES SE USAR A GESTÃO DE DINHEIRO
if(MM) Lots = subLotSize();
//----------------------- ENTRY
//----------------------- TOTAL DE PEDIDOS COM BASE NO NÚMERO MÁGICO E SÍMBOLO
total = subTotalTrade();
//----------------------- DEFINIR O PEDIDO APENAS 1 VEZ
if(TradeAllow)
{
//----------------------- SE NÃO HOUVER COMÉRCIO
if(total<1 & && EntryAllow)
{
ticket = OrderSend(Symbol(),OP_SELLSTOP,Lots,SellLevel,SellLevel+StopLoss*Point,SellLevel-TakeProfit*Point,TicketComment,MagicNumber,0,Red);
// ticket = OrderSend(Symbol(),OP_BUYSTOP,Lots,BuyLevel,Slippage,BuyLevel-StopLoss*Point,BuyLevel+TakeProfit*Point,TicketComment,MagicNumber,0,Green);
EntryAllow = falso;
retornar(0);
}
if(total===1)
{
subDeleteOrder();
TradeAllow = falso;
}
}
//----------------------- TRAILING STOP SECTION
if(TrailingStop>0 && subTotalTrade()>0){
total = EncomendasTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELLL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber)
{
subTrailingStop(OrderType());
return(0);
}
}
}
retorno(0);
}
//----------------------- PROGRAMA FINAL
//+------------------------------------------------------------------+
//| DEFINIÇÕES DAS FUNÇÕES
//+------------------------------------------------------------------+
//----------------------- FUNÇÃO DE GERENCIAMENTO DE DINHEIRO
//_----------------------- FONTE : CODERSGURU
tamanho duplo subLotSize()
{
lote duploMM = MathCeil(AccountFreeMargin() * Risco / 1000) / 100;
if(AccountIsMicro==falso) // conta normal
{
if(lotMM < 0,1) lotMM = Lotes;
if((loteMM > 0,5) && (loteMM < 1)) loteMM = 0,5;
if(loteMM > 1,0) loteMM = MathCeil(loteMM);
if(lotMM > 100) lotMM = 100;
}
outra //micro conta
{
if(lotMM < 0,01) lotMM = Lotes;
if(loteMM > 1,0) loteMM = MathCeil(loteMM);
if(loteMM > 100) loteMM = 100;
}
retorno (loteMM);
}
//----------------------- NÚMERO DE PEDIDOS COM BASE NO SÍMBOLO E NA FUNÇÃO DE NÚMERO MÁGICO
int subTotalTrade()
{
int
cnt,
total = 0;
for(cnt=0;cnt<OrdersTotal();cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderType()<=OP_SELLL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber) total++;
}
retorno(total);
}
//----------------------- FUNÇÃO APAGAR PEDIDO
subDeleteOrder() vazio
{
int
cnt,
total = 0;
total = OrdensTotal();
for(cnt=total-1;cnt>=0;cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber)
{
switch(OrderType())
{
// caso OP_BUYLIMIT :
// caixa OP_BUYSTOP :
caso OP_SELLLIMIT : // caso OP_BUYSTOP : // caso OP_SELLLIMIT:
caso OP_SELLSTOP :
OrderDelete(OrderTicket());
}
}
}
}
//----------------------- FUNÇÃO TRAILING STOP
//_----------------------- FONTE : CODERSGURU
//----------------------- MODIFICADO : FIREDAVE
subTrailingStop(tipo int) vazio
{
if(Type===OP_BUY) // posição de compra é aberta
{
if(Bid-OrderOpenPrice()>Point*TrailingStop &&
OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
retornar(0);
}
}
if(Type===OP_SELL) // posição de venda é aberta
{
if(OrderOpenPrice()-Ask>Point*TrailingStop)
{
if(OrderStopLoss()>Ask+Point*TrailingStop || OrderStopLoss()==0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
retornar(0);
}
}
}
}
//----------------------- GERAR NÚMERO MÁGICO BASEADO EM SÍMBOLO E FUNÇÃO DE PERÍODO DE TEMPO
//_----------------------- FONTE : PENGIE
//----------------------- MODIFICADO : FIREDAVE
int subGenerateMagicNumber(int MagicNumber, string symbol, int timeFrame)
{
int isymbol = 0;
se (símbolo == "EURUSD") isymbol = 1;
caso contrário, se (símbolo == "GBPUSD") isymbol = 2;
ou se (símbolo == "USDJPY") isymbol = 3;
senão se (símbolo == "AUDCAD") isymbol = 4;
senão se (símbolo == "AUDUSD") isymbol = 5;
senão se (símbolo == "USDCAD") isymbol = 6;
senão se (símbolo == "EURGBP") isymbol = 7;
senão se (símbolo == "EURJPY") isymbol = 8;
senão se (símbolo == "EURCHF") isymbol = 9;
senão se (símbolo == "EURAUD") isymbol = 10;
senão se (símbolo == "EURCAD") isymbol = 11;
senão se (símbolo == "GBPUSD") isymbol = 12;
senão se (símbolo == "GBPJPY") isymbol = 13;
senão se (símbolo == "GBPCHF") isymbol = 14;
senão se (símbolo == "GBPAUD") isymbol = 15;
senão se (símbolo == "GBPCAD") isymbol = 16;
ou se (símbolo == "GBPCHF") isymbol = 17;
if(isymbol<10) MagicNumber = MagicNumber * 10;
return (StringToInteger(StringConcatenate(MagicNumber, isymbol, timeFrame)))
}
//----------------------- FUNÇÃO IMPRIMIR COMENTÁRIO
//_----------------------- FONTE : CODERSGURU
detalhes da subimpressão vazia()
{
string sComentário = "";
string sp = "----------------------------------------\n";
string NL = "\n";
sComment = "sp;
sComment = sComment + "TakeProfit=" + DoubleToStr(TakeProfit,0) + " | ";
sComment = sComment + "TrailingStop=" + DoubleToStr(TrailingStop,0) + " | ";
sComment = sComment + "StopLoss=" + DoubleToStr(StopLoss,0) + NL;
sComment = sComment + sp;
sComment = sComment + "Lots=" + DoubleToStr(Lots,2) + " | ";
sComment = sComment + "MM=" + subBoolToStr(MM) + " | ";
sComment = sComment + "Risk=" + DoubleToStr(Risk,0) + "%" + NL;
sComment = sComment + sp;
Comentário(sComentário);
}
//----------------------- VARIÁVEL BOOLEN PARA FUNÇÃO STRING
//_----------------------- FONTE : CODERSGURU
subBoolToStr (valor do bool)
{
se(valor) retornar ("Verdadeiro");
caso contrário, retornar ("Falso");
}
//----------------------- FUNÇÃO FINAL
Obrigado de antemão.
JoJo,
Você pode, por favor, anexar o arquivo mq4? Muito difícil de testá-lo desta maneira