You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Submitted by: Jonathan Owen
Assigned to: Nobody R-Forge link
I'm not sure is this is a bug or shows a need for additional input data checks/documentation. When running the attached script (provided by Samo Pahor), which uses daily symbol data with a Date class index and a exit rule delay=1, there is both an order and transaction dated on 2/11, but the transaction uses the price from 2/10.
Signals are generated on 2/9, so using allowMagicalThinking one would expect to see an enter order and transaction on 2/9 and, due to the delay=1, an exit order and transaction on 2/10. It appears that the price logic is working as expected, but the order date (and transaction date) is not. This may have something to do with how the delay is handled in addOrder (lines 386-7) in orders.R--instead of is.timeBased, should the validation be that timestamp is POSIXct? The discrepancy is gone if the index on the symbol data is changed to be POSIXct (see line 37 of attached script).
I think it would make sense to add some logic to applyStrategy that validates that the index class for the symbol and mktdata is POSIXct, and if not either throw a warning and/or convert. Any thoughts?
The text was updated successfully, but these errors were encountered:
Submitted by: Jonathan Owen
Assigned to: Nobody
R-Forge link
I'm not sure is this is a bug or shows a need for additional input data checks/documentation. When running the attached script (provided by Samo Pahor), which uses daily symbol data with a Date class index and a exit rule delay=1, there is both an order and transaction dated on 2/11, but the transaction uses the price from 2/10.
Signals are generated on 2/9, so using allowMagicalThinking one would expect to see an enter order and transaction on 2/9 and, due to the delay=1, an exit order and transaction on 2/10. It appears that the price logic is working as expected, but the order date (and transaction date) is not. This may have something to do with how the delay is handled in addOrder (lines 386-7) in orders.R--instead of is.timeBased, should the validation be that timestamp is POSIXct? The discrepancy is gone if the index on the symbol data is changed to be POSIXct (see line 37 of attached script).
I think it would make sense to add some logic to applyStrategy that validates that the index class for the symbol and mktdata is POSIXct, and if not either throw a warning and/or convert. Any thoughts?
The text was updated successfully, but these errors were encountered: