Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 715

 
Zvezdochet:
URRRRRRRRRRRRAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!! Taggrogism defeated !!! But passaran ! Venceremos ! Free Nicaragua !

I don't think you should post in this thread any more - it's not here to teach you how to read/write or how to speak. It's about helping newcomers. And you're not a beginner, you're a baby :)

ZS. I already gave you a link on where to start. And it doesn't matter that it's on fives - it's the same language. The API is different.

Документация по MQL5: Основы языка
Документация по MQL5: Основы языка
  • www.mql5.com
Язык MetaQuotes Language 5 (MQL5) является объектно-ориентированным языком программирования высокого уровня и предназначен для написания автоматических торговых стратегий, пользовательских технических индикаторов для анализа разнообразных финансовых рынков. Он позволяет не только писать разнообразные экспертные системы, предназначенные для...
 
Artyom Trishkin:

I don't think you should post in this thread anymore - it's not here to teach you how to read/write or how to speak. It's about helping newcomers. And you're not a beginner, you're a baby :)

ZS. I already gave you a link on where to start. And it doesn't matter that it's on fives - it's the same language. The API is different.

Well.... before you get banned...... , according to the rules of freelancing, babies are not forbidden to pee. So I wrote - what can you do with a baby - he does not know what he's doing. And there are a lot of branches here, the tree is big, growing, I wish the tree good health.

IMHO ( I'll pretend too ) there are a lot of links and they do not fit in your head. And here people ( not references ) gave a little help - they did good and did not send us to ...... or to Siberia into exile.

Brothers in exile! Help me figure out how to solve the second task! There is one line Coment ( str ) and on the monitor "Hello" should light up.

 
Zvezdochet:
&&&&&&&& on the keyboard is cyara 7 with shift in English layout :)
 
https://www.mql5.com/ru/forum/160683/page711#comment_9876690 Tell me who knows where the information on my question can be read - if you can't help me, I'll do it myself... Elsewhere I was advised that MT5 can do it, but I have MT4, search is no help.
 
ruzaden:
https://www.mql5.com/ru/forum/160683/page711#comment_9876690 Tell me who knows where the information on my question can be read - if you can't help me, I'll do it myself... I was told elsewhere that it is possible to do it in MT5, but I have MT4, search does not help.

this can be done via the terminal's global variables. Provided you have the source code of the indicator and can edit it.

It means that indicator will perform calculations by getting parameter not through extern but from calling GlobalVariableGet(). And accordingly the Expert Advisor will change this variable through GlobalVariableSet

 

I would like to make a couple of improvements to MT5:

1. Reduce the number of digits on the chart from 5 to 4, the broker does not want to do this.

2. For some reason, when I set the bid line colour, the price background becomes the same colour and merges with the background.

If I set the colour black, I will get a solid line across the whole screen which is very distracting.


As far as I understand, the best way to do it is to output the price value as a text marker. How can I make it move when the price changes?

It's possible that my question has already had a solution for a long time, but I haven't found anything by searching.

 
ruzaden:
&&&&&&&& on the keyboard is cyara 7 with shift in english layout :)
Ahhhhhh

...... I'm already afraid to turn on my laptop, I figured: "They're watching me on the webcam. They know I've got a 7. "Already started digging trenches. Building a bomb shelter. etc. ....

 

As long as they haven't created a "Any Questions for Babies" thread, I'll pretend to be a newbie and ask questions here. I meant the second assignment. I copied it exactly. There's only a couple of words I put in the template, but there's a lot of error

String str ="Hi ";

Comment (str );


 
Zvezdochet:

As long as they haven't created a "Any Questions for Babies" thread, I'll pretend to be a newbie and ask questions here. I'm talking about the second assignment. I copied it exactly. There's only a couple of words I put in the template, but there's a lot of error

String str ="Hi ";

Comment (str );


void OnStart()
{
     int y = 7;
     double z = 1.47;
     string str = "Привет!";
     
     Comment( str, "\n", y, "\n", z); 
}
 
Hi all, what needs to be checked??? gives a warning on modification and on opening .... (???) it returns a value and i need to check it ... how ??? EA opens orders as i see fit ... (((
extern string MMM          = "MMM";
extern double Lot          = 0.1;
extern int    TakeProfit   = 50;
extern int    StopLoss     = 20;
extern int    Slippage     = 3;
extern int    Magic        = 888;
// Moving Average 1
extern string Indi_MA1        = "MA1";
extern int    MA1_Period   = 22;
extern int    MA1_Shift    = 0;
extern int    MA1_Method   = 0;
extern int    MA1_Price    = 0;
// Moving Average 2
extern string Indi_MA2        = "MA2";
extern int    MA2_Period   = 55;
extern int    MA2_Shift    = 0;
extern int    MA2_Method   = 0;
extern int    MA2_Price    = 0;
//+------------------------------------------------------------------+
double MA1,MA2,SL,TP;
int ticket;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
    if (Digits == 3 || Digits == 5)
    {
      TakeProfit = TakeProfit * 10;
      StopLoss = StopLoss     * 10;
      Slippage = Slippage     * 10;
    }
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
{
 return(0);
}
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick() 
 {           
    MA1 = iMA(Symbol(),0,MA1_Period,MA1_Shift,MA1_Method,MA1_Price,0);
    MA2 = iMA(Symbol(),0,MA2_Period,MA2_Shift,MA2_Method,MA2_Price,0);
    
    if (Ask >= MA1 && MA1 >= MA2 && CountBuy() == 0)
    {
       SL = NormalizeDouble(Ask - StopLoss   * Point,Digits);
       TP = NormalizeDouble(Ask + TakeProfit * Point,Digits);
       ticket = OrderSend(Symbol(),OP_BUY ,Lot,Ask,Slippage,0,0,"",Magic,0,Green);
       if (ticket > 0)
       { 
         if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES) == true)
            OrderModify(ticket,OrderOpenPrice(),SL,TP,0);

       }      
        
    if (Bid <= MA1 && MA1 <= MA2 && CountSell() == 0) 
    
       SL = NormalizeDouble(Bid + StopLoss   * Point, Digits);
       TP = NormalizeDouble(Bid - TakeProfit * Point, Digits);
       ticket = OrderSend(Symbol(),OP_SELL,Lot,Bid,Slippage,0,0,"",Magic,0,Red);
       if (ticket > 0)
       { 
         if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES) == true)
            OrderModify(ticket,OrderOpenPrice(),SL,TP,0);

       }                
    }
 }
//+------------------------------------------------------------------+
int CountBuy()
{
   int count = 0; 
   for (int trade = OrdersTotal() - 1; trade >= 0; trade--)
   {
      OrderSelect(trade,SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() ==  Magic)
      {
        if (OrderType() == OP_BUY)
        count++; 
      } 
   }
   return(count);
}
//+------------------------------------------------------------------+
int CountSell()
{
   int count = 0;
   for (int trade = OrdersTotal() - 1; trade >= 0; trade--)
   {
      OrderSelect(trade,SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() ==  Magic) 
      {
        if (OrderType() == OP_SELL)
        count++; 
      }
   }
   return(count);
}
//+------------------------------------------------------------------+