Ajuda na codificação - página 491

 
brijeshsinh:
Olá,

mladen, mr tools can you please help change following settings in indicator FXUltraTrend posted below to

--- mostrar em janela separada como linha, (ou histograma) com setas para mostrar a mudança de cor se possível (por padrão na configuração atual pinta barras no gráfico principal)

---- e, se possível, adicionar coluna para diferentes configurações, para que possa ser alterada de acordo com nosso desejo. ( no modo padrão atual, não tem nenhuma coluna para adicionar configurações)

anexando abaixo o indicador e sua imagem para você

fxultratrend.mq4

Espero que vocês não se importem comigo por ter tirado algum tempo de vocês, mas vocês estão fazendo um ótimo trabalho para alguém como nós que é novo nesta plataforma e não conhece programação.

Vocês realmente merecem o meu apreço e o de todos os membros deste fórum por seus valiosos esforços.

obrigado pela resposta rápida para o post anterior.

Se você tiver o código fonte original (não descompilado) desse indicador, poste-o para que alguém possa alterá-lo (duvido que alguém vá alterar o código descompilado)

 

Tenho apenas este indicador que afixei.

obrigado pela resposta mladen.

é bom ouvir de você novamente.

 
tfi_markets:
Olá, Mladen,

você está certo, por favor, encontre o código abaixo que se chama "OpenSell()".

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

//| OPEN BUY / OPEN SELL

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

//----------------------- BUY CONDITION

for(i=OrdersTotal()-1;i>=0; i--)

if(OrderType()==OP_SELL) break;

{

if(STC1!=STC2)

{

/*if(STC1STC1)BUY="true";*/

if(STC1STC1)

/*if((STC115) || (STC185)) // code for buy */

OpenBuy();

return(0);

}

openedOrders++;

}

//----------------------- SELL CONDITION

// if(STC1>STC0&&STC2<STC1)SELL="true";

//if((STC1>15 && STC285 && STC2<85)) // code for sell

if(STC1>STC0&&STC2<STC1) // code for sell

{

OpenSell();

return(0);

}

}

//----------------------- OPEN SELL

void OpenSell()

{

double lsStop = 0; if(sStopLoss>0) lsStop = NormalizeDouble(MarketInfo(s_symbol,MODE_BID)+sStopLoss *pPoint*pipMultiplier,digit);

double lsTake = 0; if(sTakeProfit>0) lsTake = NormalizeDouble(MarketInfo(s_symbol,MODE_BID)-sTakeProfit*pPoint*pipMultiplier,digit);

if(AccountFreeMargin()<(100*Lots)) { Print("We have no money. Free Margin = ",AccountFreeMargin()); return; }

// ECN

if(!EcnBroker)

dummyResult=OrderSend(s_symbol,OP_SELL,LotsOptimized(),MarketInfo(s_symbol,MODE_BID),Slippage*pipMultiplier,lsStop,lsTake,ExpertName,MAGIC,0,clOpenSell);

else

{

int sellTicket = OrderSend(s_symbol,OP_SELL,LotsOptimized(),MarketInfo(s_symbol,MODE_BID),Slippage*pipMultiplier,0,0,ExpertName,MAGIC,0,clOpenSell);

if(sellTicket >= 0)

bool sellOrderMod=OrderModify(sellTicket,OrderOpenPrice(),lsStop,lsTake,0,CLR_NONE);

if(sellOrderMod==false)

{

int ErrorCode = GetLastError();

string ErrDesc = ErrorDescription(ErrorCode);

string ErrAlert=StringConcatenate("Modify Sell Order - Error ",ErrorCode,": ",ErrDesc);

if(ShowAlerts==true) Alert(ErrAlert);

string ErrLog=StringConcatenate("Ask: ",MarketInfo(s_symbol,MODE_ASK)," Bid: ",MarketInfo(s_symbol,MODE_BID)," Ticket: ",sellTicket," Stop: ",lsStop," Profit: ",lsTake);

Print(ErrLog);

}

}

}

Verifique quais erros você está recebendo na guia de especialistas ou periódicos do terminal

 
mladen:
Verifique quais erros você está recebendo na guia de especialistas ou revistas do terminal

Não há erros reais, isto é exatamente o que me deixa intrigado.

É o que parece:

2015.06.17 17:20:26.823 2014.07.29 17:10 SchaffTrendCircle_EA v1.3 EURUSD,M5: open #3 buy 0.10 EURUSD at 1.34175 ok

2015.06.17 17:20:26.799 2014.07.29 17:05 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 17:05:00 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:26.792 2014.07.29 17:03 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 17:03:13 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:26.714 2014.07.29 16:40 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 16:40:00 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:26.064 2014.07.29 14:06 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 14:06:09 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:25.827 2014.07.29 11:55 SchaffTrendCircle_EA v1.3 EURUSD,M5: close #2 buy 0.10 EURUSD at 1.34353 sl: 1.27353 tp: 1.74353 at price 1.34356

2015.06.17 17:20:25.818 2014.07.29 11:50 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 11:50:01 Non Lag Schaff Trend Cycle changed direction to down

2015.06.17 17:20:25.816 2014.07.29 11:48 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 11:48:17 Non Lag Schaff Trend Cycle changed direction to down

2015.06.17 17:20:25.486 2014.07.29 09:15 SchaffTrendCircle_EA v1.3 EURUSD,M5: modify #2 buy 0.10 EURUSD at 1.34353 sl: 1.27353 tp: 1.74353 ok

2015.06.17 17:20:25.486 2014.07.29 09:15 SchaffTrendCircle_EA v1.3 EURUSD,M5: open #2 buy 0.10 EURUSD at 1.34353 ok

2015.06.17 17:20:25.479 2014.07.29 09:12 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 09:12:11 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:25.426 2014.07.29 08:45 SchaffTrendCircle_EA v1.3 EURUSD,M5: close #1 buy 0.10 EURUSD at 1.34345 sl: 1.27345 tp: 1.74345 at price 1.34277

2015.06.17 17:20:25.421 2014.07.29 08:42 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 08:42:19 Non Lag Schaff Trend Cycle changed direction to down

2015.06.17 17:20:25.378 2014.07.29 08:05 SchaffTrendCircle_EA v1.3 EURUSD,M5: modify #1 buy 0.10 EURUSD at 1.34345 sl: 1.27345 tp: 1.74345 ok

2015.06.17 17:20:25.378 2014.07.29 08:05 SchaffTrendCircle_EA v1.3 EURUSD,M5: open #1 buy 0.10 EURUSD at 1.34345 ok

[/CODE]

I guess the problem may lie somewhere in there:

[CODE]

//----------------------- CLOSE BUY CONDITION

.

.

.

string ErrLog=StringConcatenate("Bid: ",MarketInfo(s_symbol,MODE_BID)," Lots: ",OrderLots()," Ticket: ",OrderTicket());

Print(ErrLog);

}

break;

} // mod.... maybe here.

}

}

//----------------------- CLOSE SELL CONDITION

.

.

.

ErrLog=StringConcatenate("Ask: ",MarketInfo(s_symbol,MODE_ASK)," Lots: ",OrderLots()," Ticket: ",OrderTicket());

Print(ErrLog);

}

break;

} // mod ----- maybe here.

}

}

}

}

 
tfi_markets:
Não há erros reais, isto é exatamente o que me deixa intrigado.

É o que parece:

2015.06.17 17:20:26.823 2014.07.29 17:10 SchaffTrendCircle_EA v1.3 EURUSD,M5: open #3 buy 0.10 EURUSD at 1.34175 ok

2015.06.17 17:20:26.799 2014.07.29 17:05 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 17:05:00 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:26.792 2014.07.29 17:03 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 17:03:13 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:26.714 2014.07.29 16:40 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 16:40:00 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:26.064 2014.07.29 14:06 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 14:06:09 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:25.827 2014.07.29 11:55 SchaffTrendCircle_EA v1.3 EURUSD,M5: close #2 buy 0.10 EURUSD at 1.34353 sl: 1.27353 tp: 1.74353 at price 1.34356

2015.06.17 17:20:25.818 2014.07.29 11:50 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 11:50:01 Non Lag Schaff Trend Cycle changed direction to down

2015.06.17 17:20:25.816 2014.07.29 11:48 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 11:48:17 Non Lag Schaff Trend Cycle changed direction to down

2015.06.17 17:20:25.486 2014.07.29 09:15 SchaffTrendCircle_EA v1.3 EURUSD,M5: modify #2 buy 0.10 EURUSD at 1.34353 sl: 1.27353 tp: 1.74353 ok

2015.06.17 17:20:25.486 2014.07.29 09:15 SchaffTrendCircle_EA v1.3 EURUSD,M5: open #2 buy 0.10 EURUSD at 1.34353 ok

2015.06.17 17:20:25.479 2014.07.29 09:12 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 09:12:11 Non Lag Schaff Trend Cycle changed direction to up

2015.06.17 17:20:25.426 2014.07.29 08:45 SchaffTrendCircle_EA v1.3 EURUSD,M5: close #1 buy 0.10 EURUSD at 1.34345 sl: 1.27345 tp: 1.74345 at price 1.34277

2015.06.17 17:20:25.421 2014.07.29 08:42 NonLag_Schaff_TrendCycle EURUSD,M5: Alert: EURUSD M5 at 08:42:19 Non Lag Schaff Trend Cycle changed direction to down

2015.06.17 17:20:25.378 2014.07.29 08:05 SchaffTrendCircle_EA v1.3 EURUSD,M5: modify #1 buy 0.10 EURUSD at 1.34345 sl: 1.27345 tp: 1.74345 ok

2015.06.17 17:20:25.378 2014.07.29 08:05 SchaffTrendCircle_EA v1.3 EURUSD,M5: open #1 buy 0.10 EURUSD at 1.34345 ok

[/CODE]

I guess the problem may lie somewhere in there:

[CODE]

//----------------------- CLOSE BUY CONDITION

.

.

.

string ErrLog=StringConcatenate("Bid: ",MarketInfo(s_symbol,MODE_BID)," Lots: ",OrderLots()," Ticket: ",OrderTicket());

Print(ErrLog);

}

break;

} // mod.... maybe here.

}

}

//----------------------- CLOSE SELL CONDITION

.

.

.

ErrLog=StringConcatenate("Ask: ",MarketInfo(s_symbol,MODE_ASK)," Lots: ",OrderLots()," Ticket: ",OrderTicket());

Print(ErrLog);

}

break;

} // mod ----- maybe here.

}

}

}

}

Isso significa que as condições para entrar no procedimento de abertura de pedidos nunca são cumpridas. Verifique as condições nesse caso

 

Olá Masters

você pode, por favor, me guiar como adicionar uma cotação ao vivo ao msg de alerta

obrigado

 
AAREMM:
Olá Masters

você pode, por favor, me guiar como adicionar a cotação ao vivo ao msg de alerta

obrigado

Basta adicionar algo como DoubleToStr(preço,_Dígitos) à mensagem de alerta

 
mladen:
Basta adicionar algo como DoubleToStr(preço,_Dígitos) à mensagem de alerta

HaHaHa

tentaram mas falharam

rsi_bollinger_bands_1.01_amp_lines__alerts_arrows.mq4

plz acrescente a isto para que eu possa tentar novamente

o erro é este 'preço' - identificador não declarado

obrigado pela atenção amável

 
AAREMM:
HaHaHa

tentaram mas falharam

rsi_bollinger_bands_1.01_amp_lines__alerts_arrows.mq4

plz acrescente a isto para que eu possa tentar novamente

o erro é este 'preço' - identificador não declarado

obrigado pela atenção amável

O"preço" foi colocado lá para que você possa substituí-lo pelo preço (ou valor) que deseja utilizar em vez do preço. Use "Close[0]", "Ask", "Bid" ou qualquer outro preço (valor) que você queira que seja exibido no alerta.

 
mladen:
O"preço" foi colocado lá para que você possa substituí-lo pelo preço (ou valor) que deseja utilizar em vez do preço. Use "Close[0]", "Ask", "Bid" ou qualquer outro preço (valor) que você queira que seja exibido no alerta.

Muito bem Senhor tentando novamente

Mais uma vez obrigado por me guiar

Já fiz isso graças a uma tonelada de Sir mladen