MQL AI Wizard Community Codebase Library

In this overview, you can view statements addressed by community users as a prompt to the MQL-AI wizard as well as its output.

.

# AI instruction / parameter set Snippet Date
121 The best strategy for fast scalp forex 9th June 2024
122 regenearte entire code considering this error message on line 27:Syntax error at input 'end of line without line continuation' 9th June 2024
123 1. **Position Sizing**: Each position you open will involve 30% of the remaining balance in your wallet at the moment 2. **Signal for Selling**: When the Moving Average Convergence Divergence (MACD) chart crosses the Signal line from up to downward, open a sell position. 3. **Signal for Buying**: When the MACD chart crosses the Signal line from down to upward, open a buy position. 4. **Take Profit**: Set the Take Profit level at 1% of the market price. 5. **Stop Loss**: Set the Stop Loss level at 1.5% of the market price. 6. **Closing Positions Early**: If the MACD and Signal lines cross again before the Take Profit or Stop Loss levels are reached, close the position and open a new one based on the latest signal. 7. **Limit on Open Positions**: Never have more than one position open at a time. 9th June 2024
124 if the 5 min candle is under moving average and dropped 500 pips at any of 5 min candle just sell when candle is close and stop loss is high of that candle 9th June 2024
125 Volume = 0.01In account historyThe last transaction closed, whose year, month, day, hour, minute, second, was greater than the rest of the transactionsAnd if the trade was a buy and its profit was greater than or equal to 0.01, take a buy at the price of AskAnd if the transaction was buy and its profit was less than or equal to -0.01, take one cell at the bid priceAnd if the transaction was a cell and its profit was greater than or equal to 0.01, buy a cell at the price of willowAnd if the trade was sell and its profit was less than or equal to -0.01, take a buy at the price of Ask 9th June 2024
126 // Expert initialization functionint OnInit(){ return INIT_SUCCEEDED;}// Expert de-initialization functionvoid OnDeinit(const int reason){}// Expert tick functionvoid OnTick(){ // Define parameters double lotSize = 1.; int distance = 100; // in points double profitTarget = 80 * Point; // Take Profit level in points // Check if there are no open orders if (OrdersTotal() == ) { // Get the current price double currentPrice = Ask; // Sell double sellingPrice= currentPrice *distance currentPrice; // Buy order int buyTicket = OrderSend(Symbol(), OP_BUY, lotSize, Ask, 3, , profitTarget Ask, "Buy Order", , , Blue); double buyingPrice= currentPrice -currentPrice*distance; // Error handling if (buyTicket < ) { Print("Error in Buy OrderSend: ", GetLastError()); return; } // Sell order int sellTicket = OrderSend(Symbol(), OP_SELL, lotSize, Bid, 3, , Bid - profitTarget, "Sell Order", , , Red); // Error handling if (sellTicket < ) { Print("Error in Sell OrderSend: ", GetLastError()); return; } } // Loop through open orders for (int i = OrdersTotal() - 1; i >= ; i--) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { // Only handle buy and sell orders if (OrderType() == OP_BUY || OrderType() == OP_SELL) { // Check for profits if (OrderProfit() >= (profitTarget * lotSize)) { // Close the order CloseOrder(OrderTicket()); } } } }}// Function to close an order by its ticketvoid CloseOrder(int ticket){ if (OrderSelect(ticket, SELECT_BY_TICKET)) { if (OrderType() == OP_BUY) { OrderClose(ticket, OrderLots(), Bid, 3, Violet); 9th June 2024
127 generate a pine script code that plot the difference between stock price and the Leading Span A of the Ichimuko Cloud. Add a MACD of this plot. Keep all plots in a single panel separate from the main chart. 8th June 2024
128 can you correct code with error message 8th June 2024
129 create indicator 4hours bolinger band period 20 deviation. if price breakout draw arrow only in timeframe 4hours 8th June 2024
130 Price action with use of support and resistance integration and bullish and bearish engulfing incorporated, also trend catcher with false breakout detection and eliminations adding news filter and m 8th June 2024
131 write code in mql5Trading SetupTrade on daily chart (swing trading)5 SMA applied to the close10 SMA applied to the closeStochastic (14,3,3)RSI (9)Trading RulesEntry RulesEnter LONG if:The 5 SMA crosses above the 10 SMA and both Stochastic lines are heading up (do not enter if the Stochastic lines are already in the overbought territory)RSI is greater than 50Enter SHORT if:The 5 SMA crosses below the 10 SMA and both Stochastic lines are heading down AND (do not enter if the Stochastic lines are already in oversold territory)RSI is less than 50Exit RulesExit when the 5 SMA crosses the 10 SMA in the opposite direction of your trade OR if RSI crosses back to 50Exit when trade hits stop loss of 100 pipsmake it maximum open trade = 1 8th June 2024
132 code a trading robot for mt5, both opening and closing of trades will be done by the crossing up and down of a fast and slow moving averages. ensure that both moving averages are applied to the close price. all trades will open with a fixed lot size of 0.1 and will have a stop loss of 60 pips. The EA will close all open trades and will not open any new trades when the equity is 2 dollars more than the starting balance, this will be the maximum daily profit, new trades can begin the next day. 7th June 2024
133 Write code for forex trading in MQL4Open orderOpen new order when trade is in loss after specified number of pipsUse Lot multiplier when trade is in lossAdjust take profit for open trades to the same specified level when new trades are openedClose all trades when all trades are in a specified amount of profitOpen a new order after closing all trades in profitUse minimum Lot sizeUse maximum Lot sizeUse Starting Lot sizePlace only one order order at a timeUse Maximum number of ordersUse Take profitUse Stop lossUse equity protection 7th June 2024
134 انشأ لي روبوت تداول EA بلغة برمجة MQL5 بأستعمال اسلوب fractal breakout : ----------------------------------------------------------------------------اولاً فكرة التداول بالبيع والشراء :1. فتح صفقة شراء عندما يكون الاغلاق أعلى من الفراكتل العلوي2. فتح صفقة بيع عندما يكون الاغلاق أدنى الفراكتل السفلي3. قيمة الفراكتل يجب ان تكون 2----------------------------------------------------------------------------ثانياً ادارة المخاطر : 1. انظر للوراء 20 شمعة سابقة وابحث عن الفراكتلات في هذه الفترة وقم بالآتي : -ضع وقف الخسارة على أعلى فراكتل في حالة البيع -ضع وقف الخسارة على أدنى فراكتل في حالة الشراء2. جني الارباح يجب ان يكون متحرك وليس ثابت يمكنك ان تستعمل parbolic sar كطريقة لجني الارباح-اجني الربح عندما يغلق السعر أدنى من parbolic sar في حالة الشراء-اجني الربح عندما يغلق السعر أعلى من parbolic sar في حالة البيع---------------------------------------------------------------------------- ثالثا ادارة رأس المال :1. يجب ان يكون حجم اللوت هو 0.01 لكل 100$ من اجمالي رصيد الحساب ويزداد بمعدل 0.01 لكل 100$ إضافية سواء كان رصيد الحساب بمرتبة المئات او الإلوف او عشرات الإلوف المهم هو زيادة اللوت عند كل مبلغ جديد لرصيد الحساب الإجمالي 2. اغلق كل الصفقات بدون استثناء عند الوصول إلى نسبة ربح عائمة وقدرها 10% من اجمالي رصيد الحساب وعد مرة أخرى باليوم التالي وسر على نفس المنهج3. توقف عن فتح صفقات إضافية عندما يبلغ الهامش المستعمل 40% من اجمالي الهامش الحر المتاح 4. يجب اغلاق جميع الصفقات عند الوصول إلى نسبة خسارة وقدرها 60%- من اجمالي رصيد الحساب وعدم التداول مرة أخرى اطلاقاًيجب ان تكتب الكود باللغة الإنجليزية 6th June 2024
135 EA fractal breakout 6th June 2024
136 1.Short SetupBedingungen:Time Frame: 1HEMA 200: Oberhalb der Kerzen (Preis) => Bärische TendenzRSI 10: 40er LinieStrategie:Short Signal wird generiert, wenn:1)beim Kerzen Schluss Preis, der RSI von oben kommend die 40er Linie schneidet2)Der EMA 200 oberhalb der letzten Kerze liegt3)Die letzte Kerze ist BärischIn diesem Fall wird bei der nächsten Kerze verkauft.SL: Preis leicht oberhalb des Hochs der letzten gebildeten Kerze oder wenn der RSI die 40er Linie von unten kommend schneidet oder der RSI der aktuellen Kerze nach Schluss größer als die RSI der Kerze davorTP: Wenn der RSI die 30er Linie von unten kommend schneidet.2.Long SetupBedingungen:Time Frame: 1HEMA 200: Unterhalb der Kerzen (Preis) => Bullische TendenzRSI 10: 60er LinieLong Signal wird generiert, wenn:1)beim Kerzen Schluss Preis, der RSI von unten kommend die 60er Linie schneidet2)Der EMA 200 unterhalb der letzten Kerze liegt3)Die letzte Kerze ist Bullisch In diesem Fall wird bei der nächsten Kerze gekauft.SL: Preis leicht unterhalb des Tiefs der letzten gebildeten Kerze oder wenn der RSI die 60er Linie von oben kommend schneidet oder der RSI der aktuellen Kerze nach Schluss kleiner als die RSI der Kerze davorTP: Wenn der RSI die 80er bzw. 70er Linie von oben kommend schneidet 6th June 2024
137 using c programming for mql4 1.Execution Pin Bar Criteria:•Ensure the opening and closing price are both at 75% above the high of the candle.•Ensure that the closing price is above or equal to the opening price 2.Indicators:•Calculate the SMAs (Simple Moving Averages) for 20,40, 50, and 200 periods.•. Bollinger Bands using default settings (20-period SMA).3.Ensure Entry Criteria:•Check if the pin bar’s close price is above the 200 SMA.•Verify that the lower Bollinger Band deviation is below the 50 SMA.•Confirm that the 20SMA is above the 40SMA and 50SMA.•Ensure the pin bar’s low goes below the lower Bollinger Band deviation and closes pin bar criteria.•Check if the pin bar’s close price is below the 50 SMA. •. Check if the pin bar’s low price is lower then previous two candles low price •. Use h1 timeframe only •. Long position only •. only one trade open at any one time 4.Risk Management and Position Sizing•Set a fixed risk of amount 50$ per trade 5.Stop Loss and Take Profit:•Place the stop loss 1 pip below the pin bar’s low.•Set the take profit at 10 times the distance from entry price 6th June 2024
138 generate the code for an mt4 expert advisor which implements an advanced trading strategy of your choice. Dont use beginner strategies like rsi, ema, macd or price action. 5th June 2024
139 DRAW GRID LINE ON PARTICULAR DISTANCE FOR AN EXAMPLE 10 PIPS TAKE BUY ENTRY WHEN CROSS 2 GRIDS ABOVE TAKE SELL ENTRY WHEN GOES BELOW 2 GRIDS WHEN BUY TRADES RUNNING AND SELL TRADE COMES CLOSE OPENED ORDER YOU GAVE CODE IN THAT ERROR COMES AS BELOW '>=' - operand expectedRAM.mq411232')' - unexpected tokenRAM.mq411239return value of 'OrderClose' should be checkedRAM.mq411610',' - syntax error, parameter missedRAM.mq412956',' - syntax error, parameter missedRAM.mq413357 5th June 2024
140 Optimized MQL4 Code for Metatrader Platform// Set lot sizedouble lotSize = 0.01;// Set HL colorscolor buyHLColor = Lime;color sellHLColor = Magenta;color stopHLColor = Yellow;color tpHLColor = Aqua;color slHLColor = Red;// Set EA parametersbool closeOnePair = false;double tpOnePair = 10;double slOnePair = 10;bool closeAllPairs = false;double tpAllPairs = 10;double slAllPairs = 10;bool tradeOnNewBar = false;int maxOrders = 10;int pipStep = 10;bool useLockBE = false;int lockBEStart = 30;int lockBETarget = 10;bool useTrailing = false;int trailingStart = 15;int trailingStop = 15;int trailingStep = 15;bool useMartingale = false;double lotExponent = 2.0;int maxOrder = 15;int martingalePipStep = 15;int atLayerFirst = 7; 5th June 2024

This module is another development of the ayondo Lab. The application has an experimental character. It is a version in an early beta variant. New versions will be rolled out shortly. We explicitly refer to the further notes on the use of artificial intelligence. In addition, we would like to draw your attention to the disclaimer, which you should note before using it. Should you use the tool, you do so at your own risk.


The module is provided for free and independent use, subject to the above disclaimer. It primarily serves demonstration purposes. On the one hand, to show what AI-enriched process flows are already capable of today. On the other hand, the community is to be motivated to extensively test the actual performance, in particular, to identify weak points and susceptibility to errors.

We put our developments at the service of the global trading community. Due to the rapid growth of this technology field, we assume that it is not immune to misappropriation. We try to live up to our responsibility and only use technology when we believe it is associated with added value for the user. Because AI is uncharted territory, we follow all developments very closely. Whether you use our tools or those of other providers, we recommend that you look into the providers' motivation of the respective services before using AI-supported processes. Under no circumstances adopt AI output be without quality assurance. This also applies to the tools we provide.

For program codes, such as so-called Expert Advisors, which supposedly rely on AI-driven processes, we can confirm through the experience of diverse test series that these cannot be classified in the Holy Grail category. Before purchasing a program code ("EA"), test it thoroughly. Be fundamentally cautious about over-optimized performance claims!

If you are interested in further developing this and other applications, please feel free to send us your suggestions and ideas. Should you generate program code via the MQL AI Wizard, feel free to share the results generated via it with us or the social trading community. Via the provided support forum (registration required) you can exchange ideas with like-minded people and share your experiences.

* * *

For a first no-obligation test output click here.

* * *