Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1485

 
How to get the value of parameter
rates_total
by script

It is clear in the indicator. But the script?


#property copyright "Copyright 2022, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()

  {
      Alert(rates_total());
    }
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • 2023.12.04
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
 
Novichokkk #:
How to get parameter value by script

It is clear in the indicator. But the script?


https://www.mql5.com/ru/docs/series/bars

Документация по MQL5: Доступ к таймсериям и индикаторам / Bars
Документация по MQL5: Доступ к таймсериям и индикаторам / Bars
  • www.mql5.com
Bars - Доступ к таймсериям и индикаторам - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

That's understandable, I've done it that way before. Thank you

#property copyright "Copyright 2022, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()

  {

   Alert(Bars(_Symbol,_Period));
   

  }
//+------------------------------------------------------------------+

I was wondering if there was another way.

 
Novichokkk #:

That's understandable, I've done that before. Thank you

I was wondering if there was another way.

You can. SeriesInfoInteger().

Документация по MQL5: Доступ к таймсериям и индикаторам / SeriesInfoInteger
Документация по MQL5: Доступ к таймсериям и индикаторам / SeriesInfoInteger
  • www.mql5.com
SeriesInfoInteger - Доступ к таймсериям и индикаторам - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

Where can I see a simple example of implementing piecewise linear interpolation ?

For example for array x[]={0.1 , 0.8, 3.2, 7.9, 9.3} (5 values) there are corresponding values in array y[]={-3.2, 2.7, 1.1, -6.4, 20} (5 values)

How do I get the corresponding values from the array y[]9 values for the argument x1[]={0.1, 1, 2, 2.5, 5, 5.1, 6, 8, 9.3} (9 values) via the piecewise linear interpolation function for the argument x1[]={0.1, 1, 2, 2.5, 5, 5.1, 6, 8, 9.3} (9 values)?

I understand that to start with, in array x[] we look for the value from array x1[], and if they match exactly, then assign the value from array y[]/ to array y1[].

And if they do not match, we look for 2 values in array x1[], between which lies the value from array x1. Then for the array y1[], we calculate the corresponding value from the array y[] by the formula.

And so for the required number of points. But the search by enumerating each element of the array is not economical. Probably use binary search (I read about the search methods).

So, I would like to see somewhere how such a function is written and how it is used. In the search I found only references to ALGLIB. But I couldn't understand where it comes from and how.

Don't send me to ALGLIB.

 
Novichokkk element of the array is not economical. Probably use binary search (I read about search methods).

So, I would like to see somewhere how such a function is written and how it is used. In the search I found only references to ALGLIB. But I couldn't figure out where it comes from and how.

Don't send me to ALGLIB.

Why search for each? If x and x1 are ordered, we progress through them by two indices.

 
JRandomTrader #:

Why search for each? If x and x1 are ordered, we advance by two indices.

Yeah, I didn't think of that. That's why I asked for examples. But I couldn't find any. I need the right way to do it.

 
How can I upload a robot in MQL5 in the Market for sale, can I have instructions?
 
Alisher Batiraliev #:
How can I upload a robot in MQL5 in the Market for sale, can I get instructions?

In the Market. There is a big green button at the top-right...


Форекс-маркет – Магазин торговых роботов, советников и технических индикаторов для MetaTrader 5
Форекс-маркет – Магазин торговых роботов, советников и технических индикаторов для MetaTrader 5
  • www.mql5.com
Официальная витрина приложений для торговли из терминала
 
Artyom Trishkin #:

In the Market. At the top-right is a big green button ...


Thank you
Reason: