Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 157

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
i++;
how can i make a condition to be checked on the next bar, not on every tick?
I have this construction
static datetime TimeN=0;
void OnTick()
{
datetime TimeC=iTime(NULL,TF,0);
if(TimeN==0)TimeN=TimeC;
if(TimeN==TimeC) return;
TimeN=TimeC;
This approach works if the indicator works on the chart - and I need this in a script - on a ready-made chart.
Э... this approach works everywhere. You can get what you need from EAs, scripts, other indicators. If you prepare the indicator for your specific needs.
I don't understand.
"In OnCalculate(), when the rates_total > prev_calculated condition is met - calculate the indicator and write the value to this extra buffer;"
What do we record? The value of the indicator on the last bar, no?
I don't understand.
"In OnCalculate(), when the rates_total > prev_calculated condition is fulfilled - calculate the indicator and write the value to this additional buffer;".
What do we write? The indicator value on the previous bar, no?
Let's write down what we calculate.
Then it is dumb to change the calculation of the MAK - to count the same MAK twice.
Have you written a single indicator from scratch to judge what is "dumb" and what is not?
Anyway, good luck in solving the problem. I am withdrawing from the discussion.
Have you written a single indicator from scratch to judge what is "dumb" and what is not?
Anyway, good luck in solving the problem. I am withdrawing from the discussion.
Yes, I write indicators for personal use, but without OnCalculate().
"Dumb" refers to the method, not its author, I certainly didn't mean to offend anyone...
I'm talking about about such solution for simple MA[n]-Close[n]/period+Open[n]/period
I'm interested in similar solutions for other ways to calculate MAs.
I'm not a good speaker. If I start talking I will discredit the science.)
Find Albert Buraga with his theme "Beyond the market" he has been discussing this topic for a long time, and listen to ...... algorithms and calculations are all there, his group is in contact
there is no need to put up a link to his site - they will delete it. show your interest and you will find it...... I am not his student and do not want to advertise it, but I have taken for myself 1/3 of what he says is missing.
My work screen looks like this: Trading from Friday ...I've hardly been near my computer ... 80% of the time I was working with pending orders and profit on previously calculated levels...
...and that's the way it is every day
Thanks for the info - I'll look into it. I understand he's on smartlab too.
Hi, could you please advise how to solve this problem: at RSI>50 variable x is counted once and at RSI<50 variable y is counted once (I wrote this part in the code) and at RSI>70 variable x value is subtracted from current price (this part is the problem). The code is as follows:
1 part:
2 part:
If you just connect these parts, the z variable will not be calculated correctly. Is it possible to fix/save the value of variable x for further operations with it? How to achieve correct calculation of variable z under the above condition?
Thank you.