Digits need simple help

 

Hello

the ea ist allmost finish
i have a little problem
i want set in a variable a pip intiger
i need this as double

example

distanz = 300;

         if(distanz > 0.003

how can i set this with funktion Digits?
so that the ea works on euro and JPY ?
this is the last thing

thx for help 

if i print the distanz with using _Digits come this messsage

2022.09.08 13:09:23.501 2022.08.02 17:06:08  ,M15: 1250


 
Tarsock :

Hello

the ea ist allmost finish
i have a little problem
i want set in a variable a pip intiger
i need this as double

example

distanz = 300;

         if(distanz > 0.003

how can i set this with funktion Digits?
so that the ea works on euro and JPY ?
this is the last thing

thx for help 

if i print the distanz with using _Digits come this messsage

2022.09.08 13:09:23.501 2022.08.02 17:06:08  ,M15: 1250


I did not understand anything

 
Tarsock: Hello ...  thx for help 

Please use the German forum. We have difficulty understanding your English.

Forum für Händler - MQL5 community
Forum für Händler - MQL5 community
  • www.mql5.com
MQL5: Forum über Handel, automatische Handelssysteme und Strategietests
 

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

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 (2017)
          Slippage defined in index points - Expert Advisors and Automated Trading - MQL5 programming forum (2018)

 
example

distanz = 300;

         if(distanz > 0.003


Use integer variable for the distance in Points and then multiply it with SymbolInfoDouble(sym, SYMBOL_TRADE_TICK_SIZE).

this way you get the gap of 300 points in ticks of a symbol - no matter how many digits the quotes have.

Documentation on MQL5: Market Info / SymbolInfoDouble
Documentation on MQL5: Market Info / SymbolInfoDouble
  • www.mql5.com
SymbolInfoDouble - Market Info - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5