Page 1 of 1

TradeDataListener onTrade -> double price in ticks?

Posted: Thu Mar 28, 2019 11:34 am
by fansonly
Hello -

stepping through the examples and creating a few indicators of my own, I made not of the fact that the price in the on trade method was in ticks.

For example, for an ESM9 contract price = 11132.0 (which is 4x the number of ticks at a price of 2828.00). I see this similarly for CLJ9.

However, the MovingAveragePrice indicator in your code doesn't seem to adjust for this and it shows a proper moving average (2827.54 for example).

Can someone clarify for me the price resolution in this listener? And if possible, can some explain why the movingaverageprice example works without a tick resolution adjustment?

Re: TradeDataListener onTrade -> double price in ticks?

Posted: Fri Mar 29, 2019 11:14 am
by Andry API support
Hi fansonly,
Any indicator implementing TradeDataListener gets trade price in ticks when onTrade method is invoked.
MovingAveragePrice module gets price in ticks then processes it and transfers it to Bookmap also in ticks.
It is Bookmap which performs transformation from ticks to the correct price.
This tranformation is only done for graphs on main chart, not on the bottom panel.