How To Get Pip Movement of last x seconds

 

Hey,

I need to find a way to calculate the pip movement of the pair for the last x seconds, for instance the last 5 seconds.

I know I should do something with Time[] as it is in seconds, but not sure how to structure this, please help!

Thanks

 

AFAIK tick data isn't stored so you can't look back retrospectively. I suspect you could store the value, sleep for 5 seconds and check where you are now to where you were when you took the value. I don't think that will be much help though.

V

 

Hey Viffer thanks for the idea,

I have seen an EA that plots a 5 second chart so there must be a way to do it.

Regards

 
The problem that I'm facing is there are certain seconds where no tick data is sent, and this screws up any calculations that I'm doing
 
Are you sure MT does not store tick data ? Using the strategy tester tick data is used
 
I see the Time[] function only gives the start time of the bar. Any time how to get the NOW time in seconds ?
 

Strategy Tester creates its own fake ticks.

TimeCurrent() or TimeLocal()

 
phy, thanks, did not know that! Interesting...
 
Saidar:

Hey Viffer thanks for the idea,

I have seen an EA that plots a 5 second chart so there must be a way to do it.

Regards

I'm not sure, but I suspect they must be building their own arrays to store OHLC every 5 seconds. It's in the same vein as I suggested to store the value and then look back after 5 seconds. But I don't think it's possible to look back 5 seconds from a standard 1 min chart, because the only data that is stored is OHLC with the latest tick,obviously, being the close.
V
 
See attached is an expert that gives the values for the 5 second moves. Not sure how they did it though
Files:
extremebar.ex4  12 kb
 
phy:

Strategy Tester creates its own fake ticks.

TimeCurrent() or TimeLocal()

phy,


please expound.. what do you mean by 'it creates its own fake ticks'? Thanks!

Reason: