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
521 okay so on symbol BTCUSD and time frame 5 min I want to buy once price is above 200 ema and the low of a candle is below the 200 ema but the close is above the 200 ema then place a buy trade on the next bullish candle. And for a sell trade once price is below 200 ema and the high of a candle is above the 200 ema but the close is below the 200 ema then place a sell trade on the next bearish candle 26th February 2024
522 create two buffers 26th February 2024
523 parapol sar multi timeframe 25th February 2024
524 create a full functioning EA following this instruction :Donchian channel consists of three lines, which are generated by the moving average calculations that comprise an indicator formed by the upper and the lower band, also the median band. The celebrity trader Richard Donchian developed the indicator in the mid-twentieth century so that he can identify the trend of the market. The area between the upper and lower band represents the Donchian channel. The indicator identifies the bullish and bearish extremes areas, which are followed by the reversals or breakouts in price action. As you can see in the below image of the USDJPY forex pair, overall, the instrument is in a strong uptrend, and when the price action hits the lower band of Donchian channel it indicates the buy trade, and when it hits the upper Donchian channel, it means to go for a short trade.In the below image the price action gives us three buying and three selling trade, most of the time the buying trades perform bit longer than the selling trades, it is because the flow of the market was up, but for the scalpers, the flow doesn’t matter, all the scalpers want is to in and out from the market. Close your position when the price action hits the opposite channel, and when you take the entry, if the price action goes a bit against you { for, e.g., 4 to 5 }, then close your position immediately and wait for the new signal.The below image represents a couple of buying and selling trades in a downtrend. The goal of every scalper is to, first of all, check the trend of the market, and expect more trades by following the trend and simply expect less counter-trend trades. You can see that the below image of the GBPNZD forex pair shows us the nine selling and six buying trades. Most of the selling and buying trades worked very well, and each trade generates a significant amount of money for us. The whole goal is to activate the position when the price action hits the Donchian channel and close your positi 25th February 2024
525 One moving average will be used in this EA. buy trend if the candles are above the moving average and sell trend if the candles are below the moving average.EA will use moving average only for the first trade, all future trades will be based on the first trade, for example, there was a buy trend.So for example we have set distance 10 pips for next trade in case it goes up 10 pips then it will take another buy trade similarly if the market goes 10 pips more up then it will take another trade.And the trades that we have put in the maximum trades in option EA will take that number of trades on one side and if after opening the buy trade the market is on the down side before hitting the TP.So the distance we have put in option between the buy and sell, for example we have set 20 pips in option, if the market goes down 20 pips more than the first buy trade.In this case the EA will open a sell trade and if we have 4 buy trades opened then EA will open 8 trades in the sell every 10.10 pips.Similarly, if the market goes up again before the TP is hit, then as many trades as we have in the sell , EA will open their double trades in buy.For example, we had 4 buy trades and 7 sell trades, now if the market goes back to buy, there should be a total of 14 trades open in buy, out of which we have 4 trades open.And the market goes above the top buy then every 10 ,10 pips distance will open 10 more buy trades and so on when the TP in amount we have placed is reachedAll Buy and sell trades will be closed at one time by taking the loss of all losing trades,In this EA the load size will be fixed for example if we set 0.01 then all trades will be 0.01 and similarly if we set 0.10 then all trades will be 0.10In EA, these options will be load size,movie average setting, TP in amount, next trade distance, buy and sell distance, close button and also magic number and dashboard option where all the results of trading will be displayed. 25th February 2024
526 write trading startegy code: When Moving average 20 crosses above moving average 8, set a buy trade 0.00050 pips above current price, set take profit at 0.00100 pips above buy trade and vice versa for a sell trade. 25th February 2024
527 Ea with ema anf open postion on cci level 25th February 2024
528 The mql4 code below is for ordertype sell trade. Convert code for ordertype buy trade.for( int i=OrdersTotal()-1; i>=0; i-- ) { if (OrderSelect(i, SELECT_BY_POS) == true) { if (OrderType() == OP_SELL 24th February 2024
529 code for mql4.if OrderProfit() of open buy trades < 0put OrderProfit() value in variable 'buy_loss'.If the loss of open buy trades increasesfrom the previous value,find the difference between the new valueand the old value and put result in variable'buy_diff' variable. 24th February 2024
530 Make me an mql4 expert that opens and pullback to the close of the first candle open a position in the direction of the first candle in m5 time firmsIt will only open a trade with one percent of balance (we calculate volume like this if our account 10000$ one percent of account is 100$ and if our stop loss is 25pip we calculate volume like this 100$/25pip=4/10=0.410 is a fix number and one percent is a fix number too and the amount of stop loss is variable this example stop loss is 25 pip)and set stop loss between 25 pip~35 pip and take profit between 60~75 pip and until this trade is not closed do not open another transaction, and when the previous transaction is closed, it can open another position.the stop loss and take profit rules are observed in this code, but according to the strategy that I said ,after close of the first candle,a trade should be opened for one minute in the direction of the first candle,and it is allowed to open until the first position is closed and the result of the first position is not determined. positioning is not open any more 24th February 2024
531 Build an expert advisor in MQL5 language, with the following specifications:Every day from sunday through thursday at 23:06 the system places 7 trades on the following currency pairs: AUDUSD, EURUSD, GBPUSD, NZDUSD, UDCAD, USDCHF, USDJPY.Each one of the 7 trades has the same following specifications:- Buy limit trade- 1 lot- Price: the open price of the trading day- Take profit 10.7 pips- Stop loss: 60 pips- expiration 8am of the following calendar dayEach day from Monday through Friday at 22:00 all open positions must be closed at market 24th February 2024
532 Calculation:In the OnCalculate function, it iterates over each bar (candle) from the past to the present.It calculates the difference between the current close and the previous close (closeDiff).If closeDiff is greater than a positive threshold (0.0001), a green up arrow (Buy signal) is created below the low price.If closeDiff is less than a negative threshold (-0.0001), a red down arrow (Sell signal) is created above the high price.Current Candle Check:The logic also checks the difference for the current (zero index) candle and generates an arrow accordingly. 24th February 2024
533 ea that can detect higher high, lower low, higher low, lower high. after finding those if uptrend and price close below last higher low, then make a sell position with sl above higher high and tp=(r:R 1:1). if downtrend and price close above last lower high, then make a buy position with sl below lower low and tp(1:1) 24th February 2024
534 i am using meta trader 4. I have an include file called orders.mqh. it has a function and a global variable called globalbuysignal in the function. When I try to compile I get an undeclared identifier for the globalbuysignal. Globalbuysignal is a global variable in my expert advisor(EA) that is using this include file orders.mqh. How can i get the orders.mqh file to compile under this scenario. Please give an example code in the meta trader 4 programming language.. Do not suggest to Declare globalbuysignal as an external variable in the order.mqh as an error in the EA says.. 'globalbuysignal' - variable already defined 23rd February 2024
535 There will be a moving average in EA, if Candles are on the upper side of the moving average, then it will be considered a buy and if it is on the lower side, then it will be considered a sell. If there is a buy, the sale will be open after the distance we have set, for example, if we have set 20 pips, then when the market goes 20 pips against the trade, then sell in case of buy and buy in case of sale. It will open it will take double trade of the last trade, for example if the first trade was a buy and the trade was open at 0.01, now if the market has moved down 20 pips from this buy, then a sale of 0.02 will be opened. Then it will wait when the buy loss is removed and the sell trade is giving as much profit as we have set in the amount as TP, then both the buy and sell will be closed. For example, there was a buy 0.01 , 20 pips down, then the market opens 0.02 sell, then goes up, then it goes up by 10 more than the buy that was opened at 0.01, then a buy of 0.03 is placed, and so on. If it goes to 10 , then it will go down, in this case, the trade of 0.04 sell will be open. The EA will start the trade immediately, the EA will not wait for new candle, the TP will be in amount this EA, the moving average setting will be , the buy and sell distance, the next trade distance , there will be the option of comments and the buy and The sell will be average close , for example, The buy was open by 20 more, then the sell will be open, in this case, the buy will also remain open when the sell is giving such a profit that after taking out the loss of the buy, which is set by TP. All trades will be closed if we find out what we set in TP. The lot edition will be like this: 1st trade 0.01 buy, 2nd trade 0.02 sell, 3rd trade 0.03 buy, 4th trade 0.04 sell, the trade will continue like this. 23rd February 2024
536 parabolic sar with tp 50, sl 50, pending order with distance 100 23rd February 2024
537 mql4. if sum of orderprofit of open sell trades < 0MathAbs open sell orderprofit and store result intovariable 'open_sell_loss'.If value in 'open_sell_loss' changes to a higher valuesubtract the previous value from the new value.Store result in variable 'diff'.If sum of orderprofit of open sell trades > 0'open_sell_loss' =0. 22nd February 2024
538 mql4 code.1. Create 'Total_sell_loss' variable.2. Create 'New_lots' variable.3. Create variable 'sell_diff'.4. 'Total_sell_loss' variable = open loss of open losing sell trades added together.5. If the loss in 'Total_sell_loss' value increases find the difference between the new value and the previous value.6. 'sell_diff' = difference between the new value and the previous value of 'Total_sell_loss'.7. 'New_lots' variable = 'sell_diff' / extern 'Take_Profit' variable / 10. 22nd February 2024
539 Sell when price is below bollinger band. Buy when price is above bollinger band 21st February 2024
540 write a script using MQL to check licenses 21st February 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.

* * *