Auftrag beendet
Ausführungszeit 4 Stunden
Spezifikation
Good afternoon,
I have a simple MT4 indicator I would like translated to MQL5, keeping code structure, functions, constants and comments.
The indicator has four buffers: two lines and two arrows, draws rectangles and labels, implements alerts and ignores unclosed bar.
The indicator is barely 200 lines with heavy comments. See below.

//+------------------------------------------------------------------+ //| ExampleIndicator.mq4 //+------------------------------------------------------------------+ #property copyright "Flaab" #property link "None" //--- constants #define OLabel "ExLabel" #define ShortName "Example Indi" #define Shift 1 //---- indicator settings #property indicator_chart_window #property indicator_buffers 4 #property indicator_color1 DodgerBlue #property indicator_color2 Red #property indicator_color3 DodgerBlue #property indicator_color4 Red #property indicator_width1 3 #property indicator_width2 3 #property indicator_width3 2 #property indicator_width4 2 //---- indicator parameters extern string Settins = "------- Settings"; extern int TradePeriod = 20; extern int TimingPeriod = 3; extern color BullBox = LightBlue; extern color BearBox = LightSalmon; extern color BullLabel = DodgerBlue; extern color BearLabel = Red; extern string Alerts_ex = "------- Alerts"; extern string AlertCaption = "My Alert Name"; extern bool DisplayAlerts = true; extern bool EmailAlerts = false; extern bool PushAlerts = false; extern bool SoundAlerts = false; extern string SoundFile = "alert.wav"; //---- indicator buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; double TrendDirection[]; //---- internal static int AlertTriggered; static datetime TimeStamp; static int AlertCount = 1; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { // 4 Visible buffers + invisible one IndicatorBuffers(5); // Drawing settings SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,233); SetIndexStyle(3,DRAW_ARROW); SetIndexArrow(3,234); IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)); // Buffers SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer(2,ExtMapBuffer3); SetIndexBuffer(3,ExtMapBuffer4); SetIndexBuffer(4,TrendDirection); // Invisible buffer. // Delete old objects DeleteObjects(); return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ void DeleteObjects() { int obj_total=ObjectsTotal(); for(int i = obj_total - 1; i >= 0; i--) { string label = ObjectName(i); if(StringFind(label, OLabel)==-1) continue; ObjectDelete(label); } } int deinit() { DeleteObjects(); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { // More vars here too... int start = 1; int limit; int counted_bars = IndicatorCounted(); // check for possible errors if(counted_bars < 0) return(-1); // Only check these limit = Bars - 1 - counted_bars; // Comment account info CommentInfo(); // Iterate from past to present // Ignore unclosed bar! for(int i = limit; i >= start; i--) { // Highest and Lowest of the last N bars double rhigh = iHigh(Symbol(),Period(),iHighest(Symbol(), Period(), MODE_HIGH, TradePeriod,i+1)); double rlow = iLow(Symbol(),Period(),iLowest(Symbol(), Period(), MODE_LOW, TradePeriod, i+1)); double bhigh = iHigh(Symbol(),Period(),iHighest(Symbol(), Period(), MODE_HIGH, TimingPeriod,i+1)); double blow = iLow(Symbol(),Period(),iLowest(Symbol(), Period(), MODE_LOW, TimingPeriod, i+1)); // Do not allow retracements if(ExtMapBuffer1[i+1] != EMPTY_VALUE && rlow < ExtMapBuffer1[i+1]) rlow = ExtMapBuffer1[i+1]; if(ExtMapBuffer2[i+1] != EMPTY_VALUE && rhigh > ExtMapBuffer2[i+1]) rhigh = ExtMapBuffer2[i+1]; // Preserve trend direction TrendDirection[i] = TrendDirection[i+1]; // Reset buffers ExtMapBuffer1[i] = EMPTY_VALUE; ExtMapBuffer2[i] = EMPTY_VALUE; ExtMapBuffer3[i] = EMPTY_VALUE; ExtMapBuffer4[i] = EMPTY_VALUE; // No Alert by default AlertTriggered = EMPTY_VALUE; //-- Check for uptrend if(Close[i] > rhigh && TrendDirection[i+1] != OP_BUY) { AlertTriggered = OP_BUY; TrendDirection[i] = OP_BUY; ExtMapBuffer3[i] = rlow; //-- Check for downtrend } else if(Close[i] < rlow && TrendDirection[i+1] != OP_SELL) { AlertTriggered = OP_SELL; TrendDirection[i] = OP_SELL; ExtMapBuffer4[i] = rhigh; } // Draw lines if(TrendDirection[i] == OP_BUY) ExtMapBuffer1[i] = rlow; if(TrendDirection[i] == OP_SELL) ExtMapBuffer2[i] = rhigh; // Breakouts / Rectangles if(TrendDirection[i] == OP_BUY && Close[i] > bhigh && bhigh <= High[i+TimingPeriod]) { DrawRectangle(i, TimingPeriod+1, BullBox); DrawLabel("Buy", i + MathCeil(TimingPeriod/2), OP_BUY, BullLabel); } else if(TrendDirection[i] == OP_SELL && Close[i] < blow && blow >= Low[i+TimingPeriod]){ DrawRectangle(i, TimingPeriod+1, BearBox); DrawLabel("Sell", i + MathCeil(TimingPeriod/2), OP_SELL, BearLabel); } } // Alerts if(TimeStamp != Time[0]) { if(AlertTriggered == OP_BUY && AlertCount == 0) { if(DisplayAlerts == true) { Alert(ShortName +" ("+ AlertCaption +") ["+ Symbol() +"] BUY"); } if(PushAlerts == true) { SendNotification(ShortName +" ("+ AlertCaption +") ["+ Symbol() +"] BUY"); } if(EmailAlerts == true) { SendMail(ShortName +" ("+ AlertCaption +") ["+ Symbol() +"]", Symbol() +": BUY"); } if(SoundAlerts == true) { PlaySound(SoundFile); } } else if (AlertTriggered == OP_SELL && AlertCount == 0) { if(DisplayAlerts == true) { Alert(ShortName +" ("+ AlertCaption +") ["+ Symbol() +"] SELL"); } if(PushAlerts == true) { SendNotification(ShortName +" ("+ AlertCaption +") ["+ Symbol() +"] SELL"); } if(EmailAlerts == true) { SendMail(ShortName +" ("+ AlertCaption +") ["+ Symbol() +"]", Symbol() +": SELL"); } if(SoundAlerts == true) { PlaySound(SoundFile); } } TimeStamp = Time[0]; AlertCount = 0; } return(0); } /** * Comments account info */ void CommentInfo() { double balance = AccountBalance(); double spread = MarketInfo(Symbol(), MODE_SPREAD); Comment("Account Balance: "+ DoubleToStr(balance, 2) +"\n"+ "Spread: "+ DoubleToStr(spread, 0) +" pts\n"+ "Quote: "+ DoubleToStr(Bid, Digits) +"/"+ DoubleToStr(Ask, Digits)); } /** * Draws a rectangle * @param int shift Relative bar for rectangle * @param int pshift Past bar for rectangle * @param int vcolor Color of rectangle */ void DrawRectangle(int shift, int pshift, color vcolor) { // Times for rectangle datetime x1 = Time[shift]; datetime x2 = Time[shift+pshift-1]; // Label string label = OLabel +"Rect-"+ pshift + x2; // Prices for rectangle double rhigh = iHigh(Symbol(),Period(),iHighest(Symbol(), Period(), MODE_HIGH, pshift, shift)); double rlow = iLow(Symbol(),Period(),iLowest(Symbol(), Period(), MODE_LOW, pshift, shift)); // Draw ObjectCreate(label, OBJ_RECTANGLE, 0, x1, rlow, x2, rhigh); ObjectSet(label, OBJPROP_COLOR, vcolor); ObjectSet(label, OBJPROP_BACK, true); } /** * Draws a label * @param string text Text to display * @param int shift Bar to display the text * @param int vType OP_BUY is above the bar, OP_SELL below the bar * @param color vcolor Color of the text */ void DrawLabel(string text, int shift, int vType, color vcolor) { // Time datetime x1 = Time[shift]; datetime x2 = Time[shift+1]; double vPrice; // Color if(vType == OP_BUY) { vPrice = Low[shift]; } else { vPrice = High[shift] + iATR(Symbol(), 0, 30, Shift)*0.90; } // Label string label = OLabel +"-"+ text +"-"+ x2; ObjectCreate(label, OBJ_TEXT, 0, x2, vPrice); ObjectSetText(label, text, 8, "Tahoma", vcolor); ObjectSet(label, OBJPROP_BACK, true); }
Bewerbungen
1
Bewertung
Projekte
24
38%
Schlichtung
4
50%
/
0%
Frist nicht eingehalten
9
38%
Frei
2
Bewertung
Projekte
624
38%
Schlichtung
40
23%
/
65%
Frist nicht eingehalten
93
15%
Frei
Veröffentlicht: 4 Artikel, 19 Beispiele
Ähnliche Aufträge
Cycle trend for MT5
60+ USD
I need someone to recreate this indicator for mt5 for $60 it has to be non repaint ,I've been trying to code this indicator so if someone can do it my contact is , sebokomorobi6@gmail.com ,or 073 923 0151 you can contact the number on Whatsapp no calls allowed
Hi Im working with a Crypto trading company and we want to branch out with our indicator, i'm researching the bot automation and need some hands on board. i i want to hear your opinion about the indicator that i would like you to build. in the PDF i explain the whole indicator and how it need to look like. happy to hear form you
I want someone to hold a session for me and explain in details on how to implement them in. I would really appreciate your guidance on how to properly set up GoCharting and get access to CME futures data
Super trend Indicator
35+ USD
When the super trend changes from buy to sell and crosses the fast moving average and the 200 moving average is above the price, send email notification and/or sms (text) to sell . When the super trend change from sell to buy and crosses the fast moving average and the 200 moving average is below the price, send email notification and /or sms (text) to buy. Please note that there are two moving averages(fast and
Hola comunidad, Estoy buscando un desarrollador que tenga el archivo de instalación de MetaTrader 4 build 1443 o que pueda ayudarme a volver a esa versión. Tengo un robot (EA) que funcionaba perfectamente en build 1443, pero mi plataforma se actualizó automáticamente a build 1470 y ahora el robot ya no funciona correctamente. Necesito alguien que: • Tenga el instalador de MT4 build 1443, o • Sepa cómo reinstalar esa
have the Beatrix Inventor Expert Advisor (EA) that was profitable in the past but has been losing money recently. I need an experienced EA developer/optimizer to study the trade history (especially Stop Loss hits, drawdown periods, SL/TP behavior, win/loss ratio, etc.) and recommend + implement specific tweaks so it becomes consistently profitable again. Your job: 1. Deep analysis of why the EA is no longer
Expert Advisor for MT5 with 10 Trading Rules
50 - 100 USD
want to develop a trading robot (EA) for MetaTrader 5 based on 10 specific rules. The robot should include a professional interface to control all settings, including: Fixed lot size (0.50), Stop Loss (10 USD), RSI indicators for entry/exit, News filter, Trailing stop, and daily profit targets. I have the full logic ready to discuss with the developer. Please ensure high-quality code and testing
نموزج الكتفين
30+ USD
حلل لي اصل مالي ) اكتب هنا مثلا XAU EUR USD USD اريد تحليلا تعليما و ليس توصية مالية ۱- نوع التحليل المطلوب : ( فني / اساسي / سلوك سعري ) ٢ - المدي الزمني : ( قصير / متوسط / طويل ) M15 / H1 / H4 / ) اذكر الفريمات المطلوبه + (D1 ما اريد استخراجه من التحليل : الاتجاه العام اقوي مستويات دعم و مقاومة رقمية سيناريو صعود و سيناريو هبوط مع شروط كل سيناريو ( IF / THEN ) اين يصبح السيناريو لاغيا مناطق دخول و خروج تعليمية (
Hi I need a MetaTrader 5 Expert Advisor for XAUUSD that creates a laddered buy setup and manages take-profit automatically depending on how many entries are triggered. The EA will act as a trade execution and management tool , not a strategy robot. Core Function The EA should include a BUY/SELL SETUP button that creates a ladder of orders. E.g. When pressed: Open Entry 1 – Market Buy Place Entry 2 – Buy Limit below
Job Description (Final Version) 1. REAL‑TIME Supply & Demand Zone Detection The indicator must detect Supply & Demand zones as soon as they form , with zero repainting and no shifting once confirmed. Demand Zones (Bullish continuation) A Demand Zone is created when price produces a valid bullish displacement from a clearly defined origin candle. (Full rules will be provided.) Supply Zones (Bearish continuation) A
Projektdetails
Budget
10 - 100 USD
Ausführungsfristen
bis 5 Tag(e)