Comunidad de expertos - página 10

 
Sugiero que se discuta el siguiente tema:
¿cuál es la relevancia de operar en múltiples Símbolos y/o Marcos de Tiempo dentro de un Asesor Exper to ?

Actualmente estoy sentado y pensando - ¿debería publicar symbol_lib y la plantilla del Asesor Experto, diseñada para este mismo propósito =)
y creo que no hay tal necesidad... Si opero en diferentes cuentas - todavía tendré que ejecutar varias terminales, y si opero en una - sólo abriré varias ventanas. Y habría menos confusión, parece...

Será interesante escuchar opiniones y argumentos a los mismos ;)
 
En cuanto al trailing stop, tal vez hacer esto
int CurPrice_p=Bid/Point; //текущая цена в пунктах
int CurSLoss=OrderStopLoss( )/Point; //текущий стоплосс в пунктах
int TS=40; //значение трейлингстопа в пунктах
if(TS>=5)
{
    int TStep=2; //минимальный шаг трейлинг стопа
    if(TStep<1) TStep=1; //проверка шага трейлинга
    {
        if(MathAbs(CurPrice_p-CurSLOss)>=TS+TStep)
        {
            if(CurPrice_p>CurSLOss)
            {
                double NewSLoss=(CurPrice_p-TS)*Point;
                изменить уровень стоплосс ордера на новый
            }
            if(CurPrice_p>CurSLOss)
            {
                NewSLoss=(CurPrice_p+TS)*Point;
                изменить уровень стоплосс ордера на новый
            }
        }
    }
}
 
En cuanto al trailing stop, tal vez deberíamos hacer lo siguiente

esta es una idea ... es más que un pensamiento - es una idea ))
El próximo día revisaré los errores que ha recogido el Asesor Experto, y pensaré en implementar funciones de trading. Lo compartiré con vosotros la próxima semana ;)


Propongo debatir el siguiente tema:
¿Qué relevancia tiene operar en múltiples Sellos y/o Marcos de Tiempo dentro del mismo Asesor Experto?


Como resultado de la votación ( 1 en contra (komposter), 0 a favor, el resto se abstuvo) he decidido no publicar basura de comercio multisímbolo en este hilo =)
Si alguien está interesado, que se ponga en contacto conmigo y compartiré la biblioteca ;-|
 
El tema ha sido trasladado a http://forum.viac.ru/viewtopic.php?t=2973
 
He aquí una pequeña, y en mi opinión útil, utilidad para el análisis visual de las posiciones después de una ejecución de backtest. Tal vez esta idea se desarrolle más para el análisis en línea del historial de operaciones y el análisis de las declaraciones de otras personas.
Para usar:
1. Escriba este archivo con la extensión mqh, Tracert.mqh en la carpeta experts\include\
2. Añade la línea #include <Tracert.mqh>
#property copyright "Rosh, conversed only" #property link
"http://*****************"
#include <stdlib.mqh> #include <Tracert.mqh> extern double TakeProfit = 200; extern double Lots = 0.1; extern double TrailingStop = 0; extern double StopLoss = 65;



3. Inserte la función SetTrace() al principio del bloque start() ;

