龙听期货论坛's Archiver






 微信: QQ:

龙听 发表于 2020-11-28 07:42

Adjustable weighting percent blended moving average指标公式

**** Hidden Message *****

龙听 发表于 2020-11-28 07:44

You can read the above code first before creating this indicator and see if you can see what it is doing.

There are two moving averages used with slow length of 50 and a fast length of 20, the input called factor is adjustable to assign a weighting to each one.

If factor is set to 0.5 it will add 50% of the slow average to 50% of the fast average and create a blended average of the two periods.

To see maximum values of the slow average set factor to 1, to see the plot constructed entirely of the faster average you can set factor to 0.

You can experiment with values like 0.1 and 0.9 to see the affects of adjustments to the weighting.

Code tips

If you use the name value1 or value2 or value 99 as variables, then you do not need to declare the names of these at the top part.

Value2= 1-factor is a very neat way to get 2 variables to automatically assign 1% of one part and 99% of the other part so when added they will always = 100%

Limit the user error by restricting inputs by making the variables read them. ( The code for value1 does this after reading the factor input )

Code tricks to try

If you look at the slow and fast variables you will see they both use averages (average is this code means simple average).

You can try making the slow one into a weighted average or an exponential average and mixing these up to make your own blended average combination.

在创建此指标之前,您可以先阅读上面的代码,看看是否可以看到它在做什么。

有两种移动平均值,慢速长度为50,快速长度为20,称为因子的输入是可调的,可以为每个加权平均。

如果因子设置为0.5,它将把慢速平均值的50%加到快速平均值的50%,并创建两个周期的混合平均值。

要查看慢平均设置因子的最大值为1,要查看完全由快平均构成的图,可以将因子设置为0。

您可以尝试使用0.1和0.9之类的值来查看权重调整的影响。

代码提示

如果使用名称value1或value2或value 99作为变量,则无需在顶部声明这些名称。

值2 = 1因子是一种非常巧妙的方法,可让2个变量自动分配一部分的1%和另一部分的99%,因此添加它们时,它们总是= 100%

通过使变量读取输入来限制输入,从而限制用户错误。 (value1的代码在读取因子输入后执行此操作)

尝试的代码技巧

如果查看慢速和快速变量,您会发现它们都使用平均值(平均值是该代码表示​​简单的平均值)。

您可以尝试将慢速平均值变成加权平均值或指数平均值,然后将它们混合起来以形成自己的混合平均值组合。

阿土伯 发表于 2020-12-3 16:07

学习

页: [1]
渠道·推广(20年运营值得信赖!)▼:温馨提示:期货论坛稳定、流畅的访问体验有赖于赞助商的广告支持,赞助商业务内容非本站官方业务,期货、证券及外汇投资均有亏损的风险,访问赞助商广告即代表您已了解其中的风险。欢迎意向赞助商联系客服或管理员咨询相关事宜。
                     
❤️2025年通过期货论坛开户享受如下优惠政策:政策一:手续费最低交易所+1分起,政策二:日内炒单及大资金享更高比率返还,政策三:保证金可申请交易所标准+0,政策四:开户即享有论坛Prime会员资格(价值199元/年),开户咨询管理员或右侧客服! 😋欧美期货杂志购买、下载与中文翻译:/thread-10603-1-1.html |TB/MC开户优惠政策:/thread-5986-1-1.html2025年最新交易所手续费表:/thread-7537-1-1.htmlSC2.png2025年最新中文翻译:/thread-160355-1-1.html;
欧美期货程序化期刊中文翻译目录: 【1982/83.01-12期】 【1984.01-12期】 【1985.01-12期】 【1986.01-12期】 【1987.01-12期】 【1988.01-12期】 【1989.01-12期】 【1990.01-12期】 【1991.01-12期】 【1992.01-12期】 【1993.01-12期】 【1994.01-12期】 【1995.01-12期】 【1996.01-12期】 【1997.01-12期】 【1998.01-12期】 【1999.01-12期】 【2000.01-12期】 【2001.01-12期】 【2002.01-12期】 【2003.01-12期】 【2004.01-12期】 【2005.01-12期】 【2006.01-12期】 【2007.01-12期】 【2008.01-12期】 【2009.01-12期】 【2010.01-12期】 【2011.01-12期】 【2012.01-12期】 【2013.01-12期】 【2014.01-12期】正在更新中...... 【2015.01-12期】待补 【2016.01-12期】待补 【2017.01-12期】正在更新中...... 【2018.01-12期】 【2019.01-12期】 【2020.01-12期】 【2021.01-12期】 【2022.01-12期】 【2023.01-12期】 【2024.01-12期】 【2025.01-12期】正在更新中......
欧美杂志精华: 欧美杂志2025年最新中文翻译 量化交易 技术分析 心理研究 套利/统计 波浪理论 江恩理论 道氏理论 策略开发 动量交易 量化建模 神经网络 资金管理 行为金融 图表/形态 蜡烛/K线 Van K. Tharp Wyckoff 名人采访 投机新手 量化问答(Q&A) 外汇货币 交易池(Pool) TS/MC量化 点数(P&F)图 [基金/ETF] [加密货币] [Algo(Q&A)] [人工智能(AI)] 真实世界 期货世界 《Futures Truth》 《Futures&Options》