# Chuvashov 的叉子机械交易系统

11 四月 2016, 11:18
0
1 087

“为了产生趋势线，我们对最新的值感兴趣”——
Thomas DeMark

### 简介

Stanislav Chuvashov 提出了一种利用“Chuvashov 的叉子”形态的外汇交易技术。 在该技术中，市场分析的方法跟 DeMark 为最近的时间间隔绘制趋势线的方法有一些共同之处。

### 1. 绘制“Chuvashov 的叉子”形态线的方法

CF 形态的主要要求是叉子的侧线必须跟趋势方向一致。 穿越侧线会产生信号：在上涨趋势卖出以及在下跌趋势买入。

6 个柱（小时）以后，形成了开口更宽的新 CF 形态（图 3），确认了之前所提示的趋势反转或走平。

### 2. 在 MQL4 中“Chuvashov 的叉子”建议代码的一些特点

// ===================================================================
// Loop for searching for the last three consecutive fractals (BUY case)
// lying along the DOWNtrend for the Chuvashov's Fork construction
// ==================================================================+
for (i=M;i<=N;i++)
{//loop
if(High[i]>High[i+1] && High[i]>High[i+2] && High[i]>High[i-1] && High[i]>High[i-2])
{
VFN++; // counter of the found fractal.
// -------------------------------------------------------------+
if(VFN==1)               // if the 1st fractal is found, store the following values: Max[i], candlestick no.[i], time[i]:
{ // f1
Vnf1=i;                // store the Max bar number of the found fractal.
VMF1=High[i];          // store the Max value of the 1st found fractal.
tim1=iTime(NULL,0,i);  // store the time of the 2nd reference point.
} //-f1

// --------------------------------------------------------------+
if(VFN==2)                // if the 2nd fractal is found, store the following values: Max[i], candlestick no.[i], time[i]:
{ VMF2=High[i];           // store the Max value of the 2nd found fractal.
if(VMF2>VMF1)           // if the Max value of the 2nd fractal is higher than that of the 1st fractal (i.e. directed downwards),
{ Vnf2=i;               // store the Max bar number of the found fractal.
tim2=iTime(NULL,0,i); // store the time of the 2nd reference point.
}
}
// --------------------------------------------------------------+
if(VFN==3)                  // if the 3rd fractal is found, store the following values: Max[i], candlestick no.[i], time[i]:
{
VMF3=High[i];             // store the Max value of the 3rd found fractal.
if(VMF3>VMF2)             // if the Max value of the 3rd fractal is higher than that of the 2nd fractal,
{Vnf3=i;                 // store the Max bar number of the 3rd fractal.
tim3=iTime(NULL,0,i);   // store the time of the 3rd reference point.
}
}
// ------------------------------------------------------------------+
if(VFN==3) break; // all three fractals are found, exit the loop.
// ------------------------------------------------------------------+
}
}//-loop

// ------------------------------------------------------------------+
if(VMF3>VMF2 && VMF2>VMF1)
{
// Let us define whether the lateral (2) trend line is HIGHER than the projection of the MAIN(1)
// trend line? For this purpose, we calculate the price value of the projection of the MAIN(1) trend line
// on the vertical of the Max value of the 1st fractal:
V_down1=((VMF3-VMF2)/(Vnf3-Vnf2));      // speeds of falling of the MAIN(1) trend line over 1 bar.
PricePrL1_1f=VMF2-(Vnf2-Vnf1)*V_down1;  // price of the projection of the MAIN(1) trend line on the vertical of the 1st fractal.
// now compare the price value of the 1st fractal with the price of the projection of the MAIN(1) trend line
// on the vertical of the Max value of the 1st fractal, and if the Max price of the 1st fractal is higher than the price of the projection of the
// MAIN(1) trend line on the same fractal, then the Chuvashov's Fork construction requirements are met.
if(VMF1>PricePrL1_1f) // if the pattern for opening a Buy position has emerged
{
V_down2=((VMF2-VMF1)/(Vnf2-Vnf1));  // speeds of falling of the lateral trend line over 1 bar.
PricePrL2_1b=VMF1-Vnf1*V_down2;     // price of the projection of the Lateral(2) trend line on the current 1st BAR.
PricePrL1_1b=VMF2-Vnf1*V_down1;     // price of the projection of the MAIN(1) trend line on the current 1st BAR
// keep in mind that the pattern for opening a Buy position has emerged
patternBuy = true; patternSell = false;   // pattern for opening a Buy position has emerged
// draw marks and lines of the "Chuvashov's Fork" pattern
DelLine(); CreateLine(); CreateArrow();   // draw marks and lines having deleted the preceding ones
}
}
// ==================================================================+

// ==================================================================+
// ==================================================================+
if(OrdersTotal()<1) // we place one (or 2..3..etc.) orders
{  //open a position
// ------------------------------------------------------------------+

// 1st additional condition - price range over the last 25 bars is at least 50 points.
if((High[iHighest(Symbol(),Period(),MODE_HIGH,25,0)]-Low[iLowest(Symbol(),Period(),MODE_LOW,25,0)])>=50*Point)
{// price range
// 2nd additional condition e.g. if the price is lower than 89 pip below the level of Ma144 (MA of 12 squared)
if(Bid<Ma144_1-89*Point &&       // price is lower than Fibo89s level
(Ma144_1-Ma144_48)<0)         // Ma144 slope is negative

if((High[1]>PricePrL2_1b ||                          // Max of the candlestick is higher than the lateral projection of the 1st Bar
Close[1]>PricePrL2_1b ||                         // any candlestick closed above the projection of the 1st Bar
(Open[1]<Close[1] && Close[1]>PricePrL2_1b) ||   // white candlestick crossed the projection of the 1st Bar
Bid>PricePrL2_1b) && Bid<PricePrL2_1b+3*Point)   // not higher than 3 pip of the price of the projection of the 1st Bar
{

// Calculate Stop Loss as the Min price value over the interval from the "0" bar to the bar of the 2nd fractal.
SL_B=(Bid-Low[iLowest(Symbol(),Period(),MODE_LOW,Vnf2,0)])/Point;
if(SL_B<StopLevel) SL_B=Bid-(StopLevel+2)*Point; // if SL_B is less than StopLevel
TP_B=120;
Print("  OP_BUY Chuvashov's Fork","  VMF1 = ",VMF1," < ",PricePrH1_1f);
return;

//+=======================================================================+
//                   proceed to TRACING opened positions            +
//+=======================================================================+
for (i=OrdersTotal()-1; i>=0; i--)        // loop for selection of BUY orders
{//loop for selection of positions Buy
{Print("Order selection error = ", GetLastError()); }

//+=======================================================================+
//|  Conditions for closing BUY positions                                     +
//+=======================================================================+
if(patternSell==true)         //  a pattern for opening a Sell position emerged
{
Print(" closing the BUY position as the opposite pattern has emerged");
Close_B_Ch();         // close the position SELL
return;
}
//+=======================================================================+

// ---- 1st stage ------------------------------------------ 1st stage ---+
// The first modification stage: when the price reaches the profit
// equal to the Stop Loss value, we move SL_B by 1/2 value of Stop Loss
// i.e. closer to the position opening level. (+StopLevel)
if((Bid-OrderOpenPrice())>SL_B*Point        // if the difference between the price and the opening value is >SL_B
&& OrderStopLoss()<OrderOpenPrice())    // and if Stop Loss is less than the position opening level.
{// modif-1
OrderModify(OrderTicket(),                // order #.
OrderOpenPrice(),                         // opening price.
OrderStopLoss()+(SL_B/2)*Point,           // New value of Stop Loss.
OrderTakeProfit()+1*Point,                // New value of Take Profit.
0,                                        // Deferred order expiration time.
Red);                                     // Color of modification marks (dashes).
return;
}//-modif-1
// --- end of 1st stage -----------------------------------------------------+
// ---- 2nd stage ------------------------------------------ 2nd stage ---+
// The second modification stage: when the price repeatedly reaches profit
// equal to the Stop Loss value, we move SL_B to the 'zero-loss'
// level, i.e. to the position opening level (+StopLevel).
if((Bid-OrderOpenPrice())>SL_B*Point        // if the difference between the price and the position opening value is >SL_B
&& OrderStopLoss()<OrderOpenPrice())    // and if Stop Loss is less than the position opening level
{// modif-1
OrderModify(OrderTicket(),                // order #.
OrderOpenPrice(),                         // opening price.
OrderStopLoss()+(SL_B+StopLevel)*Point,   // New value of Stop Loss.
OrderTakeProfit()+1*Point,                // New value of Take Profit.
0,                                        // Deferred order expiration time.
Magenta);                                 // Color of modification marks (dashes).
return;
}//-modif-1
// --- end of 2nd stage -----------------------------------------------------+

// ---- 3rd stage --------------------------------------- 3rd stage ------+
//  When the price reaches the profit of more than 1.5 times the Stop Loss value
//  draw SL_B to the nearest lower fractal that should be higher than the preceding Stop Loss
if((Bid-OrderOpenPrice())>=(SL_B+SL_B/2)*Point  // if the difference between the price and the opening value is >SL_B+SL_B/2
&& OrderStopLoss()>=OrderOpenPrice())       // and if Stop Loss is already at the 'zero-loss' level.
{// modif2
// move SL_B to the level of the nearest lower fractal,
// for this purpose, find the nearest lower fractal:
for (k=3;k<=24;k++)
{//loop-M
if(Low[k]<Low[k+1] && Low[k]<Low[k+2] && Low[k]<Low[k-1] && Low[k]<Low[k-2])
{ // fractal Low
VlFl_L=Low[k];             // Min value of the nearest fractal
if(VlFl_L>OrderStopLoss())  // fractal that should be higher than the preceding Stop Loss
{// fractal higher than SL_B
tim1_L=iTime(NULL,0,k);    // Time of this fractal
///  string Time1_L=TimeToStr(tim1_L,TIME_DATE|TIME_MINUTES);
///  Print("  Modif-2 ====== ","  Fractal = ","Frak"+k,VlFl_L,"  time = ",Time1_L);
// shift Stop Loss to the formed lower fractal Min value level
OrderModify(OrderTicket(),            // order #
OrderOpenPrice(),                     // opening price
VlFl_L+2*Point,                       // New value of Stop Loss. // in zero-loss
OrderTakeProfit()+1*Point,            // New value of Take Profit.
0,                                    // Deferred order expiration time.
Aqua);                                // Color of Stop Loss and/or Take Profit modification arrows
if(VlFl_L!=0)  break;                 // if the fractal is found, exit the loop
return;
// --- end of 3rd stage ------------------------------------------------------+

### 总结

Stanislav Chuvashov 的建议可以参阅其书籍 17 free lessons（俄语）。

• Fork_Ch_ExpertH1_v1.mq4 - “Chuvashov 的叉子”机械交易系统
• Fork_Ch_MTS_v2.mq4 - “Chuvashov 的叉子”机械交易系统，程序文本中没有注释。

Fork_Ch_MTS_v2.mq4 (23.6 KB)