Tâche terminée
Temps d'exécution 2 jours
Spécifications
Hello,
I am new to MT4 and have tried to code an EA, it does not appear to work as I have coded it. I think I have gotten most of it but am missing a few steps.
As this is also a learning experience I want the detailed logic as to how the proposed code is to operate.
I want an EA to do the following -- the %b indicator, referenced below is defined in the test code attached.
If the Bid price is above the 200 period (close) average
and
the %b indicator is less than 20% for five consecutive time periods
buy the next Bar at Ask (market) (there should only be 1 position taken at a time).
If in long position and the %b indicator is greater than 80% (only 1 period needed) then close (sell long) at Bid.
//+------------------------------------------------------------------+ //| ETF #2 %b.mq4 | //| Copyright © 2011, NMD | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, NMD" #property link "" #include <stdlib.mqh> //External Parameters extern int MagicNumber = 123; extern int MAPeriod = 200; extern int Bands_period = 20; extern double Bands_deviation = 2; //---- buffers double PercentBB[]; //Global variables int BuyTicket; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { if(Bars<200) { Alert("Not enough bars"); return; } int counted_bars = IndicatorCounted(); //---- double LB, UB; int limit; if(counted_bars > 0) counted_bars--; limit = Bars - counted_bars - 1; for(int i = 0; i < limit; i++){ LB = iBands(NULL, 0, Bands_period, Bands_deviation, 0, PRICE_CLOSE, MODE_LOWER, i); UB = iBands(NULL, 0, Bands_period, Bands_deviation, 0, PRICE_CLOSE, MODE_UPPER, i); if(UB-LB>0) { PercentBB[i] = (iClose(NULL, 0, i) - LB)/(UB - LB) * 100; } } //---- int c=0; while(PercentBB[i]<10) { c++; if(c==3) break; } //Moving Averages double SlowMA = iMA(NULL,0,MAPeriod,0,0,0,0); // Buy Order if(Bid>SlowMA && BuyTicket == 0 && c==3) // Open buy order { BuyTicket=OrderSend(Symbol(),OP_BUY,.01,Ask,5,0,0,"Buy Order",MagicNumber,0,Green); } //Order Close if(PercentBB[i]>80) { OrderSelect(BuyTicket,SELECT_BY_TICKET); } //Close order if(OrderCloseTime() == 0 && BuyTicket > 0) { double CloseLots = OrderLots(); double ClosePrice = Bid; bool Closed = OrderClose(BuyTicket,.01,ClosePrice,5,Red); } return(0); } //+------------------------------------------------------------------+
Répondu
1
Évaluation
Projets
1139
44%
Arbitrage
51
31%
/
33%
En retard
501
44%
Gratuit
2
Évaluation
Projets
257
53%
Arbitrage
16
50%
/
38%
En retard
83
32%
Gratuit
3
Évaluation
Projets
124
34%
Arbitrage
32
13%
/
75%
En retard
53
43%
Gratuit
Commandes similaires
Custom metatrader 5 expect advise for daily trader
30 - 100 USD
Entry Strategy: Explain exact conditions for opening a trade specific indicators like Moving Averages or RSI, time of day, or price action rules. Exit Strategy: Define when a trade should closeTake Profit, Stop Loss, Trailing Stop, or indicator signals. Daily Trading Rules: Specify daily limits if applicable maximum trades per day, specific trading hours, or maximum daily loss limit. Risk & Position Sizing: Indicate
Creating my own robot trading
30+ USD
I want to create my own trading robot that will automatically open and close trades,it's must be operating 24/7 on both the brokers app and the mt5 as well.it must be able to grow small accounts from 10 usd with proper risk management and smart executions.it must operates on the following brokers EXNESS, XM GLOBAL,WELTRADE and DERIV
I’m looking for a **ready-made MT5 scalping EA specifically for Gold (XAUUSD)**. My main requirement is an **HTF scalping strategy**, so I’m looking for an existing robot that is already developed and can be tested before I make the purchase. I would like to test on demo account first, Any available backtest or trading results * Whether I can test it on a demo account * Your price and licensing details I’m
Request for an Existing Automated Trading System (Expert Advisor) I am looking to acquire an existing, fully functional Expert Advisor (EA) that trades Forex CFDs, with the option of trading other CFDs if the strategy supports them safely. Performance objectives Target average net monthly return: 1.5%. A consistent 1.0% monthly return may be considered if the system demonstrates strong risk control and credible
Hi All, I am looking for a bot EA which makes good profit. If any having please share it for TEST. After proper TESTING only I will make the payment, no cheating no fraud. Please do not waste the time also
Allow me to set the daily trading bias manually to BUY or SELL. Check my defined 4H and 1H trend-alignment conditions. Execute entries based on my 15-minute pullback and continuation rules. Trade only between 06:00 and 16:00 Nigeria time, Monday to Friday. Calculate lot size based on my chosen risk percentage and stop-loss distance. Automatically place stop-loss and take-profit orders. Enforce my daily trade limits
QUANTOWER DEVELOPER NEEDS
60+ USD
hi, I need a quantower script I need a trailing stop at the 20 ema, And a more complicated version would be a breakout of the Asian session and a retest of the 9ema for an entry and a training stop at the 20 ema
Hi, I’m looking for a **ready-made MT5 scalping EA specifically for Gold (XAUUSD)**. My main requirement is an **HTF scalping strategy**, so I’m looking for an existing robot that is already developed and can be tested before I make the purchase. I’m not looking to build one from scratch at this stage. I would like to first test the EA on a **demo account** to see how it performs under live market conditions and
Rebate robot
30 - 100 USD
Need rebate robot,for pairs like gbpusd,eurusd,usdjpy,usdchf,Spreads are like around 2.5 pip,MAy be better hedge ea both buy and sell,i will get benifit just from rebate,so try ur best to do what i want,and if u r not expert plz go away plz its not simple job,if u already have the robot so i can test it will be surely selected,also u can get some benifit from this screen shoots that i attached,its from another job in
We are looking for an experienced MQL5 developer or algorithmic trader who already owns a fully developed, functional, and profitable Expert Advisor (EA) specifically designed or successfully tested for Prop Firm trading. We are not looking for someone to develop a new trading robot from scratch. Our priority is to collaborate with someone who already has an operational trading system with a proven track record
Informations sur le projet
Budget
25 USD