Download MetaTrader 5

How to calculate pip value in currency account (USD, EUR etc) some bars ago or some time ago?

To add comments, please log in or register
Format text in the messages editor. It is convenient!
Old Forex -Trader
311
Old Forex -Trader 2015.02.15 10:06 

Hi,

 

Using SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE)  I can get pip value only for current time but I cannot do it in past. (SYMBOL_TRADE_TICK_VALUE is a  on the standard lot, in the currency of the account. For instance is 1$ in USD  currency account  at EURUSD, if the lot is 100000, with 5 digits, or 10$, for 4 digits. I think it is not possible to get the same information using standard mql5 function in past time for example 100 bars ago or 1 hour ago.  Can you give me some piece of advice how to solve this problem in custom indicator? I need it to calculate  pip value for risk  in past for statistic  but I do not know how to synchronize the same time because some bars are lacking  in some pairs of currency  so using the same amount of bars in past is the wrong.

 

Very welcome

Alain Verleyen
Moderator
30744
Alain Verleyen 2015.02.15 10:34  
Toyota:

Hi,

 

Using SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE)  I can get pip value only for current time but I cannot do it in past. (SYMBOL_TRADE_TICK_VALUE is a  on the standard lot, in the currency of the account. For instance is 1$ in USD  currency account  at EURUSD, if the lot is 100000, with 5 digits, or 10$, for 4 digits. I think it is not possible to get the same information using standard mql5 function in past time for example 100 bars ago or 1 hour ago.  Can you give me some piece of advice how to solve this problem in custom indicator? I need it to calculate  pip value for risk  in past for statistic  but I do not know how to synchronize the same time because some bars are lacking  in some pairs of currency  so using the same amount of bars in past is the wrong.

 

Very welcome

If you want precision, you cannot do that with OHLC history prices, you don't know that exact time these prices occur. If you can live with some impreciseness, you can use OC.

Otherwise you need to record the prices of each involved pairs, to calculate a TICK_VALUE yourself. An other way is to record SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE) itself.

Old Forex -Trader
311
Old Forex -Trader 2015.02.15 12:41  
angevoyageur:

If you want precision, you cannot do that with OHLC history prices, you don't know that exact time these prices occur. If you can live with some impreciseness, you can use OC.

Otherwise you need to record the prices of each involved pairs, to calculate a TICK_VALUE yourself. An other way is to record SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE) itself.

Thanks, but SYMBOL_TRADE_TICK_VALUE  records only last current pip value so when I use it in indicator thethe same value is records all the time. I think it is very difficult because I need calculate for each past bar (eg. open  prices for 2 or 1 minute frame) for each pair of currency but how to synchronize it.

Very welcome
To add comments, please log in or register