Find the most recent Swing Low from the Entry

Great and thanks for your clarification. I also, as I mentioned before, appreciate everybody's support.

I have also no doubt that there are many experienced traders as well as some superb programmers here.
Please let this discussion aside, although I don't yet understand why the work "misunderstand" is interpreting as downplay, impoliteness or lecturing. I apologize again if this result in such interpretation.

Would you please, be kind and let me know how this definition of Swing Low has a future leak if the entry would be the next day open?

Thanks.

That definition of a Swing Low confirmation should be fine and has no future leak. The only problem is that you're missing commas in the Ref() commands so the code wouldn't actually run as written.

Now you just need to retrieve the Low price from the actual Swing Low bar, i.e. two bars before the confirmation, so that you can use it as your stop loss price.

2 Likes

@Oscar read carefully my answer to you , mainly the part BUT IF YOU....

Best whish with your trades

My way is

X = 10
SwingLow = L < Ref(LLV(L,X),-1);

in X you can type in the number of days which should be considered.

This may help you with what you are trying to do.

function SwingLow(array, bars) { return IIf(array <= Ref(LLV(array, bars), -1) AND array <= Ref(LLV(array, bars), bars), True, False); }

SLow = SwingLow(L, 2); // Creates an array of swing low points based on 2 bars

StopValue = ValueWhen(SLow, L, 1) // Returns the low at the most recent swing low
2 Likes