int start() { int ticket, total,totalExpert; //------------------------------------------------------ //para simplificar y acelerar el código, guardemos los datos necesarios // del indicador en variables temporales SetTrace();



4. Después de la ejecución del EA, abra el archivo y obtenga algo como esto:



El código de la utilidad en sí:

//+------------------------------------------------------------------+
//|                                                      Tracert.mq4 |
//|                                                             Rosh |
//|                           http://forexsystems.ru/phpBB/index.php |
//+------------------------------------------------------------------+
#property copyright "Rosh"
#property link      "http://forexsystems.ru/phpBB/index.php"

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
double tr_AOPLong,tr_AOPShort;
double tr_LongLots,tr_ShortLots;
int tr_CurrLongOrders,tr_CurrShortOrders;
int tr_Total,tr_Counter;
int tr_PrevLongOrders,tr_PrevShortOrders;
int tr_CurrTotalOpenedOrders,tr_PrevTotalOpenedOrders;
double tr_CurrBalance,tr_PrevCurrBalance;
color tr_ProfitColor=Lime, tr_LossColor=DeepPink,tr_LongAOPColor=Blue,tr_ShortAOPColor=Red, tr_CurrCloseColor;
int tr_CloseLabelArrow=108, tr_AOPLabelArrow=159;
bool tr_CloseLong,tr_CloseShort;
double tr_CloseLabelPrice;
int tr_CloseLabelShift=20;
int tr_CounterCloseLabel=0,tr_CounterAOPLabel=0;
int tr_Bars;

void SetTrace()
  {
//---- 
   if (IsTesting()&&(tr_Bars!=Bars))
      {
      tr_CloseLong=false;
            tr_CloseShort=false;
      tr_AOPLong=0.0;
      tr_AOPShort=0.0;
      tr_LongLots=0.0;
      tr_ShortLots=0.0;
      tr_CloseLabelShift=iATR(NULL,0,50,1)*3.0/10.0/Point;
      if (tr_CurrBalance==0.0)   
         {
         tr_CurrBalance=AccountBalance();
         tr_PrevCurrBalance=AccountBalance();
         }
//----------------Проверка открытых позиций ---------------------------
      tr_CurrLongOrders=0;
      tr_CurrShortOrders=0;
      tr_CurrTotalOpenedOrders=0;
      tr_Total=OrdersTotal();
      if (tr_Total>0)// есть открытые позиции
         {
         for (tr_Counter=0;tr_Counter<tr_Total;tr_Counter++)// подсчет открытых позиций
            {
            OrderSelect(tr_Counter, SELECT_BY_POS, MODE_TRADES);
            if (OrderType()==OP_BUY) 
               {
               tr_CurrLongOrders++;
               tr_AOPLong=tr_AOPLong+OrderLots()*OrderOpenPrice();
               tr_LongLots=tr_LongLots+OrderLots();
               }
            if (OrderType()==OP_SELL) 
               {
               tr_CurrShortOrders++;
               tr_AOPShort=tr_AOPShort+OrderLots()*OrderOpenPrice();
               tr_ShortLots=tr_ShortLots+OrderLots();
               }
            }// подсчет открытых позиций


            //---------------  усреднение ---------------------
            
         if (tr_CurrLongOrders>0) tr_AOPLong=tr_AOPLong/tr_LongLots;
         if (tr_CurrShortOrders>0)tr_AOPShort=tr_AOPShort/tr_ShortLots;
            
            //---------------  усреднение ---------------------
            
         if (tr_AOPLong>0.0)
            {
            ObjectCreate("AOP"+tr_CounterAOPLabel,OBJ_ARROW,0,Time[1],tr_AOPLong);// не совсем корректно, но пока пойдет
            ObjectSet("AOP"+tr_CounterAOPLabel,OBJPROP_ARROWCODE,tr_AOPLabelArrow);
            ObjectSet("AOP"+tr_CounterAOPLabel,OBJPROP_COLOR,tr_LongAOPColor);
            tr_CounterAOPLabel++;
            }

         if (tr_AOPShort>0.0)
            {
            ObjectCreate("AOP"+tr_CounterAOPLabel,OBJ_ARROW,0,Time[1],tr_AOPShort);// не совсем корректно, но пока пойдет
            ObjectSet("AOP"+tr_CounterAOPLabel,OBJPROP_ARROWCODE,tr_AOPLabelArrow);
            ObjectSet("AOP"+tr_CounterAOPLabel,OBJPROP_COLOR,tr_ShortAOPColor);
            tr_CounterAOPLabel++;
            }



//         Print("Long=",tr_CurrLongOrders,"  tr_AOPLong=",tr_AOPLong,"    ***   Short=",tr_CurrShortOrders,"   tr_AOPShort=",tr_AOPShort);            
         tr_CurrTotalOpenedOrders=tr_CurrLongOrders+tr_CurrShortOrders;
         if ((tr_CurrTotalOpenedOrders!=tr_PrevTotalOpenedOrders)||(tr_PrevLongOrders!=tr_CurrLongOrders)||(tr_PrevShortOrders!=tr_CurrShortOrders)) // изменилось колчиство ордеров в рынке
            {
            if (tr_PrevLongOrders>tr_CurrLongOrders) // изменилось число ордеров в Long
               {
               tr_CloseLong=true;            
               tr_CloseLabelPrice=High[1]+tr_CloseLabelShift*Point;
               }
            if (tr_PrevShortOrders>tr_CurrShortOrders) // изменилось число ордеров в Short
               {
               tr_CloseShort=true;            
               tr_CloseLabelPrice=Low[1]-tr_CloseLabelShift*Point;
               }
            tr_PrevLongOrders=tr_CurrLongOrders;
            tr_PrevShortOrders=tr_CurrShortOrders;
            tr_PrevTotalOpenedOrders=tr_CurrTotalOpenedOrders;
            }
         }// есть открытые позиции

//---------------- Проверка изменения Баланса

      tr_CurrBalance=AccountBalance();  
      if (tr_CurrBalance!=tr_PrevCurrBalance)// проверка изменения Balance
         {
         if (tr_CurrBalance-tr_PrevCurrBalance>0.0) tr_CurrCloseColor=tr_ProfitColor; else tr_CurrCloseColor=tr_LossColor;
         tr_PrevCurrBalance=tr_CurrBalance;
         //------------------ установка Метки закрытия --------------------
         ObjectCreate("Close"+tr_CounterCloseLabel,OBJ_ARROW,0,Time[1],tr_CloseLabelPrice);
         ObjectSet("Close"+tr_CounterCloseLabel,OBJPROP_ARROWCODE,tr_CloseLabelArrow);
         ObjectSet("Close"+tr_CounterCloseLabel,OBJPROP_COLOR,tr_CurrCloseColor);
         tr_CounterCloseLabel++;
         //------------------ установка Метки закрытия --------------------
         }// проверка изменения Balance   
      }//(IsTesting()) 
//----
   tr_Bars=Bars;
   return(0);
  }
//+------------------------------------------------------------------+
 
Debido al lanzamiento del probador (un poco tarde sin embargo), estoy publicando trade_lib_tester e info_lib_tester. Porque sus versiones habituales no quieren ser probadas =)))
Usa lo mismo. Sólo hay que cambiar los nombres antiguos en las líneas de inlusión por los nuevos.

se encuentran en http://forum.viac.ru/viewtopic.php?t=2973
 
¡Querido komposter!

Podrías publicar todos estos archivos, tanto los más recientes como los anteriores, en algún lugar de viac o alpari o forexitems o finlists - en general, donde se puedan adjuntar archivos. También sería más fácil de encontrar. Gracias de antemano.
 
¡Querido komposter! <br / translate="no">.
Podrías poner todos estos archivos y los recientes y anteriores en algún lugar de viac o alpari o forexitems o finlist - en general, donde se puedan adjuntar archivos. También sería más fácil de encontrar. Gracias de antemano.


http://forum.viac.ru/viewtopic.php?t=2973

Más adelante trasladaré las descripciones con las instrucciones...
 
trade_lib_tester&info_lib_tester.rar - actualización publicada - http://forum.viac.ru/viewtopic.php?t=2973


para pruebas <br / translate="no"> última actualización - 13.07.2005 14:09
la velocidad de las pruebas se ha multiplicado por más de 10
 
Finalización de las bibliotecas - http://forum.viac.ru/viewtopic.php?p=65111#65111

Hay muchos cambios. Y uno muy grande.
La tolerancia a los errores está en un nivel completamente nuevo, la información es más completa, la interfaz es más amigable ;) ...

En general, podemos decir, que es una biblioteca absolutamente nueva =)
Siéntase libre de usarlo ;)