Questions from Beginners MQL5 MT5 MetaTrader 5 - page 914

 

Good afternoon, help please.

Need an EA or code that closes open orders by profit or loss in pips.

Thank you!

 
rabanik:

Good afternoon, help please.

Need an EA or code that closes open orders by profit or loss in pips.

Thank you!

Orders cannot be closed - pending orders can only be deleted. But the opening of a position can be modified and closed.

Be more specific about what you need.

 
Hello. I can't make any money on a real account. I don't know how to find a broker.I can't even fund a real account. Please give me some advice.
 
Манижа Каримова:
*** I can't make money on a real account

Get a job.

Manija Karimova:
*** Don't know how to find a broker

Google search on the phrase: "Broker Rating".

 
Comments not related to this topic have been moved to "Questions from MQL4 MT4 MetaTrader 4 beginners".
 

Good evening, forum users.

I have some questions during my work:

1) When I enable EA (it's multicurrency), I buy some symbols, but I don't go to this procedure any more, and only work with open positions.

BUT! Then the computer went into hibernation, the screen went blank, and when I came back and pulled the mouse again, as soon as the computer came out of hibernation mode, it has again purchased symbols from the procedure, which I can no longer enter as it were.

if(tr==false)
     {

      double balance=AccountInfoDouble(ACCOUNT_BALANCE);
      double balance2=balance/ks1;  //кол-во символов
      double svolzak = 0;
      for(int i=0; i<ks1;i++)
        {
         double ask=SymbolInfoDouble(m_Symbols[i],SYMBOL_ASK);
         double lotsnew=balance2/ask;
         lotsnew=CorrectFloat(lotsnew);
         m_Trade.Buy(lotsnew,m_Symbols[i]);
         vol_sym[i]=lotsnew;
         svolzak+=lotsnew*ask;

        }
      tr=true;
      per_can2=PeriodSeconds(per_candle);
      first_buy=TimeCurrent();
      svoltake3=balance-svolzak;
     }

Boolean tr becametr=true; and I don't plan to come here again, but after hibernation, and also if I leave the terminal and then come in again, the EA again buys((((

The question is, what should I do to prevent it from buying again and again, after the terminal shuts down, or the computer goes into hibernation mode?

2) I have several multicurrency EAs and one account. I trade without leverage. I start working and I have conditionally 10 000. I want one EA to use only 5000.

Can I set the external variable for money to be deducted from my balance and used by the EA?

And the last question))

3) If I have many multicurrency EAs in one account, how do I create magic numbers? I.e. I can have up to 10 symbols in one EA, and I have 3 such EAs.

Is magic number created for each EA and for each symbol? It can be an array of magic numbers for each expert?

 
If anyone can help with my confusion. it would be greatly appreciated!!!
 

Can you tell me what is the error? Message - invalid pointer access in 'MyIndicator.mq5' Code is simple and syntax seems correct...

//+------------------------------------------------------------------+
//|                                                  MyIndicator.mq5 |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class MyClass
  {
private:

public:
                     MyClass();
                    ~MyClass();
   void              MyFunction();
  };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
MyClass::MyClass()
  {
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
MyClass::~MyClass()
  {
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void MyClass::MyFunction()
  {
   Print(Input1);
  }
//+------------------------------------------------------------------+

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots   1
//--- plot Label1
#property indicator_label1  "Label1"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- input parameters
input int      Input1=1;
//--- indicator buffers
double         Label1Buffer[];
MyClass *PointMyClass;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,Label1Buffer,INDICATOR_DATA);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   PointMyClass.MyFunction();
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+



 
Hello guys, sorry if I'm off topic, I'm new to this. Is it possible to make an indicator, advisor or alert when the price crosses the MA in any timeframe, so as not to look through each chart and not to waste time. If there is an answer to this question, where can I find it? Thanks in advance for the answer
 
Олег Савка:
Hello guys, sorry if I am new to this subject. Can I make an indicator, expert advisor or alert when price crosses an MA in any timeframe? If there is an answer to this question, where can I find it? Thanks in advance for the answer

There are 21 timeframes in MQL5. Do you want to track all 21 timeframes? Another question: do you want to write an MQL5 Expert Advisor yourself, but you don't know where to start?

Reason: