Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 173
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
Where does it say that? It's not in the documentation. Or are they hiding it on purpose? :)
The C file is just a piece of information. If you' ve worked with databases, you'll have to get used to it.
In C a file is just a piece of information. If you have worked with databases, you will have to wean yourself off it.
It's not specified anywhere in general? :)
Come on, give me the fucking source.
Did you take the value of the last bar closed as 1?
and the 4 bars behind it have a value of 0.33 0.33 3 3 ????????????????????????????????????????????????
Now you have entered some coefficient of your own to characterise the variation and you want to calculate this coefficient for [1] bar?
well, not exactly.
is an array of ratios of values. one to another. these are not absolute values, but indices, ratios.
this means that say 0.5 is not "50% less". it means 2 times less
and 0.2 is not 80% less, but 5 times less.
2 or 5 is just right, it expresses the point - 2 and 5 times more, respectively
example array
1.2 1.02 0.833 10 0.98 0.1
we need to find the average (in this example, the average will obviously be 1)
arithmetic or geometric mean will not make it clear here, it just compares values, for these methods 0.5 - this is exactly 50% less.
to understand the logic - as I have already written - it is even possible to present it as a graph -
when the value is less than one represented by an inverse negative fraction. will come out
1.2 1.02 -1.2 10 -1.02 -10
here already you can calculate the arithmetic mean
but here there is a snag - if the final average for example 0.2 = it is in fact 1.2 (ie it should add 1)
if the final average for example -0.2 = it is essentially 0.8 (more precisely 0.8333) (i.e. also generally add 1)
however, in case all values are say 3, the output will be 3. So how do we know whether we should add 1?
check - if the value is less than 1, then yes? if not, then no?
apparently so
again - this is an algorithmic solution. i.e. with multiple conversions according to
I asked with the hope that maybe there is a simpler solution, maybe a formula ;-))))
i don't know which one needs a primer))
if no one can understand that 0.2 is not 80% less, but 5 times less... I withdraw my question (((((((
[update]
I think I found it.
in forming second array you have to subtract 1 from values,
and add this unit to final result 0.2 -> 1.2, -0.2 -> -1.2 (this one also has to be converted into negative fraction, you get 0.833(3))
everything will add up.
if anyone knows another, mathematical solution - I would be grateful)
If there are not enough bars on the chart, then increase it in the MT4 settings.
Thank you, I am interested in the tick prices of each bar. That's what I want to summarise and divide by the number of ticks to find the average price.
Maybe, it can be done in MQL5, while nobody knows about it in MQL4.
Thank you, I am interested in the tick prices of each bar. I want to sum them up and divide by the number of ticks to find the average price.
Maybe, it may be done in MQL5, while no one knows in MQL4.
You must first define the period (time) for which you want to count. For example, for a minute. When a new M1 bar arrives, you must collect in an array the "tick" values of the price at every incoming tick. The array size can be set statically, and it can be changed dynamically. When the next bar comes, you will calculate the average price. You can calculate the average price for the current bar by the number of incoming ticks. The calculated data can be written to a file synchronized with the bar opening time. There is no tick history in MT4 - it is a matter of opinion.
Thanks for the last sentence. I somehow thought it was necessary to sum the ticks (Ask or Bid?) of the current bar, divide by the number, i.e. find the average and send it to the array.
Is there a tick history in MQL5, do you know it? I haven't read it or found it there.
Not exactly.
There is an array of ratios. These are not absolute values but indices, ratios.
this means that say 0.5 is not "50% less". it means 2x less
and 0.2 is not 80% less, but 5 times less.
at the same time, 2 or 5 is just right, expressing the meaning - 2 and 5 times as much, respectively
example of array
1.2 1.02 0.833 10 0.98 0.1
Dear what's wrong? I wrote you a script, maybe I did not quite understand what and how you think - but it's fucking working
Alert returns 0.9999
The indicator, based on this algorithm, shows wrong logic (more correctly, if in the indicator will be muss[n]=-k/((aver_bar-1)/1.0) instead of muss[n]=k/((aver_bar-1)/1.0)+1)
And it is remotely similar to RSI but more sensitive (in terms of the slope angle between the bars)