1
$\begingroup$

I trade on the FOREX market. Currently I am attempting to use the FLANN library (Fast Library for Approximate Nearest Neighbors) to find N similar situations to the current market state. I end up with a list of historic market points that are similar to my query point, and a value associated with each of these points that represents the "distance" away from my query point.

I evaluate my strategy's performance at those points, and (potentially) enter the market using the profit factor (gross gain/ gross loss) as my bet size.

However, since each of these points is a different distance away from my query point I should be weighing the profit/loss at these points differently.

Initially I thought that I would weigh them like this:

Weight = 1/Distance

The problem is that if 1 point is a close distance away from the query point (ex. dist = 10), and all other points are a larger distance away (ex. dist > 20000), then I am basing my bet entry size almost entirely on the 1 close point.

Currently I am attempting to normalize like this:

Weight = 1/log(1+Weight)

This gives me a more usable value, but it seems pretty arbitrary (why log and not ln?)

Does anyone have a better idea?

  • 2
    This had nothing to do with logic, and it doesn't look very much like a soft question to me.2011-09-08
  • 0
    Natural logs and base 10 logs differ by a constant factor, so whichever one you use you'll get the same relative weights.2011-09-08
  • 0
    I've re-tagged. Maybe someone else can do better.2011-09-08
  • 3
    Since the question is related to trading, you might also try in quant.stackexchange.com2011-09-08
  • 0
    How is the distance defined by the way? Euclidean distance?2011-09-08
  • 1
    Sounds like you are doing [scattered data interpolation](http://en.wikipedia.org/wiki/Multivariate_interpolation#Irregular_grid_.28scattered_data.29) using [inverse distance weighting](http://en.wikipedia.org/wiki/Inverse_distance_weighting). You could also look into [moving least squares](http://en.wikipedia.org/wiki/Moving_least_squares), [local regression](http://en.wikipedia.org/wiki/Local_regression), or other [radial basis functions](http://en.wikipedia.org/wiki/Radial_basis_function). Having no actual experience with this sort of thing, I can't comment any further.2011-09-08

1 Answers 1