Why the huge AMA difference between PRT and TW?
Forums › ProRealTime English forum › ProBuilder support › Why the huge AMA difference between PRT and TW?
- This topic has 7 replies, 3 voices, and was last updated 4 years ago by Vonasi.
-
-
05/06/2020 at 9:49 AM #130185
Using 1440 period same fast and slow setting AMA (adaptive moving average) I get completely different results on PRT and TW. Maybe thats because on PRT i use Cash Contract and on TW its Emini futures? Tried on futures contract on PRT same thing completely different results. Any thoughts? Thanks in advance.
Regards,
Bel.
05/06/2020 at 10:00 AM #130188There can only be two reasons.
- Different data – which you will have as they are not using the same data feeds.
- Different calculation methods. You would need to provide the code for the TW AMA to compare with the PRT AMA.
1 user thanked author for this post.
05/06/2020 at 10:11 AM #13019005/06/2020 at 10:17 AM #13019405/06/2020 at 10:23 AM #130196/
1234567891011121314151617181920212223242526/@version=3// Copyright (c) 2018-present, Alex Orekhov (everget)// Adaptive Moving Average script may be freely distributed under the MIT license.study("Adaptive Moving Average", shorttitle="AMA", overlay=true)length = input(title="Length", type=integer, defval=14)fastLength = input(title="Fast EMA Length", type=integer, defval=2)slowLength = input(title="Slow EMA Length", type=integer, defval=30)highlightMovements = input(title="Highlight Movements ?", type=bool, defval=true)src = input(title="Source", type=source, defval=close)fastAlpha = 2 / (fastLength + 1)slowAlpha = 2 / (slowLength + 1)hh = highest(length + 1)ll = lowest(length + 1)mltp = hh - ll != 0 ? abs(2 * src - ll - hh) / (hh - ll) : 0ssc = mltp * (fastAlpha - slowAlpha) + slowAlphaama = 0.0ama := nz(ama[1]) + pow(ssc, 2) * (src - nz(ama[1]))amaColor = highlightMovements ? (ama > ama[1] ? green : red) : #6d1e7fplot(ama, title="AMA", linewidth=2, color=amaColor, transp=0)05/06/2020 at 10:26 AM #130197Be so kind to always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read. Thank you 🙂
1 user thanked author for this post.
05/06/2020 at 10:29 AM #13019905/06/2020 at 10:59 AM #130203This is the code that returns exactly the same values as the platforms built in AMA. Hopefully Nicolas can tell if their are any differences.
1234567891011121314151617Period = 9FastPeriod = 2SlowPeriod = 30Fastest = 2 / (FastPeriod + 1)Slowest = 2 / (SlowPeriod + 1)if barindex < Period+1 thenKama=closeelseNum = abs(close-close[Period])Den = summation[Period](abs(close-close[1]))ER = Num / DenAlpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1])endifreturn kama1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on