- #1
Richard_Steele
- 53
- 3
Homework Statement
Hello, I have to solve a problem to calculate all the possible combinations in a dataset. I have candles and each one has 4 values: open, close, high and low. And I have a high number of candles (hundreds).
I want to know all the possible scenarios that it's possible to obtain with 2 consecutive candles.
For example, I have a candle:
B1 can be below or above C1 (in the picture, there is only 1 candle and 2 different situations):
As you can see, it has 4 variables (Max, min, open and close).
What happens when we have 2 candles and we want to compare them
Once we have 2 consecutive candles, there are different scenarios that we can find. Those possible scenarios are the things I want to calculate. How many combinations is it possible to find between 2 consecutive candles?
In this case:
A1 < A2
B1 > B2
C1 > C2
D1 > D2
But if we want to calculate all the possible combinations:
A1 > A2 or A1 < A2 or A1 = A2
A1 can be higher, lower or equal to B2
etc...
So we have different relations between the components:
A1-A2, A1-B2, A1-C2...
B1-A2, B1-B2, B1-C2...
And the relations between the components...
>, < or =So I don't know what kind of formulas or mathematic fields I need to calculate all the possible scenarios. I have thought about combinatorics, but maybe I have use also relational algebra.
But to start with, I would appreciate if someone explains here how to solve this problem.