Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

9
http://articles.mql4.com/1032 June 10, 2013 Mechanical Trading System "Chuvashov's Fork" [ ru ] "We are interested in the latest values in order to produce trend lines" Thomas DeMark Introduction Stanislav Chuvashov proposed a Forex trading technique using the "Chuvashov's Fork" pattern. In this technique, the approach to market analysis has something in common with DeMark's approach to drawing trend lines for the last closest time interval. 1. A Method for Drawing "Chuvashov's Fork" Pattern Lines The fractals indicator is used to draw the "Chuvashov's Fork" pattern. The main trend line is drawn passing through the two neighboring fractals 1 and 2 as shown in the price chart (see Figure below). The main uptrend line is drawn based on lower fractals; the main downtrend line is drawn based on upper fractals. Figure 1. Drawing the "Chuvashov's Fork" pattern We should wait until a similar fractal 3 gets formed following the main trend line breakout in the opposite direction to the trend. A lateral line drawn through fractals 2 and 3 together with the main trend line forms the "Chuvashov's Fork" (CF) pattern. This is the name given by the author Stanislav Chuvashov . The main requirement to the CF pattern is that the lateral line of the fork must be in the direction of the trend. Lateral lines breaking through give rise to signals: to sell in the uptrend and to buy in the downtrend. Below is the sequence of formation of the "Chuvashov's Fork" pattern as exemplified on EURUSD H1 over 4 consecutive days. Figure 2. "Chuvashov's Fork" pattern formation

description

Fork Ru

Transcript of Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

Page 1: Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

http://articles.mql4.com/1032 June 10, 2013

Mechanical Trading System "Chuvashov's Fork" [ ru ]

"We are interested in the latest values in order to produce trend lines" Thomas DeMark

Introduction

Stanislav Chuvashov proposed a Forex trading technique using the "Chuvashov's Fork" pattern.In this technique, the approach to market analysis has something in common with DeMark'sapproach to drawing trend lines for the last closest t ime interval.

1. A Method for Drawing "Chuvashov's Fork" Pattern Lines

The fractals indicator is used to draw the "Chuvashov's Fork" pattern. The main t rend line isdrawn passing through the two neighboring fractals 1 and 2 as shown in the price chart (seeFigure below). The main uptrend line is drawn based on lower f ractals; the main downtrend lineis drawn based on upper f ractals.

Figure 1. Drawing the "Chuvashov's Fork" pattern

We should wait unt il a similar f ractal 3 gets formed following the main t rend line breakout in theopposite direct ion to the trend. A lateral line drawn through fractals 2 and 3 together with themain t rend line forms the "Chuvashov's Fork" (CF) pattern. This is the name given by the authorStanislav Chuvashov.

The main requirement to the CF pattern is that the lateral line of the fork must be in thedirect ion of the t rend. Lateral lines breaking through give rise to signals: to sell in the uptrendand to buy in the downtrend.

Below is the sequence of format ion of the "Chuvashov's Fork" pattern as exemplif ied onEURUSD H1 over 4 consecut ive days.

Figure 2. "Chuvashov's Fork" pattern format ion

Page 2: Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

Figure 2 shows the emergence of the "Chuvashov's Fork" (CF)pattern on the uptrend suggest ing the end of the t rend or that thetrend is going f lat . РњРўS opened a SELL posit ion.

Figure 3. New CF pattern

6 bars (hours) later, a new CF pattern with a wider gap emerged(Fig. 3) conf irming the previous pattern that suggested the reversalof the t rend or it going f lat .

MTS closed the previous SELL posit ion at the Take Prof it level andopened a SELL posit ion again on the CF pattern condit ions.

Figure 4. CF pattern conf irmat ion

Fig. 4 shows that af ter the t rend reversal on October 11, the t rendwas going down which is conf irmed at the beginning of October 12 bythe CF pattern directed downwards.

In the middle of the day, a new trend reversal started to take shape asthe price moved towards the lateral CF line. After the lateral line iscrossed, the exist ing SELL posit ion can be closed and a BUY posit ioncan be opened.

Figure 5. Trend reversal

As can be seen in Fig. 5, the t rend kept going up for the remaining partof the day on October 12 and the beginning of October 13. Towardsthe middle of the day, an upward CF pattern has emerged. Anothertrend reversal began to show in the middle of the day on October 13.Following the formed signals, MTS will close the BUY posit ion and opena SELL posit ion.

