Newbie here, it happens that I have 8 months of OHLC price data set at 1 hour timeframe from a particular cryptocurrency (ticket) called ALICE, here's a little sample of those:

dataframe sample

The first column above represent the timestamp of the open price, the next 4 columns represent the OHLC price values (set in USD), and the next to the next column represents the timestamp of the close price.

In this case, the last row in the dataframe above has the following OHLC values:

O = 7.56459843
H = 7.70936971
L = 7.45377539
C = 7.68385709

Now, if we look for the corresponding candle to that row in this chart we get the following candle in the picture down below:

chart sample

And that candle has the following OHLC values:

O = 7.557
H = 7.709
L = 7.444
C = 7.681

So, as can be seen, the OHLC values I have do not exactly match with the OHLC values displayed in the chart.

So, I want to know if I just should round (up or down) every single OHLC value in my dataframe up to having 3 decimal points, before starting the definition and backtest of any trading strategy on this?

Or, should I actually work with the data as were delivered to me?

Keep in mind that, obviously, when trying whatever strategy on live trading, the bot could only set prices up to 3 decimal points, so it would have to round the values anyway

  • $\begingroup$ Rounding the data to three decimal points should not be a particularly big issue as long as you're not planning on scalping. In the end you can always observe how rounded prices changes the P&L of your strategy as opposed to using original prices. If the P&L's are practically the same, then your strategy is "robust" to rounding effects. If the P&L changes drastically, your strategy might do some "quick" trades to obtain a marginal profit after cost. Then rounding effects are an issue. $\endgroup$
    – Pleb
    Commented Feb 13, 2022 at 16:47
  • $\begingroup$ I see, I think my question has been answered, thanks @Pleb $\endgroup$ Commented Feb 13, 2022 at 18:01


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.