Is volume accessible by EA during tests? - page 2

 
metadevEU #: Can you guys confirm if the Strategy Tester populates the MqlTick.last even when the broker does not provide this information? Is this the expected behaviour?
Yes, but it depends on the kind of symbol. Only some symbols offer "last" prices, for example Futures which offer Last/Volume, but not Forex and CFDs which only use Ask/Bid.
 
metadevEU #:
Can you guys confirm if the Strategy Tester populates the MqlTick.last even when the broker does not provide this information? Is this the expected behaviour?

According to the logic of a tick, the last price could be synthesized.

The idea of "last price", following the documentation, is the price of the last deal on that asset. Since tick updates inform you about a price change, you could (at least) deduct the fact, the order book has changed in such manner, that the current price levels volume has been "eaten up". Although this will not be as accurate as the last price, but if a change has happened, the tick structure will inform you at least of a change of one ask or bid value.

Thus, depending on the flags of the tick, you can deduct to some estimate, the last price value by that change, and conclude, the change between this and the last ticks values is your last price.

Though, this method will not inform you of the actual "volume eating process" as long as the volume is not eaten up. But for a fair estimate, it should do the purpose.

Also, this allows to some degree a synthetic build up of a more or less historic order book, which also is not available in decentralized markets.

Although, this might introduce errors, and a not very precise real picture of the state of the markets tension, it can give some insights. Especially when also factoring in the spread deviation, as this can give some insight to the order sizes being executed. Because larger orders will widen the spread more than small orders, or levels of volume in the order book respectively.

Of course, this is all quite theoretically, to some extend, this is also quite viable, as that is actually what makes the market move anyways.
 
Dominik Egert #:

According to the logic of a tick, the last price could be synthesized.

The idea of "last price", following the documentation, is the price of the last deal on that asset. Since tick updates inform you about a price change, you could (at least) deduct the fact, the order book has changed in such manner, that the current price levels volume has been "eaten up". Although this will not be as accurate as the last price, but if a change has happened, the tick structure will inform you at least of a change of one ask or bid value.

Thus, depending on the flags of the tick, you can deduct to some estimate, the last price value by that change, and conclude, the change between this and the last ticks values is your last price.

Though, this method will not inform you of the actual "volume eating process" as long as the volume is not eaten up. But for a fair estimate, it should do the purpose.

Also, this allows to some degree a synthetic build up of a more or less historic order book, which also is not available in decentralized markets.

Although, this might introduce errors, and a not very precise real picture of the state of the markets tension, it can give some insights. Especially when also factoring in the spread deviation, as this can give some insight to the order sizes being executed. Because larger orders will widen the spread more than small orders, or levels of volume in the order book respectively.

Of course, this is all quite theoretically, to some extend, this is also quite viable, as that is actually what makes the market move anyways.

That seems to me very optimistic and misleading. There is no direct relation between the last price (the true one) and a change in bid/ask. A deal (last price) can sometimes be accompanied by a change in bid/ask, it can also be without change on bid/ask. That's on a centralized market. The OP is trading XAUUSD which is probably a CFD or maybe "Forex"...in which case it's far worst.

 
Alain Verleyen #:

That seems to me very optimistic and misleading. There is no direct relation between the last price (the true one) and a change in bid/ask. A deal (last price) can sometimes be accompanied by a change in bid/ask, it can also be without change on bid/ask. That's on a centralized market. The OP is trading XAUUSD which is probably a CFD or maybe "Forex"...in which case it's far worst.

What part do you think is misleading? The outline, and I think, I did make it somewhat clear, is an estimate, and will not hold up to actual deals, but to changes of available volume on a certain price level.

Also, why is this optimistic? Isn't that the exact happening, and the conclusion to be drawn from these data? And if not, how would you phrase it, such that it outlines the actually available deductable information?

After all, if tick volume is an acceptable compromise versus real volume, which studies and lots of successful traders, basing their trade decisions on volume, shouldn't this also be a valid conclusion?

I would go as far as state, this holds true to most, if not all assets traded.

As we can see on sentiment data, which have different sources, the overall tendencies of these data are congruent in their expression, and point to the same conclusion.

So why shouldn't this hold up as well for volume, spread and give insight to some extend into a sort of order book.

I would say, you cannot know the current order book, but you can to a certain extent draw an outline of the past order book, or the history of the order book.


 
Thank you, guys, for the confirmation.
 
Dominik Egert #:
What part do you think is misleading? The outline, and I think, I did make it somewhat clear, is an estimate, and will not hold up to actual deals, but to changes of available volume on a certain price level.

Also, why is this optimistic? Isn't that the exact happening, and the conclusion to be drawn from these data? And if not, how would you phrase it, such that it outlines the actually available deductable information?

After all, if tick volume is an acceptable compromise versus real volume, which studies and lots of successful traders, basing their trade decisions on volume, shouldn't this also be a valid conclusion?

I would go as far as state, this holds true to most, if not all assets traded.

As we can see on sentiment data, which have different sources, the overall tendencies of these data are congruent in their expression, and point to the same conclusion.

So why shouldn't this hold up as well for volume, spread and give insight to some extend into a sort of order book.

I would say, you cannot know the current order book, but you can to a certain extent draw an outline of the past order book, or the history of the order book.


Rather than useless discussion it would be interesting to check it using real data. If at some point you want to provide some code to test your idea of a "simulated" last price and " a synthetic build up of a more or less historic order book", I could check it and compare the results with real last price and order book.

I am strongly sceptical it could lead to anything really useful, but I would be glad to be wrong.

 
Alain Verleyen #:

Rather than useless discussion it would be interesting to check it using real data. If at some point you want to provide some code to test your idea of a "simulated" last price and " a synthetic build up of a more or less historic order book", I could check it and compare the results with real last price and order book.

I am strongly sceptical it could lead to anything really useful, but I would be glad to be wrong.

I am not sure if I want to accept this challenge right now, as it is a bucket load of work, and I am currently not having a cler timeline on when this could be done.

What source/symbol would you use to verify, btw?

 
Dominik Egert #:

I am not sure if I want to accept this challenge right now, as it is a bucket load of work, and I am currently not having a cler timeline on when this could be done.

What source/symbol would you use to verify, btw?

Don't need to be right now.

On a Futures symbol.

Reason: