Searching past information of an indicator
-
Hi, I have problem using Loop. I can't figure it out...
Need Help PLEASE!
I have 2 MACDs. First one is four times MACD (48,104,36) and the second one is half of the original MACD (6,13,4).
What I need is to count the number of downs in smaller MACD while the bigger MACD is above zero LVL, as shown in the picture.
To be exact:
1. Let's say in the live market we are in the position of No.6 as shown in the picture.
2. The search in the past must start when the bigger MACD is above zero LVL.
3. I want to count the number of downs in the smaller MACD and then store it in a variable.I know I should use Loop Block but can't figure it out. Any help is much appreciated

-
You can do it like this: https://fxdreema.com/shared/UXr0s94Xb
-
Tnx @jstap .
How does it search the past?
You didnāt use Loop Block⦠-
That will just tell you the current <>0, to look in the past you need to change the starting candle ID.
-
I want to search in the past, I donāt know the starting Candle ID of the past!
The search in the past starts When the bigger MACD is above zero LVL
-
Just 1 < or> period in the past?
-
Period, and the period is when bigger MACD is above zero LVL. (Say MACD A)
-
For 1 period you have the ID to start from because it is the candle before MACD went from <> or ><, to get this save this ID into a new variable, but you will have to set up a separate tree that adds 1 onto that variable every bar.