I am trying to build a script which compares the value of an indicator with previous value of the same indicator but in different time frames and then create a signal based on the comparison.
For example I want to get the value of EMA for 1Day, 4Hours, 1Hour & 30Minutes and then compare these values with the previous values of same time frame.
So for 1D current value is A and 1D-1 value is B
4H current value is C and 4H-1 value is D
1H current value is E and 1H-1 value is F
30M current value is G and 30M-1 value is H
A>B or A<B
C>D or C<D
E>F or E<F
G>H or G<H
Then create a signal based on when all the comparisons align on the same side of trend.