Prix par tuyau - page 10

 

Le plus simple est d'utiliser un courtier de spreadbetting sur MT4 qui fait le calcul pour vous, le prix du volume sur votre ticket de transaction n'est pas en lots mais en livres et en pence, par exemple 4,20 £ par pip (ou la devise de votre choix).

J'utilise http://www.gkfx.co.uk/spreadbetting-on-MetaTrader4

 
LEHayes:

Je ne suis pas sûr d'être sur la bonne voie, mais voici ce que j'ai rassemblé jusqu'à présent.

Sur un autre site web, le calcul était quelque chose comme :

(.0001/{cours actuel de la paire})*{taille du contrat, c'est-à-dire 100 000 ; 10 000, etc} = {une certaine valeur} * {prix USD} = Prix par Pip

Expliqué à partir de cette extraction :

La formule pour calculer la valeur du pip forex est de prendre un pip et de le diviser par le prix de la valeur de la paire de devises et ensuite de le multiplier par une unité qui est 10000. Vous devez ensuite le convertir en USD et le multiplier par le prix actuel. Par exemple, en utilisant le USDCAD

(.0001/1.2148) X 10000 = .8232 X 1.2148 = $1.00

Vous verreztoujours qu'avec n'importe quelle paire de devises, la valeur du pip est toujours de 1,00 $ par 10000 unités monétaires. Vous pouvez penser que cette valeur est très faible. Cependant, vous devez prendre en compte que les devises sont négociées en lots de 100 000,00 $, ce qui représente 10,00 $ par pip. Lorsque vous achetez un lot pour 10,00 $ et que la devise augmente de 3 pips, vous avez gagné 30,00 $.


Merci les gars, j'ai emprunté du code et voici ma contribution

double GetPPP( string symbol = "", double lots = 0.00 ){
   string sym = Symbol();
   if( symbol != "" ) sym = symbol ;
   double size = 1.00;
   if( lots > 0 ) size = lots ;
   string first = StringSubstr( symbol, 0, 3 );
   string second = StringSubstr( symbol, 3, 3 );
   string currency = AccountCurrency();
   if( symbol == "AUDCAD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "AUDCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "AUDJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) )  * 100 );
   } else if( symbol == "AUDUSD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) ); 
   } else if( symbol == "AUDNZD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "CADCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints / AvgPrice( StringConcatenate( currency, first ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "CADJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints / AvgPrice( StringConcatenate( currency, first ) ) / AvgPrice( StringConcatenate( first, second ) )  * 100 );
   } else if( symbol == "CHFJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints / AvgPrice( StringConcatenate( currency, first ) ) / AvgPrice( StringConcatenate( first, second ) )  * 100 );
   } else if( symbol == "EURAUD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURCAD" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURGBP" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   }  else if( symbol == "EURJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) )  * 100 );
   } else if( symbol == "EURNZD" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURusd" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPAUD" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPCAD" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPCHF" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPJPY" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) * 100 );
   } else if( symbol == "GBPNZD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPUSD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "NZDCAD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "NZDCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "NZDJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) * 100  );
   } else if( symbol == "NZDUSD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   }  else if( symbol == "USDCAD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * 1 / AvgPrice( StringConcatenate( first, second  ) ) );
   }  else if( symbol == "USDCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * 1 / AvgPrice( StringConcatenate( first, second  ) ) );
   }  else if( symbol == "USDJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * PipPoints * 1 / AvgPrice( StringConcatenate( first, second  ) ) * 100 ) ;
   } else {
      Print("Symbol ",symbol," is not supported.");
   }
}
 

Désolé les gars, voici une mise à jour, j'ai enlevé lesPipPoints et fixé le symbole, et je n'ai pas réalisé que cela dépendait d'une de mes autres utilisations :

double PPP =GetPPP(Symbol()) ;

double PPP =GetPPP(Symbol() , 0.5) ;

double PPP =GetPPP( "NZDJPY");

J'espère que cela vous aidera et merci pour le démarrage.

double AvgPrice( symbol ){
   double bid, ask;
   ask = NormalizeDouble( MarketInfo( sym, MODE_ASK ), digits );
   bid = NormalizeDouble( MarketInfo( sym, MODE_BID ), digits ); 
   return ( ( ask + bid ) / 2 );
}
double GetPPP( string symbol, double lots = 0.00 ){
   double size = 1.00;
   if( lots > 0 ) size = lots ;
   string first = StringSubstr( symbol, 0, 3 );
   string second = StringSubstr( symbol, 3, 3 );
   string currency = AccountCurrency();
   if( symbol == "AUDCAD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "AUDCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "AUDJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.01 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "AUDUSD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) ); 
   } else if( symbol == "AUDNZD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "CADCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 / AvgPrice( StringConcatenate( currency, first ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "CADJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.01 / AvgPrice( StringConcatenate( currency, first ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "CHFJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.01 / AvgPrice( StringConcatenate( currency, first ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURAUD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURCAD" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURGBP" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   }  else if( symbol == "EURJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.01 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURNZD" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "EURusd" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPAUD" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPCAD" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPCHF" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPJPY" ){
     return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.01 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPNZD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "GBPUSD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "NZDCAD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "NZDCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "NZDJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.01 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   } else if( symbol == "NZDUSD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * AvgPrice( StringConcatenate( first, currency ) ) / AvgPrice( StringConcatenate( first, second ) ) );
   }  else if( symbol == "USDCAD" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * 1 / AvgPrice( StringConcatenate( first, second  ) ) );
   }  else if( symbol == "USDCHF" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.0001 * 1 / AvgPrice( StringConcatenate( first, second  ) ) );
   }  else if( symbol == "USDJPY" ){
      return ( size * MarketInfo( symbol, MODE_LOTSIZE ) * 0.01 * 1 / AvgPrice( StringConcatenate( first, second  ) ) ) ;
   } else {
      Print("Symbol ",symbol," is not supported.");
   }
}
 

Désolé de remonter un fil de 2013,

Mais est-ce que quelqu'un a fait ou trouvé un outil qui me permet d'entrer une valeur pour me payer par pip et il me dira la taille du lot entré par paire de devises comme un compte de spread bet mais pour les comptes forex standard ?

 
Ne risquez jamais plus qu'un petit pourcentage de votre compte, certainement moins de 2% par transaction, 6% au total.
  1. En code (MT4) : Le risque dépend de votre stop loss initial, de la taille du lot et de la valeur de la paire. Il ne dépend pas de la marge et de l'effet de levier.
    1. Vous placez le stop là où il doit être - là où la raison de la transaction n'est plus valable. Par exemple, si vous négociez un rebond de support, le stop passe sous le support.
    2. AccountBalance * pourcentage/100 = RISK = Lots d'ordres * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Notez que OOP-OSL inclut le spread, et DeltaPerLot est généralement autour de 10 $/pip mais il prend en compte les taux de change de la paire par rapport à la devise de votre compte).
    3. N'utilisez PAS TickValue par lui-même - DeltaPerLot et vérifiez que MODE_TICKVALUE renvoie une valeur dans votre devise de dépôt, comme promis par la documentation, ou s'il renvoie une valeur dans la devise de base de l'instrument.
      MODE_TICKVALUE n'est pas fiable sur les instruments non-fx avec de nombreux courtiers - forum de programmation MQL4 2017.10.10
      Existe-t-il une solution universelle pour la valeur Tick ? -Paires de devises - Général - Forum de programmation MQL5 2018.02.11
      Calcul de la valeur du lot décalé d'un facteur 100 - MQL5 programming forum 2019.07.19
    4. Vous devez normaliser les lots correctement et vérifier les valeurs min et max.
    5. Vous devez également vérifier le FreeMargin pour éviter le stop out.

    La plupart des paires valent environ 10 $ par PIP. Un risque de 5$ avec un SL (très petit) de 5 PIP est de 5$/10/5 ou 0.1 Lots maximum.

  2. Utilisez un EA GUI/Trade Assistant comme le mien (pour MT4) : indicateur 'Money Manager Graphic Tool' par 'takycard' - Risk Management - Articles, commentaires de la bibliothèque - MQL5 programming forum - Page 6 #55
 
//+------------------------------------------------------------------+
//|                                                      getInfo.mq4 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Open Source"
#property link      
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {


   double LotSize= 1;
   double point= Point;
   if((Digits==3) || (Digits==5))
     {
      point*=10;
     }
   string DepositCurrency=AccountInfoString(ACCOUNT_CURRENCY);  
   double PipValue=(((MarketInfo(Symbol(),MODE_TICKVALUE)*point)/MarketInfo(Symbol(),MODE_TICKSIZE))*LotSize);
    
   
   
   MessageBox("DEPOSIT CURRENCY"+ DepositCurrency ,"ToolBox");
   MessageBox("VALUE OF ONE PIP (1 LOT)="+ PipValue ,"ToolBox");
   
   
  }
//+------------------------------------------------------------------+
Raison: