Группа "Стол заказов MQL"

Рейтинг 2155



РЕКОМЕНДУЮ



Please translate this simple mt5 ea to mt4

trading tycoon final.mq5 (3 Kb)

Hi,

Please translate this simple MT5 ea to MT4.

Thanks
  • 0
  • Просмотров: 863
  • 21 декабря 2023, 16:50
  • chomper
Понравилcя материал? Не забудьте поставить плюс и поделиться в социальной сети!

Вступите в группу "Стол заказов MQL", чтобы следить за обновлениями
ПРИСОЕДИНИТЬСЯ К ГРУППЕ
присоединиться
  Предыдущая запись в группе
Доработка индикатора.
Следующая запись в группе  
Улучшение советника DoubleSetka
20 декабря 2023
25 декабря 2023

Брокер для ваших роботов, 15 лет на рынке

Комментарии (2)

0
у вас нерабочий код. не выполняется вот это условие:


if(iHigh(symb, 0, 1) > previousHigh && iLow(symb, 0, 1) < previousLow)


из за этого советник не торгует.

немного подправил, переписал в МТ4, но все равно непонятно для чего все это.


//+------------------------------------------------------------------+
//|               Professional Trader Lab EA by profnas100           |
//|                  Trading during London Session                   |
//|                        Copyright 2023, profnas100                |
//+------------------------------------------------------------------+

// Define variables
double previousHigh, previousLow, fairValueGap;
int targetPips = 20;

// Define London session start and end times in broker server time
input
string symb = "EURUSD";
input
string londonSessionStart = "08:00"; // Adjust the time based on your broker's server time
input
string londonSessionEnd = "16:00";   // Adjust the time based on your broker's server time

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
 
{
// Print a message when the EA is initialized
   
Print("Professional Trader Lab EA initialized");

// EA initialization logic, if any
   
return(INIT_SUCCEEDED);
 
}

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
 
{
// Check if the current time is within the London session
   
//if(TimeCurrent() >= StringToTime(londonSessionStart) && TimeCurrent() <= StringToTime(londonSessionEnd))
     
{
     
// Get previous M15 high and low
      previousHigh
= iHigh(symb, 0, 2);
      previousLow
= iLow(symb, 0, 2);

     
// Calculate fair value gap
      fairValueGap
= (previousHigh + previousLow) / 2;

     
// Check for a market structure shift
     
if(iHigh(symb, 0, 1) > previousHigh && iLow(symb, 0, 1) < previousLow)
       
{
         
// Buy condition: Previous M15 high taken out
         
if(iHigh(symb, 0, 0) > previousHigh)
           
{
           
// Implement your entry logic here
           
// For example, enter a long trade at the fair-value gap
           
double stopLossLevel = fairValueGap - 10 * SymbolInfoDouble(symb, SYMBOL_POINT);
           
}
         
// Sell condition: Previous M15 low taken out
         
else
           
if(iLow(symb, 0, 0) < previousLow)
             
{
               
// Implement your entry logic here
               
// For example, enter a short trade at the fair-value gap
               stopLossLevel
= fairValueGap + 10 * SymbolInfoDouble(symb, SYMBOL_POINT);
               
int r=OrderSend(NULL,OP_BUY,0.1,Ask,33,stopLossLevel-10*Point(),stopLossLevel+20*_Point,"",0,0,Green);
             
}
       
}
     
}
 
}
//+------------------------------------------------------------------+
//|  Expert deinitialization function                                |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
 
{
// Print a message when the EA is deinitialized
   
Print("Professional Trader Lab EA deinitialized");

// EA deinitialization logic, if any
 
}
//+------------------------------------------------------------------+

avatar

  35  AM2 Сообщений: 16519 - Андрей

  • 21 декабря 2023, 18:09
0
Thank you. That is good enough. I will use the code you fixed for a new ea.

avatar

  16  chomper Автор Сообщений: 64

  • 21 декабря 2023, 18:11

Зарегистрируйтесь или авторизуйтесь, чтобы оставить комментарий
Загрузка...