Price Per pip - page 10

 

The easiest way is to use a spreadbetting broker on MT4 who does the calculation for you, the volume price on your trade ticket is not in lots but Pounds and pence e.g £4.20 per pip (or whatever currency you want) This makes accurate trade sizing very simple.

I use http://www.gkfx.co.uk/spreadbetting-on-MetaTrader4

 
LEHayes:

I am not sure if I am on the right track, but here is what I have put together so far.

From another web site the calculation was something like:

(.0001/{current pairs price})*{contract size, ie 100,000; 10,000, etc} = {some value} * {USD price} = Price Per Pip

Explained from this extraction:

The formula to calculate forex pip value is to take one pip and divide it by the price of the currency pair value and then multiply it by one unit which is 10000. You then need to change it to the USD so you multiply it by the current price. For Example Using the USDCAD

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

You will always see that with any currency pair the pip value is always $1.00 per 10000 currency units. You may think that this value is very low. However you need to take into account that currencies are traded in lots of $100,000.00 which is $10.00 per pip. When you purchase one lot for $10.00 and the currency increases by 3 pips you have gained $30.00.


Thanks guys, i borrowed some code and here is my 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.");
   }
}
 

sorry guys here is an update, removed PipPoints and fixed symbol, and didnt realize it depended on one of my other use age:

 double PPP = GetPPP( Symbol() );

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

double PPP = GetPPP( "NZDJPY" ); 

Hope it helps and thanks for starter.

 

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.");
   }
}
 

sorry to bump thread from 2013,

But has anyone made or found an indi that i can input a value to pay me per pip and it will tell me lot size input per currency pair like a spread bet account but for standard forex accounts?

 
Never risk more than a small percentage of your account, certainly less than 2% per trade, 6% total.
  1. In code (MT4): Risk depends on your initial stop loss, lot size, and the value of the pair. It does not depend on margin and leverage.
    1. You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
    2. AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
    3. Do NOT use TickValue by itself - DeltaPerLot and verify that MODE_TICKVALUE is returning a value in your deposit currency, as promised by the documentation, or whether it is returning a value in the instrument's base currency.
                MODE_TICKVALUE is not reliable on non-fx instruments with many brokers - MQL4 programming forum 2017.10.10
                Is there an universal solution for Tick value? - Currency Pairs - General - MQL5 programming forum 2018.02.11
                Lot value calculation off by a factor of 100 - MQL5 programming forum 2019.07.19
    4. You must normalize lots properly and check against min and max.
    5. You must also check FreeMargin to avoid stop out

    Most pairs are worth about $10 per PIP. A $5 risk with a (very small) 5 PIP SL is $5/$10/5 or 0.1 Lots maximum.

  2. Use a GUI/Trade Assistant EA like mine (for MT4): 'Money Manager Graphic Tool' indicator by 'takycard' - Risk Management - Articles, Library comments - 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");
   
   
  }
//+------------------------------------------------------------------+