黑人! - 页 57

 
paukas:
这样,排水管 不是来自于交易 发生,但。 不是来自坏的MM。.

我没能成功。

而从什么?

 

账户趋势

红线--账户缩水

黑线--利润的分布

绿线--可能是损失制动


 

计算结果略显复杂。

//+------------------------------------------------------------------+
//|                                                  sanyooooook.mq4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © Mthmt, April 2012"

extern double  _deposit = 100.0;
extern double  _spread = 2.;
extern double  _tp = 30.;
extern double  _sl = 30.;
extern double  _startLot = 0.1;
extern double  _multiplier = 2.;
extern int     _howMany = 10000;

int _deathArr[ ][ 1000 ];


int start( )
{
   ArrayResize( _deathArr, _howMany );
   MathSrand( GetTickCount( ) );
   
   double depo = _deposit;
   double lot = _startLot;
   double resPips;
   int count = 0;
   
   for( int i = 0; i < _howMany; i ++ )
   {
      count = 0;
      lot = _startLot;
      depo = _deposit;
      double depoMax = depo;
      while( depo > 0 )
      {
         resPips = dealResultPips( );
         depo += resPips * lot * 10;
         _deathArr[ i ][ 2 + count ] = depo;
         
         if( depo > depoMax )          depoMax = depo;
         
         count ++;
         if( resPips < 0 )      lot *= _multiplier;
         else                   lot = _startLot; 
      }
      _deathArr[ i ][ 0 ] = count;
      _deathArr[ i ][ 1 ] = depoMax;
   } 
   
   toFile( );   
   return( 0 );
}//+------------------------------------------------------------------+

   
      double dealResultPips( )
      {
         double ratio = ( _tp + _spread ) / _sl ;
         if( MathRand( ) < 32768. * ratio / 2  )         return( - _sl );     /// fail
         else                                            return(   _tp );     /// success   
      }//+------------------------------------------------------------------+
      
      
      void toFile( )   
      {
         int h = FileOpen( "death.txt", FILE_CSV | FILE_WRITE, "," );
         FileWrite( h, "##", "Deals total", "Max deposit" );
         string sOut = "";
         for( int i = 0; i < _howMany; i ++ )
         {
            int countTot = _deathArr[ i ][ 0 ] + 2;
            for( int cnt = 0; cnt < countTot; cnt ++ )      
               sOut = sOut + _deathArr[ i ][ cnt ] + ",";
            FileWrite( h, i, sOut );
            sOut = "";
         }   
         FileClose( h );
         return;
      }//+------------------------------------------------------------------+      

统计数据是不同的,我错了。有长达数万个交易的序列(脚本的最后一次运行最多有17000多个交易)。所有东西都被打印成2兆的大文件。如果交易量达到1000(以目前的设置),那么可以看到所有的交易。如果更多--他们就会被砍掉。增加这个参数并不能增加文件,因为成功的系列非常少。

亏损前的系列平均长度约为48个交易。但99%的系列可以达到700个交易的长度。

我将在稍后介绍保释金支票。但这几乎不会有什么变化。

还计算了最大限度的去势。

 
你是怎么了,连存款都不能正常排泄吗?)
 

你为什么不把价差加到St.

在我看来,有了止损,损失就多了,有了盈利,利润就少了。

 

因为这里有不同的计算方法。对我来说--要想得到相等的数字,到取的时候要比到停的时候多。

而他们之间的区别是一个价差,而不是两个。

刚把最大系列(第二个数组维度)增加到10000。这很好,工作不到10秒。

 

我刚刚进去,它已经转了两分钟了)。

      double dealResultPips( )
      {
         double ratio = ( _tp - 2*_spread ) / _sl ;
         if( MathRand( ) < 32768. * ratio / 2  )         return( - _sl-2 );     /// fail
         else                                            return(   _tp-2 );     /// success   
 

这需要很长的时间...

 
他挂了))。
 

改成了这样,也是在想

      double dealResultPips( )
      {
         double ratio = ( _tp - _spread ) / _sl ;
         if( MathRand( ) < 32768. * ratio / 2  )         return( - _sl-2 );     /// fail
         else                                            return(   _tp-2 );     /// success   
      }//+------------------------------------------------------------------+