Support Resistance EA with martingale

MQL4 Experts

Spécifications

Ø  Section 1 – Indicator script (Note that this section 1 script is important for the EA describe in Section 2 below)

This indicator script outputs the following variable:

PriceHighBox = #Price_level

PriceLowBox = #Price_level

SRBox = up or down

Draw red and blue dots to indicate support and resistance

Valid scenario A:

A peak has to rise up and down in price by Y amount of pips (user input). Vice versa for support.

[A: The highest price of 3 peaks (for uptrend; 3 peaks cannot be consecutively higher) with [B: one identified support or resistance] that has a [C: clearance more than X pips]. Draw [D: blue dot (below low)] and [E: red dot (above high)] on chart. (see graphic below)

 

 Valid scenario B:

[A: The Lowest price of 3 supports (for downtrend; 3 supports cannot be consecutively lower) with [B: one identified peak] that has a [C: clearance more than X pips]. Draw [D: blue dot (below low)] and [E: red dot (above high)] on chart. (see graphic below)

 

 Valid scenario C:

[A: The highest price of 3 peaks (for downtrend; 3 peaks cannot be consecutively lower) with [B: one identified support] that has a [C: clearance more than X pips]. Draw [D: blue dot (below low)] and [E: red dot (above high)] on chart. (see graphic below)

 

 Valid scenario D:

[A: The Lowest price of 3 supports (for uptrend; 3 supports cannot be consecutively higher) with [B: one identified peak] that has a [C: clearance more than X pips]. Draw [D: blue dot (below low)] and [E: red dot (above high)] on chart. (see graphic below)

 

 When the indicator becomes invalid

Invalid scenario A:

 

Invalid scenario B:

 

Invalid scenario C:

 

 Invalid scenario D:

 

 

Ø  Section 2 – EA Program:

PairSpread          //Fixed spread of instrument input by user
SRBox  
ExistingTrade = False      //At the start of the program, existing trade will be false i.e. none. It has 3 states: None, Long, Short

SupportPrice = 0               //Lowest price as determined by SRBox indicator
ResistancePrice = 0         //Highest price as determined by SRBox indicator
PercentTriggerBuffer     //Percent input by user to be applied on SupportPrice and ResistancePrice to determine stop trigger//

TriggerBuffer     //TriggerBuffer = PercentTriggerBuffer * (ResistancePrice –SupportPrice)

SplitBlock            //Dividing the whole box including two sides of the buffer by 10, SplitBlock = [(ResistancePrice – SupportPrice) + 2*TriggerBuffer]/10

PF[1] = 5, PF[2] = 6, PF[3] = 6, PF[4] = 6, PF[5] = 6, PF[6], PF[7] = 7, PF[8] = 8, PF[9] = 9, PF[10] =10 //Number input by user for target profit calculation

BStop[1]              // First trade: Buy stop order, BStop1 = ResistancePrice + TriggerBuffer + PairSpread;
BStopSLoss[N]  // Stop loss for first trade: BStopSLoss [N]= BStop1 – N*SplitBlock
SStopSLoss[N]   // Stop loss for first trade: SStopSLoss [N]= BStop1 + N*SplitBlock
BTargetProfit[N]// Buy target profit for first trade: BTargetProfit[1] = PF[1]*SplitBlock + PairSpread

PercentRisk[1], PercentRisk[2], PercentRisk[3], PercentRisk[4], PercentRisk[5], PercentRisk[6], PercentRisk[7], PercentRisk[8], PercentRisk[9], PercentRisk[10]
//User input on percentage in decimals to indicate how much capital to risks, use to calculate lot size

N = 1                      // number of trade
LotSize1               // Lot size calculation based on PercentRisk1 of capital
MarketBuy2       // 2nd trade which is a market buy

Ø  Process 1: SRBox Script from Section to assign support and resistance price

//Identify latest valid SR box for both up and down based on rule describe in section 1.

Use indicator from section 1

PriceHighBoxUp = #Highest price of the up box
PriceLowBoxUp = #Lowest price of the up box
PriceHighBoxDown = #Highest price of the Down box

PriceLowBoxDown = #Lowest price of the Down box

 

 

SplitBlockUpNew = [(PriceHighBoxUp – PriceLowBoxUp)*(1+ PercentTriggerBuffer)]/10
SplitBlockDownNew = [(PriceHighBoxDown – PriceLowBoxDown) *(1+ PercentTriggerBuffer)] /10

Ø  Process 2: Calculate Buy and Sell stop level, stop loss and target profit (for both long and short)

ResistancePrice = PriceHighBoxUp
ResistanceBasePrice = PriceLowBoxUp

SupportPrice = PriceLowBoxDown
SupportBasePrice = PriceHighBoxDown

BStop[1] = ResistancePrice + TriggerBuffer + PairSpread;
BTargetProfit[1] = BStop[1] + PF[1]*SplitBlock + PairSpread
BStopSLoss[1] = BStop[1] – SplitBlock

SStop[1] = SupportPrice - TriggerBuffer;
STargetProfit[1] = SStop[1] – (PF[1]*SplitBlock + PairSpread)
SStopSLoss[1]= SStop[1] + SplitBlock

 

Ø  Process 3: Activate price levels (for both long and short)

If [ExistingTrade != long]
{BuyStop @ BStop[1] with Stop Loss @ BStopSLoss[1] and BTargetProfit[1]; LotSize[1]

IF BStop[1] is executed, CLOSE previous short trade if exists, ExistingTrade = long, N=1} 


If [ExistingTrade != short]
{SellStop @ SStop[1] with Stop Loss @ SStopSLoss[1] and STargetProfit[1]; LotSize[1]

IF SStop[1] is executed, CLOSE previous long trade if exists, ExistingTrade = short, N=1}


Ø  Process Step 4: Activate Martingale for orders taken

//If the first trade is taken and stop loss of first trade is hit, continue taking trade in the same direction but martingale the risks. Take trade in the same direction only up to a maximum of 10 times.

If ExistingTrade = Long && If BStopSLoss[N] is hit && N <=10, N++
{ BStop[N] = ResistancePrice + N*TriggerBuffer + PairSpread;
BTargetProfit[N] = BStop[N] + PF[N]*SplitBlock + PairSpread
BStopSLoss[N] = BStop[N] – SplitBlock
MarketBuy[N] with BStopSLoss[N], BTargetProfit[N], LotSize[N]}

If ExistingTrade = short && If SStopSLoss[N] is hit && N <=10, N++
{ SStop[N] = SupportPrice - TriggerBuffer;
STargetProfit[N] = SStop[N] – (PF[N]*SplitBlock + PairSpread)
SStopSLoss[N]= SStop[N] + SplitBlock
MarketSell[N] with SStopSLoss[N], STargetProfitN], LotSize[N]}

Ø  Process Step 5 (Final): Reset everything

If Target profit is hit, N = 0, ExistingTrade = False

End. 

Répondu

1
Développeur 1
Évaluation
(219)
Projets
405
60%
Arbitrage
13
38% / 23%
En retard
160
40%
Travail
2
Développeur 2
Évaluation
(90)
Projets
159
61%
Arbitrage
40
18% / 63%
En retard
70
44%
Gratuit
Commandes similaires
Zzz 30+ USD
// กำหนดค่าตัวแปรพื้นฐาน input double lotSize = 0.1; // ขนาดล็อตที่ต้องการ input int takeProfit = 50; // ระยะ Take Profit (จุด) input int stopLoss = 50; // ระยะ Stop Loss (จุด) input int magicNumber = 123456; // หมายเลข Magic Number input int smaPeriod = 14; // ช่วงเวลา Simple Moving Average (SMA) // เวลาที่ออเดอร์ล่าสุดถูกเปิด datetime lastOrderTime = 0; // ฟังก์ชั่นหลักของ EA void OnTick() { //
Mobile robot 50 - 100 USD
I want a profitable scalping EA robot for mt5 and mobile phones (licence key should be provided).the video link attached below indicates how the EA robot should operate it.it analyses the market before taking trades and it trades candle to candle .also coding samples are provided on the video .it should be applicable to all timeframes.it should trade indices(Nas100,US30,S&p500,GER30,)
I use the translator I hope to make myself understood. I'm looking for a cyclical indicator. mt5. I attach videos to understand how it works. to be inserted at any point of the graph. It is possible to change the color and thickness of the line
This EA must have the following functions together: BE: place BE when the price reach a certain gain in PIPS and you can choose the offset too, so, for example it activates after 10 pips with 1 pip of offset so you can have profit with BE too Auto SL and TP Can manage the trades made by phone when MT5 is open in the PC or VPS Trailing stop (step by step): I can decide at what number of pips the trailing stop get
This is a strategy based on crossing two trend indicators on the second timeframe (1s, for example). We work not only with the market but with the limit orders as well (robot must "read" an order book). Read the whole instruction please for more details. Speak Russian, English
Martingale EA for MT5 30 - 100 USD
Criteria: Only one trade at a time. Cannot open another trade if one is running Trade on EURUSD only, once job is completed I will be happy to schedule more for other pairs You choose entry strategy and criteria win rate must be above 50% in long term backtest of EURUSD Every trade has got TP and SL Trades to last about a day, few trades a week, at least 10 pips gain per trade, so that it can be launched on normal
I have a indicator, mql file. The signals are seen below on a EURNZD H1 chart. Very important to get accurate entries. The signal to trade is the first tic after the the indicator signal paints. I've tried to demonstrate that below. Other than that the EA will have a lot size escalation, an on-screen pip counter, a button to stop taking new trades, SL/TP, and magic number. I would like the indicator to be within the
I would like to create an EA based on the Shved Supply and Demand indicator. you can find the Shved Supply and Demand v1.7 indicator in the following link https://www.mql5.com/en/code/29395 NB: Checks the trading robot must pass before publication in the Market ( https://www.mql5.com/en/articles/2555 ) MQ5 file to be provided
Im looking for an coder to code an EA: Trade management 1. opening trades according to the indicator 2. trades settings to choose from like: open all trades according to the signal open only trade 1,2,3 or 4 % per trade ( example 50/30/20 of the lot settings, with 4 trades it would be for example 50/30/10/10) 3. SL/Trailing settings: Move SL to entry after hitting TP1/TP2 or TP3 moving SL by % keep the original SL
Hi I'm looking to have 2 of my pinescript strategies converted to MQL5 and was wondering if you could first give me a quote for the more simple strategy and then for both the simple and complex strategy together. The simple strategy is a MACD crossover type thing that uses a special EMA script that filters out some ranging price action and also fractal candles for the stop loss. The second strategy is market

Informations sur le projet

Budget
30 - 80 USD
Pour le développeur
27 - 72 USD
Délais
de 3 à 8 jour(s)