Posts: 2,436 since Apr 2013
Thanks Given: 484
Thanks Received: 1,629
|
Stefan,
what do the print statements tell you? I can't help you with these as I a.) don't know where you added them and b.) my suggestion was meant to help you understanding what is going on in your code.
We know that newupTick = newUptick[1] + 1; isn't giving you the result you are looking for as it doesn't track how many of the symbols fulfill the condition (the outcome will always be previous value + 1 regardless of how many symbols fulfill your check).
Your code needs something along the lines of:
1. Reset a counter to 0 at the beginning of the bar (or at the end of the bar, but place it at the end of your code)
2. For every symbol that fulfills your condition you want to check for add +1 during your loop. Don't overwrite the previous checks result with each new check, but add to it.
3. After the loop you can compute the final result by adding the counter result to result on the previous bar.
I'll gladly help you to steer you in the right direction, but I don't plan to "spoon feed" you with the final code - simply because you'll learn much more and benefit by the first approach. If this is not what you have in mind, please let me know and I'll refrain from posting in here, as I have no intention to waste your time.
By the way you can show your appreciation for any post on futures.io by clicking the "Thanks" button next to it.
Regards,
ABCTG
|