Forex rebate kingForex rebate king

Determining trading strategies based on support resistance and price behavior and related MQL4 EA codes

IntroductionTh Forexrebateking article covers a trading method that can cashback forex applied to any Forex, stock cashbackinforex commodity market, as well as MQL4 example codes for EA based on this methodPrice behavior and determination of support and resistance levels are key components of the systemWhether or not to enter the market depends entirely on these two factors in reference to Forex rebate king and how This is achieved by setting exit and stop loss levels relatively close to the entry price, which has the added benefit of allowing higher trading volumes regardless of account size. If you look at the price charts of any market in any time frame, you will find two facts based on the characteristics of eternal markets one of which is that at any given time, market prices do not stay in one place for very long given enough time, market prices are bound to change significantly any price shown on the chart can be used as a reference standard however, a particular price The second fact mentioned above is that any chart will reach a particular price level and then the market trend will completely reverse. These price levels send the message that (up to this point) once the market reaches this point then the price will reverse around it Support and resistance levels are good price reference levels because they imply a high probability of a new trend starting at the price level where other prices, such as the middle price of two related support and resistance levels We use such prices as midpoints Any part of the price chart can be marked with a horizontal line with the corresponding support, resistance and midpoint price as a reference. nbsp; about in the middle between the two there is a black line, the middle level at forexrebateindonesia.10048 accurately determine in the support or resistance level depends mainly on subjective judgment, will vary with your own judgment of the timing of entry and exit you may want to open a position at a specific price or near a specific price or the exact price of entry may not be important to you, a wide range of prices on the It all depends on your personal trading habits and profit targets, so the examples of support and resistance reference points can vary greatly from one another. Price levels rely on subjective divisions, but it is clear that they occur at the top and bottom (and middle) of short-term trends Figures 3 through 6 are examples of support and resistance levels for longer and shorter time periods under the one-minute charts Figures 3-4 represent bull markets, while Figures 5-6 represent bear markets Figure 3 Long-term bull markets Figure 4. Short-term bear markets Figure 5. Bear market in these price level areas signals this specific type of price movement When these types of price behavior appear on the chart, the time to trade will come 2. Identify high winning strategies based on price behavior Multiple double K-line patterns signal high winning trading times Three patterns are presented here These patterns appear when prices are close to support and resistance levels and can be used as a reference point for entering the market Need to be reminded It is important to note that each example presented from now on is based on the 1-minute K-line because our system is designed to achieve more precise entry points and to keep the stop loss within a small range. After introducing these three patterns an example will be given of the first pattern, pattern 1 consists of a K-line with a lower lead longer than the solid and a two K-lines with a closing price higher than the first K-line The lead is a straight line, which represents the price range between the highest price above the solid and the opening/closing price, or the range between the lowest price below the solid and the opening/closing price The doji K-line is contained in the first K-line pattern Figure 7. Bull pattern 1 Figure 8. Bear pattern 1 Figure 7 shows a bullish pattern and Figure 8 shows a bearish pattern These patterns are similar to the hammer K-line pattern, but are not as specific as the doji pattern, which can contain any combination of rising and falling K-lines Figure 9 shows the bullish trend that begins with this type of pattern Figure 9. Pattern 2 consists of two K-lines, the length of the second waxing K-line entity is almost equal to that of the first one and the opening and closing prices of the two K-lines are almost the same. shows a bear trend that starts with a tweezer pattern Figure 10. Bear pattern 2 Figure 11. When you see one of the above three patterns on the 1-minute chart, there is another factor you have to consider before deciding to enter at this moment and that is the distance between the entry price and the reference price of the nearby support or resistance level If the entry price is too far from the reference price, do not open a position easily, regardless of the price movement pattern As mentioned before The real entry point is when the next 1-minute K-line opens In other words, 2 K-lines form a price pattern, open a position at the third K-line and place a market order at the opening price These will be described later in the MQL4 code section Obviously, since the price movement pattern is the key element of this type of trading strategy, we always use market orders for entry and do not use pending orders 3. The following block of code can be used by EAs based on price movement and support/resistance levels. First of all, the variables Open, High, Low and Close of the most recent 1-minute K-line are defined. iLow() and iClose() because to detect a complete double K-line pattern, the one that is 2 minutes earlier than the current K-line will be the first one in the pattern (for example, the K-line on the left side of Figure 7) The next K-line formed after 1 minute of the three patterns presented here will be marked as Candle2 (the K-line on the right side of Figure 7) The current K-line will be marked as Candle3, and the K-line on the right side because of the monitoring of the real-time price run, so the EA will implement the operation on the current and previous two K lines doubleO1=NormalizeDouble(iOpen(Symbol(),PERIOD_M1,2),4);Copy code The above code defines the opening price of Candle1 because this variable is not an integer, therefore Use double type O1 to represent the opening price of the first K line in this mode iOpen() uses Symbol() as the first parameter, so EA can run on the chart of any currency pair PERIOD_M1 represents the 1-minute time frame, the last parameter 2 defines the offset relative to the current K line offset 0 represents the current K line, 1 represents the penultimate The first K-line, 2 represents the penultimate K-line correspondingly, O1,H1,L1 and C1 represent the opening, high, low and closing prices of Candle1 O2,H2,L2,C2, and O3,H3,L3,C3 represent the corresponding prices of Candles2 and 3 respectively The following representatives are examples of these variable definitions //---- Candle1OHLCdoubleO1=NormalizeDouble(iOpen(Symbol(),PERIOD_M1,2),4);doubleH1=NormalizeDouble(iHigh(Symbol(),PERIOD_M1,2),4); doubleL1=NormalizeDouble(iLow(Symbol(),PERIOD_M1,2),4);doubleC1=NormalizeDouble(iClose(Symbol(),PERIOD_M1,2),4);//---- Candle2OHLCdoubleO2=NormalizeDouble(iOpen(Symbol(),PERIOD_M1,1),4);doubleH2=NormalizeDouble(iHigh(Symbol(),PERIOD_M1,1),4); doubleL2=NormalizeDouble(iLow(Symbol(),PERIOD_M1,1),4);doubleC2=NormalizeDouble(iClose(Symbol(),PERIOD_M1,1),4);//---- Candle3OHLCdoubleO3=NormalizeDouble(iOpen(Symbol(),PERIOD_M1,0),4);doubleH3=NormalizeDouble(iHigh(Symbol(),PERIOD_M1,0),4); doubleL3=NormalizeDouble(iLow(Symbol(),PERIOD_M1,0),4); doubleC3=NormalizeDouble(iClose(Symbol(),PERIOD_M1,0),4); copy code judgment conditions will be described in the following conditional sentence will Define one of the three main double K-line patterns generated For example, pattern 1, shown previously and in Figure 7, will be generated if(C1>=O1&&L1<O1&&((O1-L1)>(C1-O1))&&C2>=O2&& when the following judgment sentence is true amp;C2>H1&&L2>L1)Copy codeThis pattern requires six conditions to be met simultaneouslyFirst, C1>=O1 means Candle1 must be an up K line or the opening price must equal the closing priceL1<O1 means Candle1s minimum price must be lower than the opening priceThe next condition is to The distance between Candle1s opening and lowest prices must be greater than the distance between the closing and opening prices meaning that Candle1s lower shadow must be longer than its solid fourth phase condition is related to Candle2, requiring its closing price to be greater than or equal to its opening price C2> H1 means that Candle2s closing price is higher than Candle1s highest price Finally, the Candle2s minimum price must be higher than Candle1s minimum price If all of these conditions are met when pattern 1 is generated, the following code will place a market buy order with a trade size of 0.1 lots, allowable slippage of 5pips, stop loss of 10pips, and a take profit of 50pips //---- pattern1-bull if(C1>=O1& amp;&L1<O1&&((O1-L1)>(C1-O1))&&C2>=O2&&C2>H1&&L2>L1)  {  & nbsp;OrderSend(Symbol(),OP_BUY,0.1,Ask,5,Bid-10*Point,Bid+50*Point);  return;   }copy code the same, to do sell orders, the conditions will change to bear mode, similar to Figure 8 the same , the parameters of the OrderSend() function will be adjusted accordingly This code will place an order similar to the above, only in the opposite direction //---- mode 1-bear if(C1<=O1&&H1>O1&&((H1-O1)>(O1-C1))&& amp;C2<=O2&&C2<L1&&H2<H1)  {  OrderSend(Symbol(),OP_SELL,0.1,Bid,5,Ask+10*Point ,Ask-50*Point);  return;  }Copy the code When pattern 2 and pattern 3 are generated, similar code will be used to place the market price order Bull pattern 2 (tweezer type) is formed under the following conditions://---- pattern 2-bull if(C1<O1&& amp;C2>O2&&((O1-C1)>(H1-O1))&&((O1-C1)>(C1-L1))& &((C2-O2)>(H2-C2))& &((C2-O2)>(O2-L2 ))&&O2<=C1&&O2>=L1&&C2>=O1&&C2<=H1)  {  OrderSend(Symbol(), OP_BUY,0.1,Ask,5,Bid-10*Point,Bid+50*Point);  return;   }Copy the code for Bear Pattern 2 as follows://----Pattern2-bearishif(C1>O1&& amp;C2<O2&&((C1-O1)>(H1-C1))&&((C1-O1)>(O1-L1))& &((O2-C2)>(H2-O2))& &((O2-C2)>(C2-L2 ))&&O2>=C1&&O2<=H1&&C2<=O1&&C2>=L1)  {   OrderSend(Symbol(), OP_SELL,0.1,Bid,5,Ask+10*Point,Ask-50*Point)  return;   }Copy the code Finally, mode 3 has the following bull and bear conditions respectively://---- mode 3-bull if(C1>O1&& amp;((C2-O2)>=(H2-C2))&&C2>O2&&C2>C1)  {   OrderSend(Symbol(),OP_BUY,0.1,Ask,5, Bid-10*Point,Bid+50*Point);  return;  } //---- pattern 3-Bear if(C1<O1&&((O2-C2)>=(C2-L2))&& C2<O2&&C2<C1)  {  OrderSend(Symbol(),OP_SELL,0.1,Bid,5,Ask+10*Point,Ask-50*Point) & nbsp;return;  }Copy code order certain parameters, such as stop loss and stop win, can also be replaced with variables, rather than set to exact values as in the example 4. Combine support/resistance levels and price behavior Now its time to combine price behavior patterns and support-resistance reference level detection codes EA will monitor the market Once a specific price level is reached, price behavior patterns 1-3 will be detected for all three possible patterns, bull or bear or just one or several of them The code below uses two additional variables to detect that the market has reached a specific price, in this case EURUSD1.09000 In this example, EURUSD is below 1.09000 When the code is activated to make a trade doubleref=1.09000;intrefhit=0; if(O2<ref&&C3>=ref)  {  refhit=1;  return ;  }copy code variable ref represents the reference price level being monitored (support, resistance or median) another variable refhit, describing the current market state, whether it has reached the reference price level or refhit is an integer with a value of 0 or 1 the default value is 0, it represents the reference price has not yet reached the following conditions are met when the market touches the reference If this happens, the variable will be set to 1. These two variables will now be added to the previous code describing the price behavior in the EURUSD example, the price exceeds 1.09000 when the bull mode 3 will be detected Here is the modified mode 3 code:   if(refhit==1&&C1> O1&&((C2-O2)>=(H2-C2))&&C2>O2&&C2>C1&&C1>ref&&C2>ref)  { & nbsp; OrderSend(Symbol(),OP_BUY,0.1,Ask,5,Bid-10*Point,Bid+50*Point);  return;   }Copy the code first additional condition, refhit==1, representing The market reaches or exceeds the price set by the ref variable, in this case 1.09000 Remember that until this level is reached, the market is trading below 1.09000 The last two new conditions require that the closing prices of the two Mode 3 K-lines are above the ref variable value of 1.09000 Finally, Figure 16 shows the EURUSD within the range of short-term support at 1.07660 and resistance at EURUSD on the far right side of the chart, you can see that the market is running almost in the middle of these two levels a long signal was detected around the support level 1.07660 because the market does not always reach the support and resistance prices precisely, so the approximate price is usually used as a reference level here i.e. 1.07690, the support level The upper 3 pips use patterns 1 through 3 to identify the bull market //----- variable definition ------------------//----Candle1OHLCdoubleO1=NormalizeDouble(iOpen(Symbol(),PERIOD_M1,2),4); doubleH1=NormalizeDouble(iHigh(Symbol(),PERIOD_M1,2),4);doubleL1=NormalizeDouble(iLow(Symbol(),PERIOD_M1,2),4);doubleC1= NormalizeDouble(iClose(Symbol(),PERIOD_M1,2),4);//----Candle2OHLCdoubleO2=NormalizeDouble(iOpen(Symbol(),PERIOD_M1,1),4);doubleH2= NormalizeDouble(iHigh(Symbol(),PERIOD_M1,1),4);doubleL2=NormalizeDouble(iLow(Symbol(),PERIOD_M1,1),4);doubleC2=NormalizeDouble( iClose(Symbol(),PERIOD_M1,1),4);//----Candle3OHLCdoubleO3=NormalizeDouble(iOpen(Symbol(),PERIOD_M1,0),4);doubleH3=NormalizeDouble( iHigh(Symbol(),PERIOD_M1,0),4);doubleL3=NormalizeDouble(iLow(Symbol(),PERIOD_M1,0),4);doubleC3=NormalizeDouble(iClose(Symbol(), PERIOD_M1,0),4); doubleref=1.07690;intrefhit=0;//----------------------------------------- intstart(){//---- reference price detection if(O2& lt;ref&&C3>=ref)  {  refhit=1;  return;  } //---Mode 1-Bull if(refhit==1& amp;&C1>=O1&&L1<O1&&((O1-L1)>(C1-O1))&&C2>=O2&&C2>H1&&L2>L1&& ;C1>ref&&C2>ref)  {  OrderSend(Symbol(),OP_BUY,0.1,Ask,5,Bid-10*Point,Bid+100*Point);  ; return;  }//---Mode 2-Bull if(refhit==1&&C1<O1&&C2>O2&&((O1-C1)>(H1-O1))&&((O1 -C1)>(C1-L1))& &((C2-O2)>(H2-C2))& &((C2-O2)>(O2-L2))& & O2< =C1& & O2> =L1& & C2> =O1&&C2<=H1&&C1>ref&&C2>ref)  {  OrderSend(Symbol(),OP_BUY,0.1,Ask,5, Bid-10*Point,Bid+100*Point);  return;  }//---Mode 3-Bull if(refhit==1&&C1>O1&&((C2-O2)>=(H2-C2 ))&&C2>O2&&C2>C1&&C1>ref&&C2>ref)  {   OrderSend(Symbol(),OP_ BUY,0.1,Ask,5,Bid-10*Point,Bid+100*Point);  return;  }//--return;}copy code chart 17.EURUSD reversal chart 18.EURUSD entry chart 19.EURUSD exit bull All code modules of the pattern require the market to reach below 1.07690 and the closing price of both K lines 1 and 2 above it at the same time, the stop target is doubled from the previous example Figure 17 shows that the market does turn down and falls directly below 1.07690, reaches 1.07670 and then reverses up which makes the value of refhit change to 1 shortly after the reversal turns up, bullish pattern 3 is formed here is Market buy order entry position, the opening price at 1.07740, as shown in Figure 18 (Candle3 opening price sell price Bid for 1.07720 allows the existence of 5pips of slippage, the order was filled at 1.07740) from here, the market started a strong uptrend, as shown in Figure 19 stop price was never touched, the position was held at 1.08740 take profit exit conclusion As you can see from the examples presented in this article, the combination of price behavior patterns and support-resistance level detection can be extremely effective in determining trading strategies The MQL4 code included in the article and used for illustration is obviously only partial and cannot be used directly as an EA These code samples are code modules used to implement a full EA The main purpose of the article is to explain the principles behind the trading strategies Other price behavior patterns can also Other patterns of price behavior can also be described by programs for entry and exit wishing you all the best in your trading career
No reproduction without permission: Forex rebate king » Determining trading strategies based on support resistance and price behavior and related MQL4 EA codes

Related recommendations