I don't really understand what you mean by that. As in what defines a swing? I normally just look at a chart and when I see this (as in the picture), that's how I perceive swings. I've tried using different MAs, crosses etc, but I still cannot really find something that can give me a sure way of telling the PC what a swing is. Sometimes a swing is a couple of candles, like the T1 and T2 arcs, other times it's almost 10 with weird dips and stuff in between, like the B1 - B3 arcs. When using MAs as a guide, it'll pick up the dip in the middle as a swing too
I don't really understand what you mean by that. As in what defines a swing? I normally just look at a chart and when I see this (as in the picture), that's how I perceive swings. I've tried using different MAs, crosses etc, but I still cannot really find something that can give me a sure way of telling the PC what a swing is. Sometimes a swing is a couple of candles, like the T1 and T2 arcs, other times it's almost 10 with weird dips and stuff in between, like the B1 - B3 arcs. When using MAs as a guide, it'll pick up the dip in the middle as a swing too
Exactly.
![]() | In your B1, I see two swing highs and two swing lows. Whereas you only indicate one low. How do you define your swings to differentiate from the four I see? |
Exactly.
In your B1, I see two swing highs and two swing lows. Whereas you only indicate one low. How do you define your swings to differentiate from the four I see? |
I think I have found a way to identify it better now. I never knew that you can shift an indicator to the left. While I was playing around I saw that the 12 SMA was more or less making the curve that I wanted, i.e representing the yellow arcs more. So I then shifted the indicator to the left by 3 (Shift = -3) and it gave me this
Now I'm probably not going to use the -3 shift, but it makes it easier to spot what I want for now. I'm going to give it a better look at. Hopefully this is what I needed to better identify what I'm looking for. I also recently stumbled upon the iHighest/iLowest functions while trying to learn from someone else's code (LastManStanding of Jay Davis). Going to give those functions a try too. If you have any better suggestions/sources please share. I'll definitely read it up!
Try using ZigZag if you just want to count the preceding "swings"
Oh my soul I feel so dumb! Thanks a million! It was exactly what I was looking for!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone
Is there anyone that can direct me pages where I can read up on how to code to identify swings? It's easy for me to identify them, but the method I'm using visually is not consistent enough to translate it to the PC. I have broken my brain these past couple of days trying to figure something out and started to search online for methods, but I only get ready made stuff. I've tried reverse engineering a couple to understand the reasoning behind how it works, but it is a real struggle (still a newbie at coding). Any help will be appreciated, whether through explaining or directing me to places where I can learn. I'll continue searching in the meantime.
Thanks