I don't need fractions of a second. I need to catch the first second of a new bar
like this
datetime NB_M1;
intOnInit()
{
}
voidOnTick()
{
if (CIsNewBar(_Symbol,PERIOD_M1)) // (1) Если появился новый бар M1
{NB_M1=TimeCurrent();}
......
}
and to save the previous value
datetime NB_01_M1, NB_02_M1;
intOnInit()
{
}
voidOnTick()
{
if (CIsNewBar(_Symbol,PERIOD_M1)) // (1) Если появился новый бар M1
{NB_02_M1=NB_01_M1; NB_01_M1=TimeCurrent();}
......
}
AMarkov: That seems to be what you need. Thank you so much!!!
This is not the way to do it! This is how you get the minimum and maximum prices of the instrument, not the oscillator. An experienced programmer is ashamed to give such answers to such elementary questions...
In fact, you need to get the oscillator data using the CopyBufer
int s, len;
double main[];
double min, max;
len = (int)ChartGetInteger(0, CHART_VISIBLE_BARS); // длина копируемых видимых значений
s = (int)ChartGetInteger(0, CHART_FIRST_VISIBLE_BAR) - len + 1; // 1-й видимый бар минус длина -- начало копируемых баровif (CopyBuffer(handle, MAIN_LINE, s, len, main) != len)
return;
// handle - хэндэл осциллятора// MAIN_LINE - меняем на нужный индекс буфера осциллятора// получаем мин. и макс. значения
min = main[ArrayMinimum(main, 0, WHOLE_ARRAY)];
max = main[ArrayMaximum(main, 0, WHOLE_ARRAY)];
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.
with identifiers CHART_PRICE_MIN and CHART_PRICE_MAX
returns true/false , what time are we talking about?
The class stores the time of the previous tick, and true/false is not returned by the class, but by a member functionof the class:
The class stores the time of the previous tick, and true/false is not returned by the class, but by a member functionof the class:
In the code you posted the public only bar!
Given that the class reports a new bar, the time is iTime(all you need,0),
respectively the previous time iTime(all you need,1)
Z.U. Maybe you know how to get the time with fractions of a second...
In the code you posted, the publc is only bool!
Given that the class reports a new bar, the time is iTime(all you need,0),
respectively the previous time iTime(all you need,1)
Z.U. Maybe you know how to get the time with fractions of a second...
My mistake, sorry
I don't need fractions of a second. I need to catch the first second of a new bar
Wrong a bit, sorry
I don't need fractions of a second. I need to catch the first second of a new bar
like this
and to save the previous value
then it's like this
Thank you, MakarFX, I will try it)
ok, thanks, I'll think about it and run it in the tester.
please tell me more about the martin function in your code.
where do I need to replace something so that martin spreads to profitable orders instead of unprofitable ones?
Please tell me more about the martin function in your code.
Where should I replace what, so that a martin will be applied to profitable orders instead of losing ones?
Highlighted...if <0, then the lot of a losing trade is increased
if >0, then the lot of a profit trade is increased
That seems to be what you need. Thank you so much!!!
This is not the way to do it! This is how you get the minimum and maximum prices of the instrument, not the oscillator. An experienced programmer is ashamed to give such answers to such elementary questions...
In fact, you need to get the oscillator data using the CopyBufer
How to create an oscillator
Or any other oscillator you need.
Highlighted...if <0, then the lot of the losing trade is increased
if >0 then the lot of the profitable trade is increased
Thank you very much