Based on my screenshot it's obvious something is wrong with these two otherwise awesome indicators.
Could someone guide me in the right direction to obtain a good version.
I downloaded this one from the first post on this thread.
Thanks in advance.
I haven't looked at your indicator, but I'm sure that the problem is the moment when the volume for the swing is calculated in the PriceActionSwing indicator. To make the PAS indicator CPU efficient the swing values are only calculated if a new swing is detected or a swing is updated, otherwise no calculations are performed.
To resolve your issue you have to keep in mind that when you get a new bar without a new swing or updated swing you don't know whether the bar belongs to the old or to a new swing, that means you don't know whether the volume belongs to the old swing or to the new one. If you look at your picture will the last bar at 22:00 and close at 1397.00 belong to the next swing high or will this bar or one of the next make a new updated swing low?
For historical bars the answer is easy you just paint your study backwards with a for loop to the point where the last swing calculation was performed every time a new swing is found or updated. However in real time you don't know the answer. You can either put the volume calculation from within the "CalcDnSwing(…)" and "CalcUpSwing(…)" in the OnBarUpdate function with the risk of repainting if the bar belongs to the opposite swing or you leave out the real time values whenever there is no new swing or no updated swing.
The following 3 users say Thank You to dorschden for this post:
This is an excellent question Dee50 as Dorschden says this is the one setting that should be adjusted "here and there". I have also searched the thread for an answer but have not found any. I wonder if Dorschden or an experienced user could address this question and provide guidelines as to how this setting should be adjusted to optimize the indicator? I use it on 4 tick, 3 & 5 min 6E & NQ charts.
Last edited by Royal Flush; May 20th, 2012 at 12:36 PM.
The following 4 users say Thank You to Royal Flush for this post: