arvinddodke的多指标

//@version=5
strategy("Multi-Indicator Strategy By Arvind Dodke [EMA+MACD+RSI+ADX]", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)

// === INPUTS ===
emaLength = input.int(100, title="EMA Length")
rsiLength = input.int(14, title="RSI Length")
macdFast = input.int(12, title="MACD Fast Length")
macdSlow = input.int(26, title="MACD Slow Length")
macdSignal = input.int(9, title="MACD Signal Length")
adxLength = input.int(14, title="ADX Length")
adxThreshold = input.float(20.0, title="ADX Threshold")
tpPerc = input.float(3.0, title="Take Profit (%)") / 100
slPerc = input.float(1.5, title="Stop Loss (%)") / 100
useTrailing = input.bool(true, title="Use Trailing Stop?")
trailPerc = input.float(1.8, title="Trailing Stop (%)") / 100

// === INDICATORS ===
ema = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)
[macdLine, signalLine, _] = ta.macd(close, macdFast, macdSlow, macdSignal)
[plusDI, minusDI, adxValue] = ta.dmi(adxLength, 14)

// === CONDITIONS ===
// Buy Conditions
bullTrend = close > ema
macdBull = ta.crossover(macdLine, signalLine)
rsiBull = rsi > 50
adxStrong = adxValue > adxThreshold
longCondition = bullTrend and macdBull and rsiBull and adxStrong

// Sell Conditions
bearTrend = close < ema
macdBear = ta.crossunder(macdLine, signalLine)
rsiBear = rsi < 50
shortCondition = bearTrend and macdBear and rsiBear and adxStrong

// === STRATEGY EXECUTION ===
if (longCondition)
    strategy.entry("Long", strategy.long)
    if useTrailing
        strategy.exit("Exit Long Trail", from_entry="Long", trail_points=trailPerc * close / syminfo.mintick, trail_offset=trailPerc * close / syminfo.mintick)
    else
        strategy.exit("Exit Long TP/SL", from_entry="Long", profit=tpPerc * close / syminfo.mintick, loss=slPerc * close / syminfo.mintick)

if (shortCondition)
    strategy.entry("Short", strategy.short)
    if useTrailing
        strategy.exit("Exit Short Trail", from_entry="Short", trail_points=trailPerc * close / syminfo.mintick, trail_offset=trailPerc * close / syminfo.mintick)
    else
        strategy.exit("Exit Short TP/SL", from_entry="Short", profit=tpPerc * close / syminfo.mintick, loss=slPerc * close / syminfo.mintick)

// === PLOT ===
plot(ema, color=color.orange, title="100 EMA")

【动态模态分解(DMD)】处理任意数据集进行模态分析研究(Matlab代码实现)内容概要:本文围绕动态模态分解(DMD)技术展开,介绍其在处理任意数据集进行模态分析中的应用,并提供基于Matlab的代码实现方案。文中详细阐述了DMD的基本原理及其在领域科研问题中的实际应用价值,如航空航天、能源系统、信号处理、无人机控制等,展示了该方法在提取复杂系统动态特征方面的有效性。同时,文档列举了大量相关研究案例和技术实现路径,涵盖机器学习、优化算法、图像处理、路径规划等个方向,突出DMD作为一种数据驱动分析工具的广泛适用性。; 适合人群:具备一定Matlab编程基础,从事科研工作或工程应用的研究生、科研人员及工程师,尤其适用于从事系统建模、数据分析、信号处理等相关领域的技术人员。; 使用场景及目标:①利用DMD方法对非线性动态系统进行降维与模态提取;②结合具体科研问题(如结构健康监测、飞行器控制、能源系统分析)实现数据驱动建模与分析;③通过提供的Matlab代码快速复现算法并应用于实际数据集。; 阅读建议:建议读者结合文中提供的网盘资源下载完整代码和案例资料,按照目录顺序逐步学习,重点理解DMD算法的核心思想与实现细节,并尝试将其迁移至自身研究领域以提升科研效率。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值