Specifically from the series "swingHighSwings".
Its content are all the high swings of all the candles, where there is no swing high the value is 0.
Through a simple loop with a condition I have been able to remove the 0 values.
for(int i = 0; i < 100; i++)
{
if (swingHighSwings[i] != 0)
{
Print ("Swing High Swings Serie Without 0 value " + "["+i+"] "+swingHighSwings[i]);
}
}
...
Swing High Swings Serie Without 0 value [4] 4455,25
Swing High Swings Serie Without 0 value [11] 4454,5
Swing High Swings Serie Without 0 value [14] 4454,5
Swing High Swings Serie Without 0 value [22] 4456,25
Swing High Swings Serie Without 0 value [25] 4455,75
Swing High Swings Serie Without 0 value [28] 4455,5
Swing High Swings Serie Without 0 value [30] 4455,5
Swing High Swings Serie Without 0 value [32] 4455,25
Swing High Swings Serie Without 0 value [34] 4455,5
Swing High Swings Serie Without 0 value [38] 4456,5
...
However I would like to extract only the swings with ascending value, for example from this list I would like to remove the
swings that are lower than the previous one so that their content is this one:
...
Swing High Swings Serie Without 0 value [4] 4455,25
Swing High Swings Serie Without 0 value [22] 4456,25
Swing High Swings Serie Without 0 value [38] 4456,5
...
I don't want to sort them, just filter so that only the values I need appear and then put them in a list.
Could someone give me an idea?
I have tried to put conditions but I don't get the expected result.
Thank you very much for your help
Best regards

Comment