And this order of things is normal (these are the principles of the terminal).
If you want indicator B to change its indications when parameters of indicator A change, make information exchange between indicators (may be a file, global variables of the terminal, computer RAM): indicator A passes its initializable parameters during initialization and indicator B periodically checks possible parameter changes of indicator A. When it detects changes, indicator B should also perinitialize with new parameters (forced init()).
Thank you for your reply, but I can't use it as I don't understand everything and am not very good at programming, could you please make the necessary changes to my indicator codes.
Good day to all. I have a problem with the "CurrencyPowerMeter" indicator and I can't move it to another position in the terminal window. If you can help, I'd be very happy to do it.
I decided to ask you a question, maybe you can tell me. I am writing an indicator, in the indicator I process ticks on tick timeframe (which opens autonomously,this one). My buffer array does NOT process EVERY tick, but selectively (e.g., a tick every 60 seconds, but it's not necessary). Instead of
int counted_bars=IndicatorCounted();
I understand the following construction:
externint sec=60;//объявляем количество секундint i;//будет индексом текущей "свечи" (тика)int i_prev;//будет индексом предыдущей "свечи" (тика), отстоящего от теущего на sec секунд назадdouble MyBuffer[];//этот будет на чартеdouble MyTemp[];//этот только для подсчётовint init(){
IndicatorBuffers(2);
SetIndexBuffer(0,MyBuffer)
SetIndexBuffer(1,MyTemp)
SetIndexDrawBegin(0,14);
i=Bars-1;
while(Volume[i]-Volume[Bars-1]<sec) i--;//потому что в Volume[] на тиковом у нас время сервера точностью до секунды (а в Time[] - моделируемое для предоставления тиков на чарте)
i_prev=Bars-1;//отошли от первого исторического тика на чарте на заданное количество секунд, запомнили его, запомнили первый, уходим в start()return(0);
}
int start(){
double deltaHigh,deltaLow;
int counted_bars=IndicatorCounted();//честно говоря, не уверен, т.к. считаем мы не все "свечи" (тики)if(counted_bars>=i) i=Bars-counted_bars-1;//аналогичноwhile(i>=0){//цикл обработчика
deltaHigh=High[i]-High[i_prev];//к примеру
deltaLow=Low[i_prev]-Low[i];
//и дальше код обработчика (формируем предварительный массив MyTemp[]). В конце цикла:
i_prev=i;//запоминаем теперь текущий индекс как индекс предыдущего тикаwhile(Volume[i_prev]-Volume[i]<sec){//и уходим вперёд на заданное количество секунд
i--;
}
}
...
Now the question. In the pure M1 version, the next thing is standard.
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;//принтовал, при первом обращении limit=Bars-2, при последующих limit=2for(i=0; i<=limit; i++){
MyBuffer[i]=iMAOnArray(MyTemp, 0, 14, 0, MODE_EMA, i);
What to replace limit and counted_bars with? My understanding is,
int counted_bars=ArraySize(MyTemp)-1;//сразу после цикла while
(because the number of ticks in 60 seconds is not constant, i.e., just write int counted_bars=IndicatorCounted()/_number_of_ ticks_in_60_seconds_ will not work).
Or am I wrong about everything?
p.s. ahead of a possible question, I will answer: I know that on forex sec!=60 is not applicable, and sec=60 makes no sense, but I trade not on forex either.
MK07: Thank you for your reply, but I can't use it as I don't understand everything and am not good at programming, could you please make the necessary changes to my indicator codes.
Excuse me, do you have a car? If you have one, you don't consider it a luxury, just a necessity, do you? If not, you're not going to leave it like that for the rest of your life, are you? This is the age, you have to know how to drive a car. I'm just a farmer, but I do what I do, for me programming is no different from yard work, like locksmith work, the same work with my hands (I live in the countryside). A wheelbarrow, a wheelbarrow or MQL4 are just tools for me. Maybe it's perceived differently for city dwellers, I don't know. Global variables in manual here, standard file functions here, faster these ones, but through WinAPI. I wanted to answer yesterday, but didn't.
#include <MASSIV.mqh> int start()
{
double Price=iOpen (Symbol (),0,0);
double SL=NormalizeDouble (Price+3000*Point, Digits);
double TP=NormalizeDouble (Price-100*Point, Digits);
double value = Bid ;//параметру value функции ArrayBsearch присваивается значение цены последнего тикаdouble ld_Delta = 0.0010;
int S = ArrayBsearch( mass, value, WHOLE_ARRAY, 0, MODE_ASCEND);//функция возвращает индекс значения цены макс. близкой к цене последнего тика int last_order_bar = 0;
int ot = OrdersTotal();
...............................(остальной код опустил,но он не изменился)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I can't find the command that redraws the custom indicator. If anyone knows, please tell me. Thanks in advance =)
I already found it. Thank you all =)
Good afternoon.
Can you help me come up with a formula?
I have a refill step SD=100;
if the price is 25, then for it the topping out level will be DE=100
if the price is 102, its rate of units will be UD=200
if the price is 215, then the rate of topping up is BP=300
the price fell to 135 again, the topping out level will be UD=200
And this order of things is normal (these are the principles of the terminal).
If you want indicator B to change its indications when parameters of indicator A change, make information exchange between indicators (may be a file, global variables of the terminal, computer RAM): indicator A passes its initializable parameters during initialization and indicator B periodically checks possible parameter changes of indicator A. When it detects changes, indicator B should also perinitialize with new parameters (forced init()).
The first code is indicator A.
Second code-indicator B.
The last question was solved, the new one is
I have the refill level recalculated on each bar.
How do I remember the level on the last bar
and use it to open a trade
Thank you for your reply, but I can't use it as I don't understand everything and am not very good at programming.
You are suggesting that I should do for you what you 'play with'. Sorry, not interested.
And, if you are learning to program, it is an interesting task for you.
int counted_bars=IndicatorCounted();I understand the following construction:
Now the question. In the pure M1 version, the next thing is standard.
What to replace limit and counted_bars with? My understanding is,
(because the number of ticks in 60 seconds is not constant, i.e., just write int counted_bars=IndicatorCounted()/_number_of_ ticks_in_60_seconds_ will not work).
Or am I wrong about everything?
p.s. ahead of a possible question, I will answer: I know that on forex sec!=60 is not applicable, and sec=60 makes no sense, but I trade not on forex either.
Thank you for your reply, but I can't use it as I don't understand everything and am not good at programming, could you please make the necessary changes to my indicator codes.
Good afternoon everyone!
I am learning to use arrays.
I have an array .I have initialized it with strings i.e. double mass [3567]={0.85374 , 0.85694 , 0.85974 , .... };
And the program read the array and executed it.
Now I have initialized the same array into one column
double massi[3567]
{
mass [ 0] = 0.85374;
mass [ 1] = 0.85694;
mass [ 2] = 0. 85974;
mass [ 3] = 0.86174;
mass [ 4] = 0.86474;
mass [ 5] = 0.86494;
mass [ 6] = 0.86504;
mass [ 7] = 0.86524;
}
The compiler does not generate any errors but generates a warning.
'{' - expression on global scope not allowed C:\Program Files\Alpari NZ MT4(2)\experts\include\MASSIV.mqh (4, 2)
The array is declared globally as before (when it was initialized with strings and worked fine).
There are only 2 entries in the log.
2013.04.12 16:14:44 XXX test started
2013.04.12 16:14:36 XXX EURUSD,H1: loaded successfully
QUESTION.WHY IS THE PROGRAM NOT READING AN ARRAY INITIALIZED IN ONE COLUMN.
Thank you.