TradeDataListener onTrade -> double price in ticks?

Custom indicators, trading strategies, data export and recording and more...
fansonly
Posts: 1
Joined: Thu Mar 28, 2019 11:27 am

TradeDataListener onTrade -> double price in ticks?

Post by fansonly » Thu Mar 28, 2019 11:34 am

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?

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: TradeDataListener onTrade -> double price in ticks?

Post by Andry API support » Fri Mar 29, 2019 11:14 am

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.

Post Reply