Ayuda a la codificación - página 491

 
brijeshsinh:
Hola,

mladen, mr tools puede por favor ayudar a cambiar los siguientes ajustes en el indicador FXUltraTrend publicado abajo a

--- mostrar en una ventana separada como línea, (o histograma) con flechas para mostrar el cambio de color si es posible (por defecto en la configuración actual pinta barras en el gráfico principal)

---- y si es posible añadir una columna para diferentes configuraciones, de manera que se pueda cambiar según nuestro deseo. (en el modo actual por defecto no tiene ninguna columna para añadir ajustes)

adjuntando el siguiente indicador y su imagen para usted

fxultratrend.mq4

Espero que no me moleste por tomar un poco de tiempo de usted, pero ustedes están haciendo un gran trabajo para alguien como nosotros que son nuevos en esta plataforma y sin saber de programación.

realmente merecéis el agradecimiento mío y de todos los miembros de este foro por vuestros valiosos esfuerzos.

Gracias por la rápida respuesta al mensaje anterior.

Si tienes el código fuente original (no descompilado) de ese indicador publícalo para que alguien pueda modificarlo (dudo que alguien vaya a cambiar el código descompilado)

 

solo tengo este indicador que he publicado.

gracias por la respuesta mladen.

es bueno saber de ti de nuevo.

 
tfi_markets:
Hola Mladen,

tienes razón, por favor encuentra el código de abajo que está llamando a "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);

}

}

}

Comprueba qué errores estás recibiendo en la pestaña de expertos o diarios de la terminal

 
mladen:
Comprueba qué errores te aparecen en la pestaña de expertos o diarios del terminal

No hay errores reales, esto es exactamente lo que me desconcierta.

Parece que es así:

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:
No hay ningún error real, esto es exactamente lo que me desconcierta.

Se ve así:

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.

}

}

}

}

Eso significa que las condiciones para entrar en el procedimiento de apertura de la orden nunca se cumplen. Compruebe las condiciones en ese caso

 

Hola Maestros

pueden por favor guiarme como agregar una cotización en vivo al msg de alerta

gracias

 
AAREMM:
Hola Maestros

¿puede guiarme cómo añadir una cotización en vivo al mensaje de alerta?

gracias

Simplemente añade algo como DoubleToStr(price,_Digits) al mensaje de alerta

 
mladen:
Simplemente añada algo como DoubleToStr(price,_Digits) al mensaje de alerta

HaHaHa

lo he intentado pero no lo he conseguido

rsi_bollinger_bands_1.01_amp_lines__alerts_arrows.mq4

plz añadir a este para que pueda probar de nuevo

el error es este 'precio' - identificador no declarado

gracias por la atención

 
AAREMM:
HaHaHa

lo he intentado pero no lo he conseguido

rsi_bollinger_bands_1.01_amp_lines__alerts_arrows.mq4

por favor, añada a esto para que pueda intentar de nuevo

el error es este 'precio' - identificador no declarado

gracias por la atención prestada

"precio" fue colocado allí para que pueda reemplazarlo con el precio (o valor) que desea utilizar en lugar del precio. Utilice "Close[0]", "Ask", "Bid" o cualquier otro precio (valor) que desee que se muestre en la alerta

 
mladen:
"price" se colocó ahí para que lo sustituyas por el precio (o valor) que desees utilizar en lugar del precio. Utilice "Close[0]", "Ask", "Bid" o cualquier otro precio (valor) que desee que se muestre en la alerta

Bien, señor, lo estoy intentando de nuevo.

Gracias de nuevo por guiarme

Lo he hecho gracias una tonelada Señor mladen

Razón de la queja: