Questions from Beginners MQL5 MT5 MetaTrader 5 - page 487

 
Leo59:
Hello!

At first glance, the task seems as simple as three cents. BUT! ....
There is a line of any oscillator in the indicator window, which wiggles relative to "0" with different amplitude.
The actual problem is:
- At "0" crossing from bottom to top, draw an arrow at the bottom border of the indicator window,
- At "0" crossing from the top downwards, to draw an arrow near the upper border of the indicator window,
- at self-scaling of the oscillator chart in the indicator window, the arrows should automatically remain at their borders of the indicator window.
I.e., scrolling the chart backwards and forwards through the history, or changing its horizontal scale, the arrows should always remain at the boundaries of the indicator window automatically.

Please don't give any advices, "help me with money")). I need an example of a working code, which implements this function, or a link to one.

Thanks in advance!
Here will help you financially on a commercial basis.
 
-Aleks-:

Alpari has been providing quotes for MT4 for 10 years - try there.

Technically, all the quotes can then be unloaded from MT4 via F2 -> Export

I don't think it's actually Alpari - it's quotes from Metaquotes, there are a lot of missing candles there, and the intraday ones only start from 01.06.2009.
 

Dear MQL-developers, I need some help.

How can I bind the closing of an order to its opening time or to the number of bars after its opening? I looked through the reference book, but came up with nothing.

 
Mike:
I don't think it's actually Alpari - it's the quotes from Metaquotes, there are a lot of missing candles, and the intraday only starts from 01.06.2009.
When the quotes are not from a broker, a warning is given. I downloaded it fine... Also, as an option, run a test on everything there will also try to download quotes.
 
Alexandr Nevadovschi:

Dear MQL-developers, I need some help.

How can I bind the closing of an order to its opening time or to the number of bars after its opening? I looked through the reference book, but came up with nothing.

https://www.mql5.com/ru/code/13769
OrderTimeAlert
OrderTimeAlert
  • votes: 8
  • 2015.09.04
  • Alexey Kozitsyn
  • www.mql5.com
Эксперт следит за рыночными ордерами и выдает звуковой сигнал по прошествии заданного времени с момента открытия ордера.
 
Thank you very much I will try to get what I need out of there!
 
Прошу снова помощи. Не закрывается ордер. В журнале пишет бесконечно EURUSD,H1: OrderClose error 138
         / /функция закрытия по таймеру

          void zakr_po_vrem() 
          {
           int total = OrdersTotal(); 
           datetime oTime;                              // Время открытия ордера
           datetime currentTime;                        // Текущее время
              if(total==1)
           {
            if(  OrderSelect(0,SELECT_BY_POS,MODE_TRADES)) // Если ордер выбран
            { 
              oTime=OrderOpenTime();                           // Запоминаем время открытия ордера
              currentTime= TimeCurrent();                        // Запоминаем текущее время                                    
               if( currentTime - oTime >= inpNum  )    // Если с момента открытия ордера прошло больше чем inpNum сек.
           { 
               if(OrderSymbol()==Symbol()) if (OrderType()==OP_BUY) if(  !OrderClose(OrderTicket(), Lots, Bid, Slippage, clCloseBuy))return(false);
               if(OrderSymbol()==Symbol())  if (OrderType()==OP_SELL) if( !OrderClose(OrderTicket(), Lots, Ask, Slippage, clCloseBuy)) return(false);
               return;  
           }         
            }             
            }
           } 
 
Alexandr Nevadovschi:

I'm asking for help again. I can't close an order. In log it says endlessly EURUSD,H1: OrderClose error 138.

Use the SRC button to paste the code! I don't want to repeat your code!

Close Buy by Bid and Sell by Ask! There are probably other errors, but have to look at it this way! Paste with SRC instead of the sheet, then I'll erase it here!

 
Boris:

Use the SRC button to insert the code! So you don't have to repeat your sheet when you reply!

Close Buy at Bid and Sell at Ask! There are probably other errors, but have to look at it this way! Paste with SRC instead of the sheet, then I'll erase it here!

I already figured it out, you spelled Ask and Bid correctly should have been changed. I'm confused. It's already closing everything normally.
 
Alexandr Nevadovschi:
I've already figured it out, you're right you wrote Ask and Bid should have been changed. Something I got confused. It's closing all right now.

So change the Asc and Beed in your post as well, so as not to leave a mistake for history! There are a lot of newbies here, might take a mistake as a rule! ;)

It's good that it's working! Good luck!

Reason: