Hello Folks,
i want to create a script, that can look/iterate over datasets from Stocks/Charts and count/identifies Waveform-Patterns in them. I wanted to base that on Elliott Wave Rules.
So there are some basic rules like:
"
Wave 2 never retraces more than 100% of wave 1.
Wave 3 cannot be the shortest of the three impulse waves, namely waves 1, 3 and 5.
Wave 4 does not overlap with the price territory of wave 1, except in the rare case of a diagonal triangle formation.
This is the most basic rule,underlying most other rules. Why is that? Because Elliott Wave´s have a fractal nature, that means, that WITHIN lets say, the wave that would count as wave number 1, one can find the same 5 step wave, just, in this case, on a lower timeframe/candlesize.
That means, it should be possible to set up basic rules, and apply them onto the smallest datapoints that can be found in the dataset, and depending on that outcome, also find the same pattern structure in a higher timeframe.
What do you think, does this thoughts make any sense?
And most importantly: how would i set up this basic rules in a way, in which the script iterates over the whole dataset and places "setpoints" as identifiers or as, so to speak, "counting" of the waves?
I was thinking of a very simple loop that just goes over every datapoint and checks if i+1 is greater or smaller than i, the previous one. If it is smaller, then the first rule would apply which is: wave 2 never exceeds wave one (which means, the lowest point of wave 2 cannot be lower than the start of the wavecounting which would be position 0).
IF this condition is met, and the datapoints would go up again, then the second rule would apply which is: wave 3 cannot be the shortest wave of the upgoing (the impulse) waves.
IF this condition is also met, then the third rule would apply, which is, that the lowest (of the next ieteratet) datapoint of wave 4, that means the minima in that area, cannot be lower or equal than the maxima of wave 1.
And so on.... this would mean, i would check for lokal minima and maxima, according to the "setpoints" that the script set in the data before (within the process of checking every datapoint for its values, related to the previous values if beeing lower or higher).
I really dont know, what could be a more simple or elegant solution, because i am a totall beginner.
I also thought of applying analysis and taking derivaties and so on to find minima and maxima, but this would always need a certain region wihin the dataset, because it is always just a "lokal" minima or lokal maxima.
Also i thought of how to really apply the fractal structure? just by using different charts with different timeframes? or can i just "cut out" more and more datapoints to kind of "zoom out" the perspective?
Furthermore i would also think, that some sort of "smoothing" would be nice, because it always happens, that the above mentioned conditions are not EXACTLY met, but more, that some irregularities arise, but still the overall pattern is visible and according to the rules.
How do i start?
And please, dont tell me just to start by doing "how do i learn python in 2 hours" tutorials on youtube. I was going through the whole "head first python" book and still dont know how to start.
I somehow still think it could be reduced to some simple loops that relate to each another.
I appreaciate your suggestions and give thanks,
Benjamin
What I have tried:
I tried the very simple loop, that by the way does not work:
for i in dataset:
if i < i+1 and:
print ('yes'),
if i > i+1:
print ('no')