Asesores Expertos: Return Strategy

 

Return Strategy:

Trabajo con órdenes pendientes Buy Limit y Sell Limit. Cuadrícula de órdenes pendientes.

Return Strategy

Autor: Vladimir Karputov

 
Alexander Kamyshanov:
Hola, ¿cómo hacer en lugar de orden pendiente de por vida su movimiento constante detrás del precio por un cierto número de pips del precio una vez en minutos?

En primer lugar: es necesario ejecutar el texto de la pregunta al menos a través de Word - esta acción va a corregir el texto y añadir signos de puntuación en los lugares correctos ...

 

Versión 1.001 - función LotsOrRisk corregida

Puede descargar de Estrategia de retorno :

 

Hola Vladimir,
Gracias por la corrección.

¿Podemos decir que la función de beneficio total (en puntos) no tiene la misma funcionalidad que el beneficio objetivo o el beneficio mínimo?

 
Edviao:

Hola Vladimir,
Gracias por la corrección.

¿Podemos decir que la función de beneficio total (en puntos) no tiene la misma funcionalidad que el beneficio objetivo o el beneficio mínimo?

La pregunta no está clara: no hay'beneficioobjetivo' y'beneficio mínimo' en el EA.


Cómo buscar respuestas: tomar el parámetro de entrada 'Total profit (in pips)' - ver qué variable es responsable de ello:

input ushort   InpTotalProfit    = 100;      // Beneficio total (en pips)


... busque la primera aparición de 'InpTotalProfit'.

   ExtTotalProfit    = InpTotalProfit  * m_adjusted_point;


... ahora busque la primera aparición de'ExtTotalProfit' ...

//---
   if(CalculateTotalProfit()>=ExtTotalProfit)
     {
      bln_close_all=true;
      return;
     }


... queda por estudiar la función 'CalculateTotalProfit()' ...

 
Gracias por los deberes, en los que trabajaré este fin de semana, Vladimir.
 

Buenas tardes.

¿Cuál puede ser la razón del mensaje en el registro durante las pruebas? Los ajustes del Asesor Experto se toman por defecto.

2021.10.30 10:20:44.968 2021.01.11 10:57:26   Code of request result: 10022
2021.10.30 10:20:44.968 2021.01.11 10:57:26   code of request result as a string: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Deal ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Order ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Volume of deal or order: 0.00
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Price, confirmed by broker: 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current bid price: 1.21783 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current ask price: 1.21795 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Broker comment: 
2021.10.30 10:20:44.968 2021.01.11 10:57:26   CTrade::OrderOpen: Invalid expiration type
2021.10.30 10:20:44.968 2021.01.11 10:57:26   #3  Buy Limit (0) -> false. Result Retcode: 10022, description of result: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Code of request result: 10022
2021.10.30 10:20:44.968 2021.01.11 10:57:26   code of request result as a string: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Deal ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Order ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Volume of deal or order: 0.00
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Price, confirmed by broker: 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current bid price: 1.21782 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current ask price: 1.21794 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Broker comment: 
2021.10.30 10:20:44.968 2021.01.11 10:57:26   CTrade::OrderOpen: Invalid expiration type
2021.10.30 10:20:44.968 2021.01.11 10:57:26   #3  Buy Limit (1) -> false. Result Retcode: 10022, description of result: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Code of request result: 10022
2021.10.30 10:20:44.968 2021.01.11 10:57:26   code of request result as a string: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Deal ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Order ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Volume of deal or order: 0.00
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Price, confirmed by broker: 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current bid price: 1.21782 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current ask price: 1.21794 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Broker comment: 
2021.10.30 10:20:44.968 2021.01.11 10:57:26   CTrade::OrderOpen: Invalid expiration type
2021.10.30 10:20:44.968 2021.01.11 10:57:26   #3  Buy Limit (2) -> false. Result Retcode: 10022, description of result: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Code of request result: 10022
2021.10.30 10:20:44.968 2021.01.11 10:57:26   code of request result as a string: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Deal ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Order ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Volume of deal or order: 0.00
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Price, confirmed by broker: 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current bid price: 1.21782 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current ask price: 1.21794 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Broker comment: 
2021.10.30 10:20:44.968 2021.01.11 10:57:26   CTrade::OrderOpen: Invalid expiration type
2021.10.30 10:20:44.968 2021.01.11 10:57:26   #3  Buy Limit (3) -> false. Result Retcode: 10022, description of result: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Code of request result: 10022
2021.10.30 10:20:44.968 2021.01.11 10:57:26   code of request result as a string: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Deal ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Order ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Volume of deal or order: 0.00
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Price, confirmed by broker: 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current bid price: 1.21782 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current ask price: 1.21794 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Broker comment: 
2021.10.30 10:20:44.968 2021.01.11 10:57:26   CTrade::OrderOpen: Invalid expiration type
2021.10.30 10:20:44.968 2021.01.11 10:57:26   #3  Sell Limit (0) -> false. Result Retcode: 10022, description of result: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Code of request result: 10022
2021.10.30 10:20:44.968 2021.01.11 10:57:26   code of request result as a string: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Deal ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Order ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Volume of deal or order: 0.00
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Price, confirmed by broker: 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current bid price: 1.21782 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Current ask price: 1.21794 (the requote): 0.00000
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Broker comment: 
2021.10.30 10:20:44.968 2021.01.11 10:57:26   CTrade::OrderOpen: Invalid expiration type
2021.10.30 10:20:44.968 2021.01.11 10:57:26   #3  Sell Limit (1) -> false. Result Retcode: 10022, description of result: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Code of request result: 10022
2021.10.30 10:20:44.968 2021.01.11 10:57:26   code of request result as a string: invalid expiration
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Deal ticket: 0
2021.10.30 10:20:44.968 2021.01.11 10:57:26   Order ticket: 0
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Volume of deal or order: 0.00
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Price, confirmed by broker: 0.00000
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Current bid price: 1.21782 (the requote): 0.00000
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Current ask price: 1.21794 (the requote): 0.00000
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Broker comment: 
2021.10.30 10:20:44.969 2021.01.11 10:57:26   CTrade::OrderOpen: Invalid expiration type
2021.10.30 10:20:44.969 2021.01.11 10:57:26   #3  Sell Limit (2) -> false. Result Retcode: 10022, description of result: invalid expiration
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Code of request result: 10022
2021.10.30 10:20:44.969 2021.01.11 10:57:26   code of request result as a string: invalid expiration
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Deal ticket: 0
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Order ticket: 0
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Volume of deal or order: 0.00
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Price, confirmed by broker: 0.00000
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Current bid price: 1.21782 (the requote): 0.00000
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Current ask price: 1.21794 (the requote): 0.00000
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Broker comment: 
2021.10.30 10:20:44.969 2021.01.11 10:57:26   CTrade::OrderOpen: Invalid expiration type
2021.10.30 10:20:44.969 2021.01.11 10:57:26   #3  Sell Limit (3) -> false. Result Retcode: 10022, description of result: invalid expiration
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Code of request result: 10022
2021.10.30 10:20:44.969 2021.01.11 10:57:26   code of request result as a string: invalid expiration
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Deal ticket: 0
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Order ticket: 0
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Volume of deal or order: 0.00
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Price, confirmed by broker: 0.00000
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Current bid price: 1.21782 (the requote): 0.00000
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Current ask price: 1.21794 (the requote): 0.00000
2021.10.30 10:20:44.969 2021.01.11 10:57:26   Broker comment: 

Saludos, Vladimir.

 
Indica que'ORDER_TIME_SPECIFIED' no es compatible.
 
Vladimir Karputov 'ORDER_TIME_SPECIFIED' no está soportado.

Me da vergüenza preguntar: ¿no está soportado por quién o por qué?

Saludos, Vladimir.

 
MrBrooklin #:

Me da vergüenza preguntarlo: ¿no apoyado por quién o por qué?

Con todo respeto, Vladimir.

El servidor de comercio. Probablemente no está probando en Forex?

 
Vladimir Karputov #:

Un servidor de trading. ¿Es probable que no pruebas en forex?

Estoy probando en el terminal de mi forex-dealer. Intentaré actualizar la compilación.

Saludos, Vladimir.