MODE_TICKVALUE -- LIES !!!! :) - page 3

 
SProgrammer писал(а) >>

Je suis plutôt intelligent, tu sais :) - Je le faisais fonctionner dans le testeur. Il ne peut pas y avoir quelque chose d'indéterminé.

J'ai donné un exemple ici - pouvez-vous calculer à la main ? Je vous ai également donné la réponse de Marketinfo.

Il existe une calculatrice JavaScript sur les sites web de nombreuses sociétés de courtage, vous pouvez la copier et voir comment calculer correctement.

 

Pour les paires de devises où la devise de cotation est la même que la devise de dépôt.

MarketInfo(Symbol(),MODE_LOTSIZE)*MarketInfo(Symbol(),MODE_TICKSIZE) 

dans la version étendue, vous devrez analyser la devise de la citation...

 

Depo devise USD, lancer le code sur le graphique USDJPY, les lectures sont les mêmes.

MarketInfo(Symbol(),MODE_LOTSIZE)*MarketInfo(Symbol(),MODE_TICKSIZE) )/MarketInfo(Symbol(),MODE_BID)
On peut donc faire confiance au ver à tique...
 
SProgrammer >>:

Вы ручками считать проверяли?

Je sais seulement comment le faire automatiquement :

#property show_inputs

extern string BaseCurrency = "USD";

bool RealSymbol( string Str )
{
  return(MarketInfo( Str, MODE_BID) != 0);
}

double GetTickValue( string Symb, bool Average )
{
  string Str, ProfitCurrency, SymbolPrefix;
  double Res, PriceExchage;
  
  ProfitCurrency = StringSubstr( Symb, 3, 3);
  SymbolPrefix = StringSubstr( Symb, 6);
  
  if ( ProfitCurrency == BaseCurrency)
    Res = MarketInfo( Symb, MODE_LOTSIZE) * MarketInfo( Symb, MODE_TICKSIZE);
  else
  {
    Str = BaseCurrency + ProfitCurrency + SymbolPrefix;
    
    if ( RealSymbol( Str))
    {
      if ( Average)
        PriceExchage = (MarketInfo( Str, MODE_BID) + MarketInfo( Str, MODE_ASK)) / 2;
      else
//        PriceExchage = MarketInfo(Str, MODE_BID); // Так считает MetaTrader4 - неправильно
        PriceExchage = MarketInfo( Str, MODE_ASK); // Правильный вариант
        
      Res = MarketInfo( Symb, MODE_LOTSIZE) * MarketInfo( Symb, MODE_TICKSIZE) / PriceExchage;
    }
    else
    {
      Str = ProfitCurrency + BaseCurrency + SymbolPrefix;

      if ( Average)
        PriceExchage = (MarketInfo( Str, MODE_BID) + MarketInfo( Str, MODE_ASK)) / 2;
      else
        PriceExchage = MarketInfo( Str, MODE_BID);
        
      Res = MarketInfo( Symb, MODE_LOTSIZE) * MarketInfo( Symb, MODE_TICKSIZE) * PriceExchage;
    }
  }
  
  return( Res);
}

void start()
{  
  double TickValue, TickValue1, TickValue2;
  
  TickValue = MarketInfo(Symbol(), MODE_TICKVALUE);
  TickValue1 = GetTickValue(Symbol(), TRUE);
  TickValue2 = GetTickValue(Symbol(), FALSE);
  
  Print("MT4 TickValue = " + DoubleToStr( TickValue, 5));
  Print("Average TickValue = " + DoubleToStr( TickValue1, 5));
  Print("Real TickValue = " + DoubleToStr( TickValue2, 5));
  
  return;
}

Vous aviez raison, MODE_TICKVALUE ne compte pas correctement dans certains cas : tout ne compte que via le prix BID, même quand cela devrait compter via le prix ASK.

 
getch >>:

Умею только автоматом:

Вы оказались правы, MODE_TICKVALUE считается в некоторых случаях некорректно: все считается только через BID-цену, даже когда надо считать через ASK-цену.

Quelle est la marge d'erreur ?

 
kombat >>:

А насколь % эта погрешность?

Assez pour que les auditeurs se posent des questions.

 
getch >>:

Достаточная, чтобы у аудиторов возникли вопросы.

Sur le volume de la tique ? ??

Je croyais qu'ils ne s'intéressaient qu'au prix d'ouverture et au prix de clôture... ?

 
kombat >>:

Нуно не одна из, а та что валюта котировки, JPY в данном случае.

Regardez -


USDJPY


testeur sur la période


2008/10/01 -> 2009/01/01


Passer au 2008/10/01


====


