Download MetaTrader 5

I do not have the current prices, but the previous tick prices

To add comments, please log in or register
Christian
91
Christian  

Hi,

I use the OnTick event to manage the position. When I want to have the current Profit requesting the position with PositionGetDouble(POSITION_PROFIT), I have only the previous tick Profit.

How can I have the very current datas using OnTick, or another event...

Christian

phi nuts
2181
phi nuts  
c2h:

Hi,

I use the OnTick event to manage the position. When I want to have the current Profit requesting the position with PositionGetDouble(POSITION_PROFIT), I have only the previous tick Profit.

How can I have the very current datas using OnTick, or another event...

Christian

I'm very curious, how do you know that profit value from PositionGetDouble(POSITION_PROFIT) was based on previous tick ?
Christian
91
Christian  

Quite easy :

 

Look at the order console : the profit is always ahead of the datas from PositionGetDouble(POSITION_PROFIT).

 

Christian 

phi nuts
2181
phi nuts  
c2h:

Quite easy :

 

Look at the order console : the profit is always ahead of the datas from PositionGetDouble(POSITION_PROFIT).

 

Christian 

I'm using MetaQuotes Server, and no, the profit from toolbox's trade tab is the same one every tick with PositionGetDouble (POSITION_PROFIT).
Christian
91
Christian  

Does that mean that if I use another server (from my broker in my case), the prices are not "true" ?

phi nuts
2181
phi nuts  
c2h:

Does that mean that if I use another server (from my broker in my case), the prices are not "true" ?

Nope, I also test that with Alpari UK, Mig Bank, and GoMarket MT5.
Christian
91
Christian  

Thanks.

 

Would you have a hint for me to go ahead to solve this problem ?

 

Christian

 

phi nuts
2181
phi nuts  
c2h:

Thanks.

 

Would you have a hint for me to go ahead to solve this problem ?

 

Christian

 

I thought there's no problem, so I'm not so sure how did you came to this idea that the PositionGetDouble(POSITION_PROFIT) is late. I just simply run that function in EA and see its value on chart comment, and the value is updated at the same tick. 
Christian
91
Christian  

SOLVED :

Need to refresh the graph to have very last datas shown. 

phi nuts
2181
phi nuts  
c2h:

SOLVED :

Need to refresh the graph to have very last datas shown. 

Maybe you need RefreshRates, which actually using SymbolInfoTick()
To add comments, please log in or register