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
Do not confuse the unconditional and stupid (from ignorance) re-creation of indicators on every tick with the intelligent (rare and necessary) creation of an indicator. In the first case you get a hundredfold brake and leakage of resources, and in the second - perfect work.
I am well aware that Karlson has ignorantly made a mistake, and I also understand the nature of that mistake.
But suggest a reasonable scheme to solve his problem. The person needs to use the code written in the indicator but this code's parameter(s) are determined dynamically before each access to the indicator data?
I have a solution, it does contain dll, but you want to use pure mql, so propose a solution in mql.
HZ I already mentioned OnCalculate() and calculations in events, but you can pass three parameters via event. In my solution, a long dll will give you the address of an array with parameters and the indicator will receive data at this address.
If you have mql solution, just point the finger.
I am well aware that Karlson has ignorantly made a mistake, and I also understand the nature of that mistake.
But suggest a reasonable scheme to solve his problem. The person needs to use the code written in the indicator, but the parameter(s) of this code are determined dynamically before each reference to the indicator data?
How many different indicators should be created in reality? Probably no more than 10, otherwise it will be a senseless waste of resources.
Since there are no parameter changes, you can create a collection of indicators, and the necessary one will be added to it when necessary. If there are less than 10 indicators and they have a clear meaning (initial, confirming, correcting, etc.), you can create named variables of handles with needed parameters.
But suggest a reasonable scheme to solve his problem. The person needs to use the code written in the indicator, but the parameter(s) of this code are determined dynamically before each reference to the indicator data?
I've given it some thought. If the code parameters are dynamically determined before each access to the indicator data, why not include the procedure of determination of these parameters in the indicator code? In other words, all calculations should be implemented in the indicator.
Or there are situations, when such approach is impossible in principle?
I've been thinking for a while. If the code parameter(s) are dynamically determined before each use of the indicator data, why don't we include the procedure of determining these parameters in the indicator code? In other words, all calculations should be implemented in the indicator.
Or there are situations, when such approach is impossible in principle?
There are situations, when parameters are calculated by another indicator and returned to the Expert Advisor, and the Expert Advisor decides which model to use based on the neuronics. We do not know in advance which set of parameters will be applied.
Can you please tell me why in such a simple indicator the zero (first from the right) bar is not calculated everywhere except the weekly graph?
Oops) substituted here:SimpleMAOnBuffer(e,prev_calculated,PERIOD+1,p,vect,mabuf); instead of e - rates_total and everything worked)
I am trying to build a multicurrency Expert Advisor. So far I've decided on the scheme proposed by Nikolay Kositsin in his article"Creating an Expert Advisor that trades on different symbols". I faced the problem that the results are different when running a test using different symbols but the same parameters. I scrolled through the forum and found that many have come to the conclusion that this issue can be solved using the OnTimer() function. Andrey Khatimlansky advised it here:
Отвяжитесь от тиков конкретного инструмента (OnTick) - это же мультивалютник! Работайте по таймеру или ловите момент образования бара на всех рабочих инструментах, это будет надежнее.
I tried catching the moment of bar formation on all instruments, but I failed to achieve the desired result.
For example:
In the function that is intended to detect a new bar, I explicitly specify the instrument and timeframe.
In the OnTick() function, the scheme suggested by Nikolay Kositsin.
For example:
The isNewBar(Symbol,Timeframe) function is called in the function in which the trade is executed, i.e. TradePerformer(parameters).
For example:
That is, a new bar is checked for each symbol separately. If there is no new bar, we check the next symbol. And so it happens with every tick. But this variant does not work.
Please advise how to implement correctly the checking of a new bar in a multi-currency Expert Advisor in the given scheme.
Should be in the humour thread to correct mistakes made by someone called Expert?