The above pattern format ion sequence can be traced using thestrategy tester in visualizat ion mode at a low speed by test ing theattached f ile Fork_Ch_ExpertH1_v2.mq4 as an Expert Advisor.

Page 3: Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru
Page 4: Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

Figure 6. Trading signals

Figure 6 provides some clarif icat ions in terms of signals for opening and closing posit ions.

2. Some Features of the Proposed Code for "Chuvashov's Fork" in MQL4

The list of variables, funct ions for opening and closing orders, funct ions for drawing marks andtrend lines are lef t without comments in the below code and are not provided in the art icle sincethey can be found in the programs in the at tached f iles and are simple enough to f igure out.

Note that some variables are included in the main program funct ion Start() as they should bezeroed out at every t ick.

We start with searching for the last three consecut ive f ractals lying along, e.g. a downtrend. Inthis case, we get a fork directed downwards. If there is a breakout above the lateral line, a BUYposit ion can be opened.

for (i=M;i<=N;i++) { i f(High[i]>High[i+1] && High[i]>High[i+2] && High[i]>High[i-1] && High[i]>High[i-2]) { VFN++; i f(VFN==1) { Vnf1=i; VMF1=High[i]; tim1=iTime(NULL,0,i); } i f(VFN==2) { VMF2=High[i]; i f(VMF2>VMF1) { Vnf2=i; tim2=iTime(NULL,0,i); } } i f(VFN==3) { VMF3=High[i]; i f(VMF3>VMF2) {Vnf3=i; tim3=iTime(NULL,0,i); } } i f(VFN==3) break; } }

In the above loop, we have found three fractals located in the specif ied manner, i.e. the 1stf ractal is lower than the 2nd fractal and the 2nd fractal is lower than the 3rd f ractal. The 3rd and2nd fractals are reference points in the construct ion of the Main t rend line and form the basisthereof.

Page 5: Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

However the 3rd f ractal (its value) may turn out to be lower than the main t rend line project ionon the vert ical of the 1st f ractal:

Figure 7. Ref inement of locat ion ofthe reference point

Therefore we introduce a number ofoperators ref ining the locat ion of the3rd reference point in accordancewith the pattern construct ionrequirements.

i f(VMF3>VMF2 && VMF2>VMF1) { V_down1=((VMF3-VMF2)/(Vnf3-Vnf2)); PricePrL1_1f=VMF2-(Vnf2-Vnf1)*V_down1; i f(VMF1>PricePrL1_1f) { V_down2=((VMF2-VMF1)/(Vnf2-Vnf1)); PricePrL2_1b=VMF1-Vnf1*V_down2; PricePrL1_1b=VMF2-Vnf1*V_down1; patternBuy = true; patternSell = false; DelLine(); CreateLine(); CreateArrow(); } }

If the Max price of the 1st f ractal is higher than the price of the project ion of the MAIN(1) t rendline on the same fractal, then the Chuvashov's Fork construct ion requirements are met.

Thus, the "Chuvashov's Fork" pattern has been determined and we can draw the respect ivepattern marks and lines on the chart .

Now we should determine the condit ions and parameters of the opening BUY posit ion.

i f(OrdersTotal()<1) { i f(patternBuy==true) {

It would be better if the price range over the last 25 bars is at least 50 points.

Let us add addit ional condit ions, e.g. a 150-period moving average over the last 24 or 48 hours

Page 6: Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

(bars) will be directed downwards and the price will be 89 points lower away from this indicator(Fibo89s level).

i f((High[iHighest(Symbol(),Period(),MODE_HIGH,25,0)]-Low[iLowest(Symbol(),Period(),MODE_LOW,25,0)])>=50*Point) { i f(Bid<Ma144_1-89*Point && (Ma144_1-Ma144_48)<0) {

The main condit ion for opening a posit ion is crossing of the lateral pat tern line by the price.

E.g. it may be as follows:

i f((High[1]>PricePrL2_1b || Close[1]>PricePrL2_1b || (Open[1]<Close[1] && Close[1]>PricePrL2_1b) || Bid>PricePrL2_1b) && Bid<PricePrL2_1b+3*Point) {

Further, we def ine the Stop Loss and Take Prof it parameters. Set Stop Loss to be equal to theminimum price value over the interval f rom the "0" bar to the bar of the 2nd fractal, i.e. at theLow level of the 1st f ractal. Set Take Prof it at the level of 0.6 of the price range.

Since this strategy presupposes tracing by lower f ractals of the uptrend, we will set Take Prof itto be more than two minimum price ranges, e.g. 100 - 200 points.

{ SL_B=(Bid-Low[iLowest(Symbol(),Period(),MODE_LOW,Vnf2,0)])/Point; i f(SL_B<StopLevel) SL_B=Bid-(StopLevel+2)*Point; TP_B=120; Print(" OP_BUY Chuvashov's Fork"," VMF1 = ",VMF1," < ",PricePrH1_1f); Op_Buy_Ch(); return; }

The search for the last three consecut ive f ractals lying along the uptrend is based on lowerfractals and the ent ire process of making an upward pattern follows the logic of a patternmade on a downtrend.

Page 7: Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

for (i=OrdersTotal()-1; i>=0; i--) { if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {Print("Order selection error = ", GetLastError()); } i f(OrderType()==OP_BUY ) {

If an uptrend pattern has emerged while a BUY posit ion was opened, it means that the pricehas turned around and started going down. The BUY posit ion should be closed.

i f(patternSell==true) { Print(" closing the BUY position as the opposite pattern has emerged"); Close_B_Ch(); return; }

We pass on to modif icat ion of the open BUY posit ion.

The modif icat ion process is divided into 3 stages. At the f irst stage, we draw Stop Loss closerto 'zero-loss'. At the second stage, when the price reaches a posit ive prof it equal to or greaterthan Stop Loss, we move Stop Loss to the posit ion opening level.

i f((Bid-OrderOpenPrice())>SL_B*Point && OrderStopLoss()<OrderOpenPrice()) { OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss()+(SL_B/2)*Point, OrderTakeProfit()+1*Point, 0, Red); return; } i f((Bid-OrderOpenPrice())>SL_B*Point && OrderStopLoss()<OrderOpenPrice()) { OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss()+(SL_B+StopLevel)*Point, OrderTakeProfit()+1*Point, 0, Magenta); return; }

Page 8: Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

When the price reaches the prof it of more than 1.5 t imes the Stop Loss value, we draw SL_B tothe nearest lower f ractal that should be higher than the preceding Stop Loss, and further alongthe ascending lower f ractals of the uptrend.

i f((Bid-OrderOpenPrice())>=(SL_B+SL_B/2)*Point && OrderStopLoss()>=OrderOpenPrice()) { for (k=3;k<=24;k++) { i f(Low[k]<Low[k+1] && Low[k]<Low[k+2] && Low[k]<Low[k-1] && Low[k]<Low[k-2]) { VlFl_L=Low[k]; i f(VlFl_L>OrderStopLoss()) { tim1_L=iTime(NULL,0,k); OrderModify(OrderTicket(), OrderOpenPrice(), VlFl_L+2*Point, OrderTakeProfit()+1*Point, 0, Aqua); i f(VlFl_L!=0) break; return;

Conclusion

A brief conclusion is that the introduced sample MTS yields about the same posit ive resultswhen tested by dif ferent brokers.

The described technique can be used by t raders as a t rading system component. However itneeds to be further developed in terms of f ilters for opening posit ions. The f ilters proposedherein above can be improved as recommended by the author of the technique StanislavChuvashov.

The recommendat ions can be found in 17 free lessons by Stanislav Chuvashov (in Russian).

Notes to the attached f iles:

Fork_Ch_ExpertH1_v1.mq4 - MTS "Chuvashov's Fork

Fork_Ch_MTS_v2.mq4 - MTS "Chuvashov's Fork" without comments in the program text .

Warning: All rights to these materials are reserved by MetaQuotes Software Corp. Copying or reprinting of thesematerials in whole or in part is prohibited.

Page 9: Articles.mql4.Com-Mechanical Trading System Chuvashovs Fork Ru

you can help me because I can not get this to work.

2012.10.22 08:50 daljuli

I don't think many traders outside of Russia are aware of Chuvashov's Forks. It 's great thatyou've taking the t ime to describe them & how they work, let alone create a proof-of-conceptEA. Thankyou!

2012.05.01 06:19 slipshod