fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on May 12, 2015 11:17:26 GMT
Fx, I was also wondering if the good old IIf would give the same results? (IIf(condition, bi, Null)). IIF looks left and right of a picked certain point of array to compare with.
|
|
|
Post by bobpit on May 12, 2015 11:32:36 GMT
Thank you for the code.
So please tell me about my initial thought. I wanted to use something like : x = ValueWhen(ar == current_value(ar), barindex(), 1);
But I could not differentiate the PAST ar values from the CURRENT ar value. Is there a way to do this?
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on May 12, 2015 11:47:41 GMT
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on May 12, 2015 12:36:41 GMT
Bob in last post at yahoo you wrote this one Here you in this thread there are multiple other different infos. So now you wanna find groups of values that are equal one after another most recent barindex. So basically it's this pastie.org/private/qcun39kgskoqfpxeoh2mbaSo you don't need loop, .. Next time before posting please find a better way to precisely describe what you are actually looking for! Otherwise people are wasting time trying to help! Thank you!
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on May 12, 2015 12:45:54 GMT
If the set sequence is 3 then it is 4 values being almost equal in a row, if it is set to 6 then it is 7 values being almost equal in a row and so on.
|
|
|
Post by bobpit on May 12, 2015 13:08:12 GMT
fxshrat
I am not mixing this and the yahoo thread. If you find them different, then they are intended to be so.
When gaborkuti asked me here for more details, I did give them, here.
Let me check the codes you gave me now.
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on May 12, 2015 13:20:37 GMT
Alternativally to percent you may use ulps setting (but i.e. if set to 5 then it means 0.00005% equality sensitivity). And this time "sequence" actually means number of equal values in a row. pastie.org/private/qfq918om2hhxgvbw5govq
|
|
|
Post by bobpit on May 12, 2015 14:02:45 GMT
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on May 12, 2015 18:52:34 GMT
|
|
derzi
Rookie
Posts: 18
Received Likes: 1
|
Post by derzi on May 12, 2015 19:16:21 GMT
Is there still any doubts or everything is going smooth?
As seen on:
The array_1 is == 11113333222333331111111111222333333; // by your definition
Occurrences = BarsSince(Ref(Array_1, -1) != Array_1) + 1; // Will be one when a new segment starts, will be its maximum before the segment ends.
Previous = valuewhen(Occurrences == 1, Ref(Occurrences, -1), 1);
|
|