Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1133

 
--danger--:

prıvet .podzajajajte pojalusta pogu na demo schete ne mogu otkrıt zdelkı

--danger--:
trade is disablet .oshıbka
Is the button avtotorgovly ne najata? Please indicate the nomer osibki, v jurnale dolzen byti.
 
Alekseu Fedotov:

No sins, what does it swear at.

What are the compiler errors

Something to do with the fact that the function must be global and waiting for commas in places where it makes no sense to put them! For example at the separator between information about broker and traded pair

 
GoldenGod:
A word of advice for a dummy. How do I open a live account?
Depends on the broker, you go to his website and look for the button "Open a real account" or something similar. Or in the broker's private office "Create a new account".
 
Vitalie Postolache:
What do you mean "none"? Sort by ticket - there will always be an order and no contradiction with documentation, it says about sorting by serial number, not by ticket, they are different things.
If you ask yourself a question:
We have this list of orders at one moment (by ticket)
  1. Buy #1
  2. Buy #2
  3. BuyStop #3
  4. Sell #4
The order of the tickets in the list is: #1,#2,#3,#4

After BuyStop #3 what order will the tickets be in the list?

Is it #1,#2,#4,#3?

So the tickets don't guarantee orderliness either.
 
Anton Sokolov:

Another problem I've encountered! Don't judge, I've been studying the language for 2-3 weeks, maybe I'm just dumb!

The task on the Expert Advisor is to notify the trader via email every 4 hours, if the free margin on the account has added a certain value.

In the subject of the message you have to write the name of the broker and the traded pair, and in the body of the message "Danger! The drawdown is over the limit. Take the necessary measures".

The compiler is malfunctioning, I'm not good at English and I can't figure out what the error is!

input  double MessageMail     = 50.0;
double Sag;

void OnTick()
  {
   Sag = NormalizeDouble(100-100*(AccountInfoDouble(ACCOUNT_FREEMARGIN)/AccountInfoDouble(ACCOUNT_BALANCE)), 1);  //находим процент просадки и округляем до 1 знака
    if(Sag > MessageMail && iVolume(NULL,PERIOD_H4,0)<3)                                       //если просадка больше заданного и начата новая свеча на 4ч таймфрейме
     {
     Alert(Symbol(), ": Просадка = ", Sag, " % ", " > ",  MessageMail, " % ");                 //вывести предупреждение в терминале
//Сюда нужно вставить команду SendMail для отправки сообщения, а что и как не понятно
// пробовал bool SendMail( AccountInfoString(ACCOUNT_COMPANY)|Symbol, "Опасность! Просадка привысила допустимое значение. Примите необходимые меры")
//что то не выходит                          
     }
  }


PS: Maybe in general there is an easier solution for this kind of problem, but so far I see it only this way)

//+------------------------------------------------------------------+
//|                                               exTestSendMail.mq4 |
//|              Copyright 2017, Artem A. Trishkin, Skype artmedia70 |
//|                       https://login.mql5.com/ru/users/artmedia70 |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, Artem A. Trishkin, Skype artmedia70"
#property link      "https://login.mql5.com/ru/users/artmedia70"
#property version   "1.00"
#property strict

input  double MessageMail     = 50.0;
//---
double Sag=0;
string MailSubject="";
datetime PrevTime=0;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   MailSubject="Mail from EA "+MQLInfoString(MQL_PROGRAM_NAME);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   //--- Находим процент просадки и округляем до 1 знака
   Sag=NormalizeDouble(100-100*(AccountInfoDouble(ACCOUNT_MARGIN_FREE)/AccountInfoDouble(ACCOUNT_BALANCE)),1);
   //--- Если открыт новый бар на H4
   if(iTime(Symbol(),PERIOD_H4,0) !=PrevTime) {
      //--- если просадка больше заданного
      if(Sag>MessageMail) {
         Alert(Symbol(), ": Просадка = ", DoubleToString(Sag,1), " % ", " > ",  MessageMail, " % ");              //вывести предупреждение в терминале
         string MailText=AccountInfoString(ACCOUNT_COMPANY)+" > Опасность! Просадка ("+DoubleToString(Sag,1)+"%) привысила допустимое значение. Примите необходимые меры.";
         SendMail(MailSubject,MailText);
         }
      PrevTime=iTime(Symbol(),PERIOD_H4,0);
      }
  }
//+------------------------------------------------------------------+
In general, it's better to do checks of this kind in a timer.
 

Thank you! Set up to send letters!

 

how to fixthe return value '' OrderClose must be checked??????????????????????????????

 
Vielleicht xamp neu starten
 

Dear programmers, please help a newbie in this business.

The EA is opening buy and sell orders sequentially after a certain period of time. I want it to modify all previous orders (specifically, all previous ones should be closed by Take Profit of the last one. I.e. if the last buy order and previous sell order, then the stop loss of the previous order is set to the take profit level of the last one,

If the previous buy buy, then its TakeProfit will be set on the level of the last TakeProfit. The point is that when takeprofit of the last order comes, all orders must be closed).

I hope I explained it clearly, although it is difficult to understand how it should be implemented. Thank you in advance.

I understand that we can go through all open orders and modify them, but how can we skip the last order?

 
Alexandr Nevadovschi:

Dear programmers, please help a newbie in this business.

The EA is opening buy and sell orders sequentially after a certain period of time. I want it to modify all previous orders (specifically, all previous ones should be closed by Take Profit of the last one. I.e. if the last buy order and previous sell order, then the stop loss of the previous order is set to the take profit level of the last one,

If the previous buy buy, then its TakeProfit will be set on the level of the last TakeProfit. Well, etc. The point is that when takeprofit of the last order comes, all orders must be closed).

I hope I explained it clearly, although it is difficult to understand how it should be implemented. Thank you in advance.

I understand that we can go through all open orders and modify them, but how can we skip the last one?

The most important thing in all this is understanding what should happen.

What is the "last order"? Is it last by opening time? Or by opening price level?

What if we consider "the last" order as "BUY", but the price will fuck up? Or vice versa, the last order will be SELL, but the price goes north? Then which one should be considered the last? This is what we have to realize.

Reason: