Nmd

エキスパート

仕事が完了した

実行時間2 日

指定

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);
  }
//+------------------------------------------------------------------+

 

応答済み

1
開発者 1
評価
(473)
プロジェクト
1138
44%
仲裁
51
31% / 33%
期限切れ
500
44%
2
開発者 2
評価
(71)
プロジェクト
254
53%
仲裁
16
50% / 38%
期限切れ
83
33%
3
開発者 3
評価
(41)
プロジェクト
124
34%
仲裁
32
13% / 75%
期限切れ
53
43%
類似した注文
Hi, I have a Live Data feature for my trading accounts that lets me check details like total open positions, number of lots, profits, etc. I need someone to add the number of pending orders to this live data. This is important for me to ensure that all accounts have the same number of pending orders, since I use a copy trading system. Also, there is a website where I check all the data. In this case, you would need
OK I just need 1 MOD Who can do it free There is a (Reciever EA) that receives signals from a (Sender EA) I need to ADD one mod It may even look like the option/signal is there= Ignore it Coding was wrong on that part This is simple The option in the Reicver EA will Be called "Open Copy Live" with the option to Set to True or False When set to true the Reicver EA will Watch
Hi there, I need a very highly skilled mt4 programmer to code and design an EA from scratch. The logic of the EA will be discussed with you in comments section, only reach out if you can code perfectly for mt4 using MQL4 coding solutions language, EA must be able to run well without any problems and work according to the logic thanks
I came across an indicator that's perfectly good in catching spikes in boom amd crash but i would want it to be modified and to improve accuracy As a professional you will have to go through the indicator and explain to me the strategy with which the indicator was buid and tell me the possibility of improving it better
### Summary of EA Requirements 1. **Time Period**: - The EA should operate on the H4 timeframe. 2. **RelicusRoad MACD v2 Indicator**: - **Parameters**: - Fast EMA Period: 12 - Fast EMA Type: Close price - Slow EMA Period: 24 - Slow EMA Type: Close price - Signal SMA Period: 9 - The EA should use this indicator to determine the crossover condition between the MACD line and the signal line. 3
An EA that executes when the 21 and 55 SMA Cross on certain time frame also the EA will understand supply and demand levels and executes when price reacts on this levels specified and target/stoploss levels will be predetermined...also the robot will also comprise stochastic oscillator
Ind V5 TV Strategy Requirements: Instruments: Forex pairs, Crypto and Stocks across exchanges TimeFrame: Multi-Time Frame comparisons, details below Indicators: Ichimoku Cloud, ATR & Choppiness Index Trade times: First Order: Day of Week Start Time, Day of Week First Order time, Day of Week Last Order Time and Day of Week Square Off Time Intraday TF: 1 min, 3 mins, 9 mins, 27 mins and 81 mins Position Size (Lots)
I want this EA in mql4. The two indicators are written in pinescript Developer should please understand it to develop the EA. One of the indicator will be used as direction and the other for entry. The should have code that it can be used for( only one PC and an expiration date. ; this the developer should show me how to adjust it, so that I can adjust to my preference). Parameters:number of trades.lotsize, SL pips
I need a robot for forex trading~~The way the robot should work is that when I put it into a 5 minute chart, the chart will show 15 minutes, one hour, Regardless of whether they are buying or selling, they must buy or sell in the same color at the same time~~~ Use the following indicators: HalfTrend 1 & alerts mtf Trafficlight indicator.MQ4 When placed into a 5 minute chart ~ the chart will show 15 minutes, one
I am looking for a programmer to do EA trader. If you can understand what I want from the video i do and you can do it, contact me because you will be able to do what I want. https://drive.google.com/file/d/1wbHxbUQQqCkdpr0-pHfIh2b288LzYTV2/view?usp=sharing maximum budget = 150$ Preference is given to someone who: -speaks Arabic so I can explain it clearly to him - And the lowest price

プロジェクト情報

予算
25 USD
開発者用
22.5 - 22.5 USD