I need an MQL5 version of my MQL4 EA

MQL5 Uzmanlar

İş tamamlandı

Tamamlanma süresi: 29 gün

Şartname

I have wirtten a simple ea for mt4 which reads a file an executes an order. Now I need this ea for mt5.

The structure of the file is:

2012.10.25 09:00;EURUSD;LL;0.01;1.4200;2;0.003500;0.005500;0.005500;Runner ;12345;

ORDERTIME;Symbol;ORDERTYPE;Volume;Price ;Slippage;StopBreakEven;StopLoss;TakeProfit;Comment;MagicNumber;

ORDERTIME: Is used to detect outdated orders; Format 'YYYY.MM.DD HH:MM'.

ORDERTYPE: LL : Long Limit
           LM : Long Entry
           LS : Long Stop
           SL : Short Limit
           SM : Short Market
           SS : Short Stop
           XX : Exit Any 

Here is part of the code which has to be translated:

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
void start()
{
  string   Buffer;
  string   FileNameX = FileName + "(X)";
  int      Handle;
 
  string   Order_Comment = NULL;
  datetime Order_Expiration = NULL;
  double   Order_Lots = NULL;
  int      Order_MagicNumber = NULL;
  double   Order_Price = NULL;
  int      Order_Slippage = NULL;
  double   Order_StopBreakEven = NULL;
  double   Order_StopLoss = NULL;
  string   Order_Symbol = NULL;
  datetime Order_OpenTime = NULL;
  double   Order_TakeProfit = NULL;
  int      Order_Ticket = NULL;
  int      Order_Type = NULL;
 
  Buffer = "";
 
  if ( FileCode == "ASCII" )
  {
    Handle = FileOpen( FileName, FILE_BIN|FILE_READ );
    if ( ! ( Handle > 0 ) ) return;
   
    if ( FileSize( Handle ) > 0 ) Buffer = FileReadString( Handle, FileSize( Handle ) );
   
    FileClose( Handle );
  }
 
  if ( FileCode == "UNICODE" )
  {
    Buffer = ReadFile( TerminalPath() + "\\experts\\files\\" + FileName );
   
    Buffer = StringSubstr( Buffer, 2 );
  }
 
  if ( Buffer == "" ) return;
 
  Handle = FileOpen( FileNameX, FILE_BIN|FILE_WRITE );
  FileWriteString( Handle, Buffer, StringLen( Buffer ) );
  FileClose( Handle );
 
  if ( ( Period() * 60 ) > 600 ) Order_Expiration = Time[ 0 ] + Period() * 60;
 
  Handle = FileOpen( FileNameX, FILE_CSV|FILE_READ, ';' );
  if ( ! ( Handle > 0 ) ) return;
 
  if ( FileSize( Handle ) == NULL ) { FileClose( Handle ); return; }
 
  Order_OpenTime = StrToTime( StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) ) );
 
  Order_Symbol = StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) );
 
  Order_Type = IO;
  Buffer = StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) );
  if ( Buffer == "LL" ) Order_Type = LL;
  if ( Buffer == "LM" ) Order_Type = LM;
  if ( Buffer == "LS" ) Order_Type = LS;
  if ( Buffer == "SL" ) Order_Type = SL;
  if ( Buffer == "SM" ) Order_Type = SM;
  if ( Buffer == "SS" ) Order_Type = SS;
  if ( Buffer == "XX" ) Order_Type = XX;
 
  Order_Lots = StrToDouble( StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) ) );
  if ( MarketInfo( Symbol(), MODE_LOTSTEP ) == 0.1 ) Order_Lots = NormalizeDouble( Order_Lots, 1 );
 
  Order_Price = StrToDouble( StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) ) );
 
  Order_Slippage = StrToInteger( StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) ) );
 
  Order_StopBreakEven = StrToDouble( StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) ) );
 
  Order_StopLoss = StrToDouble( StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) ) );
 
  Order_TakeProfit = StrToDouble( StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) ) );
 
  Order_Comment = StringTrimRight( StringTrimLeft( StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) ) ) );
 
  Order_MagicNumber = StrToInteger( StringTrimRight( StringTrimLeft( FileReadString( Handle ) ) ) );
 
  FileClose( Handle );
 
  if ( ( TimeOut > 0 ) && ( Order_OpenTime < ( TimeCurrent() + TimeOffset * 60 - TimeOut * 60 ) ) )
  {
    Handle = FileOpen( FileNameX, FILE_BIN|FILE_READ );
    LogEvent( LOGERROR, "TimeOut: " + FileReadString( Handle, FileSize( Handle ) ) );
    FileClose( Handle );
   
    return;
  }
 
  for ( int Order = OrdersTotal(); Order > 0; Order-- )
  {
    if ( OrderSelect( ( Order - 1 ), SELECT_BY_POS, MODE_TRADES ) != true ) continue;
    if ( OrderSymbol() != Symbol() ) continue;
   
    if ( ( Order_MagicNumber == NULL ) || ( Order_MagicNumber == OrderMagicNumber() ) ) { Order_Ticket = OrderTicket(); break; }
  }
 
  switch ( Order_Type )
  {
    case LL: Order_Ticket = ResetOrder( Order_Ticket, OP_BUYLIMIT, Order_Slippage );
            
             if ( Order_Price == NULL ) Order_Price = Ask;
            
             if ( CurrentEntries( Order_MagicNumber ) < PositionMax )
               Order_Ticket = SendOrder( OP_BUYLIMIT, Order_Lots, Order_Price, NULL, Order_Comment, Order_MagicNumber, Order_Expiration );
            
             if ( OrderSelect( Order_Ticket, SELECT_BY_TICKET ) != true ) break;
            
             // ???
             Order_Ticket = ModifyOrder( Order_Ticket, ( Order_Price - Order_StopLoss ), ( Order_Price + Order_TakeProfit ) );
            
             break;
            
    case LM: Order_Ticket = ResetOrder( Order_Ticket, OP_BUY, Order_Slippage );
            
             if ( CurrentEntries( Order_MagicNumber ) < PositionMax )
               Order_Ticket = SendOrder( OP_BUY, Order_Lots, Order_Price, Order_Slippage, Order_Comment, Order_MagicNumber, NULL );
            
             if ( OrderSelect( Order_Ticket, SELECT_BY_TICKET ) != true ) break;
            
             if ( ( ( Order_StopLoss > 0 ) && ( OrderStopLoss() == NULL ) ) || ( ( Order_TakeProfit > 0 ) && ( OrderTakeProfit() == NULL ) ) )
             {
               if ( Order_StopLoss > 0 ) Order_StopLoss = OrderOpenPrice() - Order_StopLoss; else Order_StopLoss = OrderStopLoss();
               if ( Order_TakeProfit > 0 ) Order_TakeProfit = OrderOpenPrice() + Order_TakeProfit; else Order_TakeProfit = OrderTakeProfit();
               Order_Ticket = ModifyOrder( Order_Ticket, Order_StopLoss, Order_TakeProfit );
             }
            
             if ( ( Order_StopBreakEven > 0 ) && ( Bid > ( OrderOpenPrice() + Order_StopBreakEven ) ) )
               Order_Ticket = ModifyOrder( Order_Ticket, OrderOpenPrice(), OrderTakeProfit() );
            
             break;
            
    case LS: Order_Ticket = ResetOrder( Order_Ticket, OP_BUYSTOP, Order_Slippage );
            
             if ( Order_Price == NULL ) Order_Price = Ask;
            
             if ( CurrentEntries( Order_MagicNumber ) < PositionMax )
               Order_Ticket = SendOrder( OP_BUYSTOP, Order_Lots, Order_Price, NULL, Order_Comment, Order_MagicNumber, Order_Expiration );
            
             if ( OrderSelect( Order_Ticket, SELECT_BY_TICKET ) != true ) break;
            
             // ???
             Order_Ticket = ModifyOrder( Order_Ticket, ( Order_Price - Order_StopLoss ), ( Order_Price + Order_TakeProfit ) );
            
             break;
            
    case SL: Order_Ticket = ResetOrder( Order_Ticket, OP_SELLLIMIT, Order_Slippage );
            
             if ( Order_Price == NULL ) Order_Price = Bid;
            
             if ( CurrentEntries( Order_MagicNumber ) < PositionMax )
               Order_Ticket = SendOrder( OP_SELLLIMIT, Order_Lots, Order_Price, NULL, Order_Comment, Order_MagicNumber, Order_Expiration );
            
             if ( OrderSelect( Order_Ticket, SELECT_BY_TICKET ) != true ) break;
            
             // ???
             Order_Ticket = ModifyOrder( Order_Ticket, ( Order_Price + Order_StopLoss ), ( Order_Price - Order_TakeProfit ) );
            
             break;
            
    case SM: Order_Ticket = ResetOrder( Order_Ticket, OP_SELL, Order_Slippage );
            
             if ( CurrentEntries( Order_MagicNumber ) < PositionMax )
               Order_Ticket = SendOrder( OP_SELL, Order_Lots, Order_Price, Order_Slippage, Order_Comment, Order_MagicNumber, NULL );
            
             if ( OrderSelect( Order_Ticket, SELECT_BY_TICKET ) != true ) break;
            
             if ( ( ( Order_StopLoss > 0 ) && ( OrderStopLoss() == NULL ) ) || ( ( Order_TakeProfit > 0 ) && ( OrderTakeProfit() == NULL ) ) )
             {
               if ( Order_StopLoss > 0 ) Order_StopLoss = OrderOpenPrice() + Order_StopLoss; else Order_StopLoss = OrderStopLoss();
               if ( Order_TakeProfit > 0 ) Order_TakeProfit = OrderOpenPrice() - Order_TakeProfit; else Order_TakeProfit = OrderTakeProfit();
               Order_Ticket = ModifyOrder( Order_Ticket, Order_StopLoss, Order_TakeProfit );
             }
            
             if ( ( Order_StopBreakEven > 0 ) && ( Ask < ( OrderOpenPrice() - Order_StopBreakEven ) ) )
               Order_Ticket = ModifyOrder( Order_Ticket, OrderOpenPrice(), OrderTakeProfit() );
            
             break;
            
    case SS: Order_Ticket = ResetOrder( Order_Ticket, OP_SELLSTOP, Order_Slippage );
            
             if ( Order_Price == NULL ) Order_Price = Bid;
            
             if ( CurrentEntries( Order_MagicNumber ) < PositionMax )
               Order_Ticket = SendOrder( OP_SELLSTOP, Order_Lots, Order_Price, NULL, Order_Comment, Order_MagicNumber, Order_Expiration );
            
             if ( OrderSelect( Order_Ticket, SELECT_BY_TICKET ) != true ) break;
            
             // ???
             Order_Ticket = ModifyOrder( Order_Ticket, ( Order_Price + Order_StopLoss ), ( Order_Price - Order_TakeProfit ) );
            
             break;
            
    case XX: Order_Ticket = ResetOrder( Order_Ticket, -1, Order_Slippage );
            
             break;
            
    default: Handle = FileOpen( FileNameX, FILE_BIN|FILE_READ );
             LogEvent( LOGERROR, "Invalid OrderType: " + FileReadString( Handle, FileSize( Handle ) ) );
             FileClose( Handle );
  }
 
  if ( Debug )
  {
    Handle = FileOpen( FileNameX, FILE_BIN|FILE_READ );
    LogEvent( LOGDEBUG, "FileSize = " + FileSize( Handle ) + "; '" + FileReadString( Handle, FileSize( Handle ) ) );
    FileClose( Handle );
  }
}

 

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(337)
Projeler
624
38%
Arabuluculuk
40
23% / 65%
Süresi dolmuş
93
15%
Serbest
Yayınlandı: 4 makale, 19 kod
2
Geliştirici 2
Derecelendirme
(59)
Projeler
182
55%
Arabuluculuk
31
45% / 16%
Süresi dolmuş
103
57%
Serbest
3
Geliştirici 3
Derecelendirme
(215)
Projeler
302
79%
Arabuluculuk
4
25% / 0%
Süresi dolmuş
62
21%
Serbest
Yayınlandı: 7 kod
4
Geliştirici 4
Derecelendirme
(90)
Projeler
159
61%
Arabuluculuk
40
18% / 63%
Süresi dolmuş
70
44%
Serbest
5
Geliştirici 5
Derecelendirme
(73)
Projeler
257
53%
Arabuluculuk
16
50% / 38%
Süresi dolmuş
83
32%
Serbest
6
Geliştirici 6
Derecelendirme
(47)
Projeler
140
49%
Arabuluculuk
9
56% / 0%
Süresi dolmuş
27
19%
Serbest
7
Geliştirici 7
Derecelendirme
(18)
Projeler
37
43%
Arabuluculuk
6
17% / 50%
Süresi dolmuş
17
46%
Serbest
8
Geliştirici 8
Derecelendirme
(1235)
Projeler
2820
80%
Arabuluculuk
156
22% / 43%
Süresi dolmuş
487
17%
Serbest
Benzer siparişler
Experienced Trading Software Developer Needed – Multi-Platform Development Hello! I'm looking for an experienced developer to create a custom trading indicator and convert it into an automated trading bot for the following platforms: MT5 NinjaTrader 8 Quantower cTrader The plan is to develop the same indicator and trading bot for all four platforms, one after another. Project requirements: Custom trading indicator
un écosystème logiciel asynchrone multi-comptes dopé par un module de supervision par Intelligence Artificielle (Guardian AI). La solution assure le pilotage automatisé, le filtrage de marché en temps réel et le contrôle des risques pour 20+ comptes MetaTrader 4/5 (via MetaApi) et Deriv sur VPS Equinix NY4. vous aurez plus de detail dans les échanges
Order flow 30+ USD
Hi! I need an experience developer with order flow, volume delta, and futures scalping, and I wanted to ask you a few questions. Have you personally developed and tested fast-paced strategies for Gold Futures (GC), particularly those that enter during short-term price impulses and scale into positions as momentum builds? From your experience, what indicators or signals help you determine whether an impulse has enough
I am looking for an experienced MQL5 developer for the first milestone of a larger MetaTrader 5 project: a multi-symbol, multi-timeframe signal scanner with alerts. This milestone covers indicator integration only. There is no order placement or trade management at any stage. Scope of this milestone Read outputs from three custom indicators (provided as compiled files after selection and NDA) reliably via iCustom and
RA_BOT 2.0 36+ USD
//@version=4 study(title="UT Bot Alerts", overlay = true) // Inputs a = input(1, title = "Key Vaule. 'This changes the sensitivity'") c = input(10, title = "ATR Period") h = input(false, title = "Signals from Heikin Ashi Candles") xATR = atr(c) nLoss = a * xATR src = h ? security(heikinashi(syminfo.tickerid), timeframe.period, close, lookahead = false) : close xATRTrailingStop = 0.0 xATRTrailingStop := iff(src >
Andrew 50 - 200 USD
Hello, I am from Tanzania. I am looking for a professional MQL5 programmer from Tanzania who can help me develop and improve my automated MT5 trading robot. The project is called SMC XAVAGE AI, and it trades XAUUSD (Gold). I would like to discuss the project with you. Are you based in Tanzania? Would it be possible to arrange a meeting or a call? Thank you
Metafix 50 - 200 USD
Here is a professional specification you can send directly to your developer. # Project Requirements Specification: MetaTrader 5 Trading Robot Development ### 1. Project Overview I want to develop an automated Forex trading robot (Expert Advisor) for MetaTrader 5 (MT5). The robot should analyse the financial markets, identify trading opportunities, and execute trades automatically based on predefined strategies. ###
1. Platform: MT4 The EA required is not linked, neither depending on trading strategy nor trading signals nor indicators. 2. Initial order is a pending order (buy stop/ sell stop) and it is created manually. It is open for a specified symbol (pair) at a specified price with a specified S/L 3. Example: buy stop 0.1 lot GBPUSD @ 1.3085 WITH S/L @1.3075 Once target price is reached, pending order will
I am looking for an experienced trading software developer interested in building a long-term working relationship. Im a professional Trader, Coach and Mentor, I work with traders and Student who require customized trading solutions, including automated trading bots, Expert Advisors, custom indicators, trading strategies and other algorithmic trading tools. I am looking for a technically skilled developer who can
Salman serhal 30 - 100 USD
MT5 ICT XAUUSD Sell-Only Trading Robot with Fibonacci Confirmation I am looking for an experienced MQL5 developer to create a custom Expert Advisor (EA) for MetaTrader 5, specifically for trading Gold (XAUUSD). 1. Trading Strategy The robot must use the ICT trading methodology and focus on SELL trades only. The strategy should include: * Identify important resistance and premium zones. * Use Fibonacci retracement

Proje bilgisi

Bütçe