Questions from Beginners MQL5 MT5 MetaTrader 5 - page 590

 
Alexey Volchanskiy:
I'm going for a walk, then I'll write the code for the geometric prog.

I'm not good at all, I should get 0.5.


#define  LEN 5 // задали длину последовательности
double  start_lot=0.1;//начальный лот
int lot_5 =5;// номер искомой позиции
int start()
{
    int d = lot_5;    // это разность, любое значение
    int a[LEN];   // тут храним ариф. посл.
    a[0] = start_lot;     // любое стартовое значение, задаете сами
    Print(0, " начальный лот ", a[0]);

    for (int n = 1; n < 4; n++)
    {
       a[n] = a[0] + (n*d);
       Print(n, " лот позы№5 ", a[n]);
    }
}
 
mila.com:

I'm not good at all, it should be 0.5.


0.5 for a woman's sake :))

I'll sendthe geometric tomorrow. And what you need to get, please write the input lot and the final value at once.

#define  LEN 5 // задали длину последовательности
double  start_lot=0.1;//начальный лот
double lot_5 = 0.1;   // это разность
int start()
{
    double a[LEN];   // тут храним ариф. посл.
    a[0] = start_lot;     // задаем стартовое значение 0.1
    Print(0, " начальный лот ", a[0]);

    for (int n = 1; n < LEN; n++)
    {
       a[n] = a[0] + (n*lot_5);
       Print(n, " лот позы №5 ", a[n]);
    }
}

2016.06.01 01:13:54.917 ChangeTimeFrame EURUSD.e,M1: 4 лот позы №5 0.5
2016.06.01 01:13:54.917 ChangeTimeFrame EURUSD.e,M1: 3 лот позы №5 0.4
2016.06.01 01:13:54.917 ChangeTimeFrame EURUSD.e,M1: 2 лот позы №5 0.3
2016.06.01 01:13:54.917 ChangeTimeFrame EURUSD.e,M1: 1 лот позы №5 0.2
2016.06.01 01:13:54.917 ChangeTimeFrame EURUSD.e,M1: 0 начальный лот 0.1
 
Alexey Volchanskiy:

0.5 for a woman's sake :)))

I'll send the geometric tomorrow. And there what you need to get, please write the input lot and the final value at once.

Thank you, perfect )

Yes, I also want to know the sum of lots of the future four positions + the starting lot, if possible.

Inputs for geometric:

_lot_x= ?

extern double  start_lot=0.1;//начальный лот
extern double  koef=2;//коэффициент умножения

extern int n_pos =5;// номер искомой позиции для определения её лота
//===
double _lot_x; // лот искомой позиции

double  _lot=0;// лот следующей позиции
//===
void OnTick()
{
if(OrdersTotal==1)
 {
 _lot = start_lot* koef;
 }

if(OrdersTotal>1)
 {
 _lot = _lot * koef;
 }
}
 

Greetings. Anybody with a clue? I'm trying to figure out the Webrequest function. I need to send a POST request to the api server to make a test mailing via sendpulse.com. It says here how to create a request to make the mailing: https://sendpulse.com/ru/api#push , where "Create a new push mailing". I've read about HTTP-requests, but it's not clear how to do it via webrequest. Please help me with example of request in the form of webrequest based on https://sendpulse.com/ru/api#push manual and example of Get request from manual too, for example "Get list of pushed campaigns". I will be very grateful!

Sendpulse REST API - документация - Sendpulse
Sendpulse REST API - документация - Sendpulse
  • sendpulse.com
API интерфейс используется для того, чтобы интегрировать возможности сервиса рассылок SendPulse в личный проект клиента. API предназначен для разработчиков и сопровождается детальной документацией. Описание REST API сервиса SendPulse работает по протоколу HTTP и представляет собой набор методов, с помощью которых совершаются запросы и...
 

Please advise. When testing an EA and specifying a different initial deposit, the tester gives different trading results with the same (except for the deposit size) parameters of the tester and EA settings. In the Expert Advis or's settings there are no money management and risk management settings, the test is done for trading one lot of FORTS futures. Even the smallest deposit exceeds 1.5 times the value of the lot, the drawdown at the same time is much lower than the deposit size, i.e. there is plenty of margin. But it seems that the Expert Advisor in some cases does not risk entering some trades with a smaller deposit and performs fewer trades and, therefore, different results. Why?

Thanks in advance for the answer.

Files:
1.jpg  345 kb
2.jpg  358 kb
 
Hello comrades! Please advise how to write a function that will perform a certain number of attempts to open a pending order(or rather its triggering), or will send a boolean value?
 
barudkinarseniy:
Hello comrades! Please advise how to write a function that will perform a certain number of attempts to open a pending order(or rather its triggering), or will send a boolean value?
If the order has changed its state from pending to market order, we should write the necessary value into a variable. Something like this
//+------------------------------------------------------------------+
bool event_pending(int tiket)
  {
   if(OrderSelect(tiket,SELECT_BY_TICKET))
     {
      if(OrderType()<=1)return(true);
     }
   return(false);
  }
//+------------------------------------------------------------------+
 
Hello! Is it possible to prescribe in the code that when a certain number of orders the advisor would restart, all counters would be reset, but when testing the advisor with a grid of orders in a year shows more than 1000 orders, and even the tester starts to hang ( And if you can, please advise how?
 
barudkinarseniy:
Hello, Can we prescribe in the code that when a certain number of orders is reached, the EA will restart and all counters will be reset, because during testing, the EA with the grid of orders shows more than 1000 orders over a year and even the tester starts to hang ( And if it is possible, please tell us how!

There is a function

ExpertRemove

Terminates the Expert Advisor and unloads it from the chart.

voidExpertRemove();

But there is no way to run it afterwards. The Expert Advisor should be corrected, the problem is not with orders but with something else. A memory leak somewhere, most likely.

 
Alexey Volchanskiy:

There is a function

ExpertRemove

Terminates the Expert Advisor and unloads it from the chart.

voidExpertRemove();

But there is no way to run it afterwards. The Expert Advisor should be corrected, the problem is not with orders but with something else. A memory leak somewhere, most likely.

I don't see any problem, EA has just opened orders after closing profitable or losing trades and the ticket number is very large in print, so I thought I would not have to reload it manually. Thanks for the function, it will also be useful))