

策略逻辑
- 核心信号
- 箭头标识:当价格突破关键前高/前低,且伴随动量确认时,生成买入(↑)/卖出(↓)箭头。
- K线过滤:需等待信号K线收盘确认,避免假突破。
- 动态支撑阻力
- 自动绘制最近的关键波段高点(红色)与波段低点(蓝色),作为入场与止损参考位。
- 止损与止盈
- 止损:置于信号K线另一侧(买单调止损于波段低点下方,卖空反之)。
- 止盈:采用1:2风险回报比,或移动止损保护利润。
操作步骤
- 加载图表
- 适用周期:H4或D1(波段交易),货币对/黄金/股指。
- 加载指标后,自动显示箭头与关键水平线。
- 入场规则
- 买入:出现蓝色↑箭头,且价格收盘于前高之上。
- 卖出:出现红色↓箭头,且价格收盘于前低之下。
- 过滤:避开震荡行情(ADX<25时慎用)。
- 离场规则
- 触及止盈目标,或价格反向突破动态支撑/阻力线时平仓。
通过网盘分享的文件:趋势检测2024-price-action-detector-swing-trading-system.rar
链接: https://pan.baidu.com/s/1U7wgYCTB-SV0Z2aYfDBBSA?pwd=g87b 提取码: g87b 复制这段内容后打开百度网盘手机App,操作更方便哦
#property strict
#include <MovingAverages.mqh>
//--- indicator settings
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Black
#property indicator_color2 Green
#property indicator_color3 Red
//--- indicator buffers
double ExtACBuffer[];
double ExtUpBuffer[];
double ExtDnBuffer[];
double ExtMacdBuffer[];
double ExtSignalBuffer[];
//---
#define PERIOD_FAST 5
#define PERIOD_SLOW 34
//--- bars minimum for calculation
#define DATA_LIMIT 38
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void OnInit(void)
{
IndicatorShortName("AC");
//--- 2 additional buffers are used for counting.
IndicatorBuffers(5);
//--- drawing settings
SetIndexStyle(0,DRAW_NONE);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexStyle(2,DRAW_HISTOGRAM);
IndicatorDigits(Digits+2);
SetIndexDrawBegin(0,DATA_LIMIT);
SetIndexDrawBegin(1,DATA_LIMIT);
SetIndexDrawBegin(2,DATA_LIMIT);
//--- all indicator buffers mapping
SetIndexBuffer(0,ExtACBuffer);
SetIndexBuffer(1,ExtUpBuffer);
SetIndexBuffer(2,ExtDnBuffer);
SetIndexBuffer(3,ExtMacdBuffer);
SetIndexBuffer(4,ExtSignalBuffer);
//--- name for DataWindow and indicator subwindow label
SetIndexLabel(1,NULL);
SetIndexLabel(2,NULL);
}
//+------------------------------------------------------------------+
//| Accelerator/Decelerator Oscillator |
//+------------------------------------------------------------------+
int OnCalculate (const int rates_total,
const int prev_calculated,
const datetime& time[],
const double& open[],
const double& high[],
const double& low[],
const double& close[],
const long& tick_volume[],
const long& volume[],
const int& spread[])
{
int i,limit;
double prev=0.0,current;
//--- check for rates total
if(rates_total<=DATA_LIMIT)
return(0);
//--- last counted bar will be recounted
limit=rates_total-prev_calculated;
if(prev_calculated>0)
{
limit++;
prev=ExtMacdBuffer[limit]-ExtSignalBuffer[limit];
}
//--- macd counted in the 1-st additional buffer
for(i=0; i<limit; i++)
ExtMacdBuffer[i]=iMA(NULL,0,PERIOD_FAST,0,MODE_SMA,PRICE_MEDIAN,i)-
iMA(NULL,0,PERIOD_SLOW,0,MODE_SMA,PRICE_MEDIAN,i);
//--- signal line counted in the 2-nd additional buffer
SimpleMAOnBuffer(rates_total,prev_calculated,0,5,ExtMacdBuffer,ExtSignalBuffer);
//--- dispatch values between 2 buffers
bool up=true;
for(i=limit-1; i>=0;)
{
current=ExtMacdBuffer[i]-ExtSignalBuffer[i];
if(current>prev)
up=true;
if(current<prev)
up=false;
if(!up)
{
ExtUpBuffer[i]=0.0;
ExtDnBuffer[i]=current;