Predicting stock or foreign exchange prices with ML models

I mean direct logarithmization of prices and further utilization of the resulting logarithmic scale: log_close = np.log(close)

In analysis, you can employ two approaches: log returns and a logarithmic scale of prices. The choice depends on your preference and convenience. Each approach has its own limitations.

Most technical analysis indicators are designed to work with positive asset prices rather than negative values or log returns. Therefore, if a sequence of positive and negative numbers (such as log returns) is provided as input to an indicator, there may be some issues. Some indicators may produce incorrect results or may not make sense when working with negative values.

Examples of indicators that may encounter problems:

  • Moving Average (MA): This indicator does not always work appropriately with negative values or oscillations around zero.
  • Relative Strength Index (RSI): RSI is also calculated based on positive and negative price changes, and its interpretation may be challenging when using log returns.
  • Moving Average Convergence Divergence (MACD): This indicator is also constructed based on the difference between two moving averages and may give incorrect results with negative values.
  • Stochastic Oscillator: Similarly, the Stochastic Oscillator may behave unexpectedly when using log returns.

To correctly use indicators with log returns or other data with negative values, modifications to formulas or the search for alternative indicators designed to work with such data may be necessary.

By the way, you can always obtain log returns between any two points in your price series from the logarithmic scale; you just need to subtract the values from each other. This follows from the property of logarithms: log_b(x/y) = log_b(x) - log_b(y)

2 Likes