uniVocity / univocity-trader

open-source trading framework for java, supports backtesting and live trading with exchanges
577 stars 140 forks source link

OrderExecutionLine strips away original data types #40

Closed wwadge closed 4 years ago

wwadge commented 4 years ago

OrderExecutionLine should maintain the original data types because it currently assumes a text-based output. For the output to Google Sheets, it helps to transmit the actual types so that the sheet values are formatted correctly.

I've done the required modifications( here: https://github.com/wwadge/univocity-trader-1/tree/feature/fix-google-logging-types) but this works by exposing a getFormattedXXX in to keep the existing String-based formatting.

Is there a way to to tell CSV parser to tell it that field X should call getFormattedX() instead of getting the field value?

jbax commented 4 years ago

Move the @Parsed annotation to the getFornattedX() methods and set the original column name in the annotation.

On Tue., 21 Apr. 2020, 6:00 am Wallace Wadge, notifications@github.com wrote:

OrderExecutionLine should maintain the original data types because it currently assumes a text-based output. For the output to Google Sheets, it helps to transmit the actual types so that the sheet values are formatted correctly.

I've done the required modifications( here: https://github.com/wwadge/univocity-trader-1/tree/feature/fix-google-logging-types) but this works by exposing a getFormattedXXX in to keep the existing String-based formatting.

Is there a way to to tell CSV parser to tell it that field X should call getFormattedX() instead of getting the field value?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/uniVocity/univocity-trader/issues/40, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWFQPW7KYLDSJKXVS2ODBDRNSWIBANCNFSM4MMX43PQ .

wwadge commented 4 years ago

Fixed here: https://github.com/uniVocity/univocity-trader/pull/41

jbax commented 4 years ago

PR merged, thanks a lot for your contribution once again.