输入/搜索内容

基于小时级别波动的交易策略

通用策略
创建日期: 2023-09-20 16:50:27
最后修改: 3 年前
复制: 2
点击次数: 1178
1
关注
1830
关注者

概述

该策略针对SPY市场,利用小时级别的价格波动判断市场走势,进行短线的反转交易。属于短线交易策略。

策略原理

  1. 使用5日和13日移动均线交叉判定小时级别价格的反转。

  2. RSI指标需高于50时,移动均线金叉产生买入信号。

  3. 13日均线下穿5日均线,MACD差离值下穿信号线时产生卖出信号。

  4. 设置止损和止盈线,并在到达两倍目标利润时平部分仓。

  5. 可选择空头交易,在本轮交易完成后判断是否进入下一轮空头。

  6. 输入参数可自定义均线、止损止盈比例等。

优势分析

  1. 利用小时级别价格变化捕捉短线交易机会。

  2. 多指标组合验证提高信号准确性。

  3. 设置止损止盈策略有助于风险控制。

  4. 部分止盈可以锁定利润。

  5. 输入参数可自定义,适合短线交易者调整。

风险分析

  1. 小时级别价格波动可能出现假信号带来亏损。

  2. 止损止盈比例设置不当,可能过早停止或持仓时间过长。

  3. 部分品种参数需要优化调整才能达到良好回测效果。

  4. 优化时可能存在过拟合的风险。

  5. 频繁交易增加手续费的交易成本。

优化方向

  1. 测试不同参数组合,寻找最佳参数。

  2. 评估其他指标辅助确认交易信号。

  3. 优化止损止盈策略,平衡风险收益。

  4. 添加趋势过滤器,避免逆势交易。

  5. 适当放宽部分止盈条件,延长获利时间。

  6. 评估适合该策略的其他品种。

总结

该策略试图捕捉SPY的小时级别短线交易机会。通过参数优化、信号过滤等方式可以增强可靠性,将其打造成一个有效的短线交易策略。

策略源码
Pine
//@version=5
strategy(title="SPY 1 Hour Swing Trader", initial_capital=300000, default_qty_type=strategy.percent_of_equity, default_qty_value=15, pyramiding=0, commission_type=strategy.commission.cash_per_order, commission_value=0, overlay=true, calc_on_every_tick=false, process_orders_on_close=true, max_labels_count=500)

//The purpose of this script is to spot 1 hour pivots that indicate ~5 to 6 trading day swings.
//Results indicate that swings are held approximately 5 to 6 trading days on average, over the last 6 years.
//This indicator spots a go long opportunity when the 5 ema crosses the 13 ema on the 1 hour along with the RSI > 50.
//It also spots uses a couple different means to determine when to exit the trade. Sell condition is 
//primarily when the 13 ema crosses the 5 ema and the MACD line crosses below the signal line and
//the smoothed Stoichastic appears oversold (greater than 60). Stop Losses and Take Profits are configurable
//in Inputs along with ability to include short trades plus other MACD and Stoichastic settings.
//If a stop loss is encountered the trade will close. Also once twice the expected move is encountered
//partial profits will taken and stop losses and take profits will be re-established based on most recent close
策略参数
策略参数
Include Short Trades!
Input Stop Loss Percentage (0.02 = 2%)
Input Take Profit Percentage (0.03 = 3%)
Partial Profit Percentage in whole numbers (50 is 50%)
Fast EMA Period
Slow EMA Period
RSI Length
MACD Fast Length
MACD Slow Length
MACD Signal Length
ADX Length
Stochastic Length
Stoicastic Smooth K
Stoicastic Source
评论
全部评论 (0)
暂无数据
暂无数据
  • 1
社区
回测系统
APP 下载
iPhone 下载
© 2015 - ∞ INVENTOR PTE LTD (SG)