_point and take profit

 

Hi everyone, I'm new in MQL5/Metatrader, I'm wiritng my first EA and I'm a bit confused with Takeprofit calculation. I want to place a buy order with 60pips take profit target, looking at some example and documentation I thought the code below was correct, but it creates orders with take profit of 6 pips. What am I doing wrong? I'm working on GBPUSD 

 

  //global vars

   static double tp_pips = 60;

   static double sl_pips = 30;

//+------------------------------------------------------------------+

//+------------------------------------------------------------------+

   double p  = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_ASK), _Digits);

   double tp = p + (tp_pips * _Point);

   double sl = p - (sl_pips * _Point);

   trade.Buy(LotSize, _Symbol, p, sl, tp, NULL);

   trade_error_code = trade.ResultRetcode();
Basic Principles - Trading Operations - MetaTrader 5 Help
Basic Principles - Trading Operations - MetaTrader 5 Help
  • www.metatrader5.com
is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels. is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the...
 
gippo37It:

Hi everyone, I'm new in MQL5/Metatrader, I'm wiritng my first EA and I'm a bit confused with Takeprofit calculation. I want to place a buy order with 60pips take profit target, looking at some example and documentation I thought the code below was correct, but it creates orders with take profit of 6 pips. What am I doing wrong? I'm working on GBPUSD 

   //global vars

   static double tp_pips = 60;

   static double sl_pips = 30;

//+------------------------------------------------------------------+

//+------------------------------------------------------------------+

   double p  = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_ASK), _Digits);

   double tp = p + (tp_pips * _Point);

   double sl = p - (sl_pips * _Point);

   trade.Buy(LotSize, _Symbol, p, sl, tp, NULL);

   trade_error_code = trade.ResultRetcode();

Please use code formating.

For your question, if 60 gives 6 pips. What about 600?

 
  1. gippo37It: but it creates orders with take profit of 6 pips. What am I doing wrong?
    1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
                General rules and best pratices of the Forum. - General - MQL5 programming forum
                Messages Editor

      1. A PIP is not a point.

      2. PIP, Point, or Tick are all different in general.
                  What is a TICK? - MQL4 programming forum

      3. Unless you manually adjust your SL/TP for each separate symbol, using Point means code breaks on 4 digit brokers, exotics (e.g. USDZAR where spread is over 500 points,) and metals. Compute what a PIP is and use it, not points.
                  How to manage JPY pairs with parameters? - MQL4 programming forum
                  Slippage defined in index points - Currency Pairs - Expert Advisors and Automated Trading - MQL5 programming forum

  2. Nelson Wanyama: What about 600?
    Only fixes for that symbol, that broker. № 1.2.3
 
Nelson Wanyama:

Please use code formating.

For your question, if 60 gives 6 pips. What about 600?

Hi sorry as I said I'm new I didn't know about code formating, I've edited my post.