2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_FREEZELEVEL=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_MARGINREQUIRED=1000.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_MARGINHEDGED=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_MARGINMAINTENANCE=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_MARGININIT=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_MARGINCALCMODE=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_PROFITCALCMODE=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_SWAPTYPE=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_MAXLOT=1000.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_LOTSTEP=0.10000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_MINLOT=0.10000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_TRADEALLOWED=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_EXPIRATION=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_STARTING=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_SWAPSHORT=-0.50000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_SWAPLONG=-0.50000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_TICKSIZE=0.00100000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_TICKVALUE=1.09488252

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_LOTSIZE=100000.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_STOPLEVEL=20.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_SPREAD=19.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_DIGITS=3.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_POINT=0.00100000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_ASK=111.70900000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_BID=111.69000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_TIME=1199260860.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_HIGH=0.00000000

2010.01.13 12:14:42 2008.01.02 08:01 OTestExpert3 USDJPY,M1 : MODE_LOW=0.00000000


=============


string s=Symbol();
   
   int Code2[]={  MODE_LOW,
                  MODE_HIGH,
                  MODE_TIME,
                  MODE_BID,
                  MODE_ASK,
                  MODE_POINT,
                  MODE_DIGITS,
                  MODE_SPREAD,
                  MODE_STOPLEVEL,
                  MODE_LOTSIZE,
                  MODE_TICKVALUE,
                  MODE_TICKSIZE,
                  MODE_SWAPLONG,
                  MODE_SWAPSHORT,
                  MODE_STARTING,
                  MODE_EXPIRATION,
                  MODE_TRADEALLOWED,
                  MODE_MINLOT,
                  MODE_LOTSTEP,
                  MODE_MAXLOT,
                  MODE_SWAPTYPE,
                  MODE_PROFITCALCMODE,
                  MODE_MARGINCALCMODE,
                  MODE_MARGININIT,
                  MODE_MARGINMAINTENANCE,
                  MODE_MARGINHEDGED,
                  MODE_MARGINREQUIRED,
                  MODE_FREEZELEVEL
               };
   string CodeName2[]={"MODE_LOW",
                        "MODE_HIGH",
                        "MODE_TIME",
                        "MODE_BID",
                        "MODE_ASK",
                        "MODE_POINT",
                        "MODE_DIGITS",
                        "MODE_SPREAD",
                        "MODE_STOPLEVEL",
                        "MODE_LOTSIZE",
                        "MODE_TICKVALUE",
                        "MODE_TICKSIZE",
                        "MODE_SWAPLONG",
                        "MODE_SWAPSHORT",
                        "MODE_STARTING",
                        "MODE_EXPIRATION",
                        "MODE_TRADEALLOWED",
                        "MODE_MINLOT",
                        "MODE_LOTSTEP",
                        "MODE_MAXLOT",
                        "MODE_SWAPTYPE",
                        "MODE_PROFITCALCMODE",
                        "MODE_MARGINCALCMODE",
                        "MODE_MARGININIT",
                        "MODE_MARGINMAINTENANCE",
                        "MODE_MARGINHEDGED",
                        "MODE_MARGINREQUIRED",
                        "MODE_FREEZELEVEL"
                        };
   
   for ( i=0; i< ArraySize( Code2); i++){
      
      double mre  = MarketInfo ( s, Code2[ i]);
      int    err = GetLastError();
         
      Print ( CodeName2[ i],"=", DoubleToStr( mre,9));
 
      
      if ( ERR_NO_ERROR != err )
          Print ( "error(", err,")", "--", ErrorDescription( err)  );
 
SProgrammer >>:

MODE_TICKVALUE для EURUSD по маркетинфо = 1.0000000 :), а не 10.


1 - pour 5 chiffres

10 - pour 4

 
kombat >>:

По тик волуму???

Мне казалось что их интересует лишь цена окрытия цена закрытия...

Je ne sais pas comment les développeurs calculent les bénéfices. S'ils le font via MODE_TICKVALUE, dans certains cas, le bénéfice est compté de manière incorrecte - plus qu'il ne l'est en réalité. Par exemple, sur le GBPJPY.

Mais en fait, MetaTrader4 ne calcule pas du tout les profits - il convertit immédiatement la devise des profits en devise de base du compte. La manière correcte de le faire est au moment de la valeur.

Sur le marché interbancaire, l'équité change constamment si vous avez ouvert et fermé une position avec une devise de profit qui n'est pas égale à la devise du compte (par exemple, sur un compte en USD, vous avez effectué une transaction en USDJPY). Ce n'est qu'au moment de la valorisation (j'utilise peut-être le terme de manière incorrecte) que les capitaux propres sont fixés (en utilisant l'exemple - le bénéfice en JPY est converti au taux de change actuel USDJPY à USD).

Le plus intéressant est de savoir comment le profit est compté, par exemple pour AUDNZD sur le compte EUR, lorsque le taux EURNZD n'est pas disponible auprès du courtier...