Hi, after much thought I figured this is a rather newbie question so I decided to post here instead of other forums, I hope it is the correct place.
I am in the process of converting real-time metatrader 4 prices into historical prices for my website created for this community. However, I have came across a problem I am unsure of :
There is another issue regarding the compilation of current prices into historical prices.
If you notice,
current price:
datetime time; // Time of the last prices update
double bid; // Current Bid price
double ask; // Current Ask price
double last; // Price of the last deal (Last)
ulong volume; // Volume for the current Last price
historical price:
datetime time; // Period start time
double open; // Open price
double high; // The highest price of the period
double low; // The lowest price of the period
double close; // Close price
long tick_volume; // Tick volume
int spread; // Spread
long real_volume; // Trade volume
Supposed I now want to compile the H1 bar for the previous hour.
In one H1 bar, we will have a set of current prices.
Notice each current price consists a time, bid, ask, last and volume.
We will need to compile this set of current prices into one historical price for H1 bar, consisting time, open, high, low, close, tick_volume, spread and real_volume.
I know for the open, it is the opening ask price right at the beginning of that H1 bar.
For the high, it is the high the current ask price reached during that hour.
For the low, it is the low the current ask price reached during that hour.
Close is simple, just the last ask price of that hour.
But how do I determine tick volume, spread and real volume?
Would appreciate any help that I can get! Thanks in advance oh kind souls!
Warmest regard,
Desmond