Discussion of article "Creating an Expert Advisor, which Trades on a Number of Instruments" - page 4

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 would still pay attention to the algorithm of working with buffers. If I understood it correctly, one buffer is enough (it just needs to be correctly calculated and drawn on the graph).
PS
And with the current variant I have an impression that the inducer displays "left" data (the very beginning of history) instead of "right" (current)....
Or I don't understand anything in the logic of this indicator at all....
If you output for example EURUSD to EURUSD or EURJPY to EURJPY, everything works fine.
So the output direction seems to be correct.
I have tried a lot of variants here and even like this:
handle1=iMA(InstrumentName,PERIOD_CURRENT,ex_Period_MA_1,0,MODE_SMA, PRICE_CLOSE);
...
copied=CopyBuffer(handle1,0,0,0,Counted_bars,Buf_0);
Still nothing comes out.
Does anyone have an example of displaying two different tools on one screen, somehow?
What am I doing wrong, why can't I display the chart of another instrument normally?
Everything worked in MQL4, here it works only if you display it on the same instrument, then no errors.
It works in cropped form. Add checks and economics.
If you output for example EURUSD to EURUSD or EURJPY to EURJPY, everything works fine.
So the output direction is kind of correct.
I have tried a lot of variants here and even like this:
handle1=iMA(InstrumentName,PERIOD_CURRENT,ex_Period_MA_1,0,MODE_SMA, PRICE_CLOSE);
...
copied=CopyBuffer(handle1,0,0,0,Counted_bars,Buf_0);
Still nothing comes out.
Does anyone have an example of displaying two different tools on one screen, at least somehow?
Do you have a source code for MQL4?
I've already suggested an alternative, which is to make an index for the current instrument and debug it 100%. After that, you can easily call it with the necessary parameters in Expert Advisor or in another indictor.
With such an implementation, you need to change the basic logic of the indictor, because the parameters passed to the calculator are not quite correct for other instruments(the number of bars and other things may not match)....
And by and large this concept is not very "correct" (to put it mildly).
PS
In short, there are two options here:
1. Realise everything for the current TF and instrument and check its operability. After that use iCustom();
2. To rewrite the logic of the inducer in such a way that in the calculator it receives absolutely all data on the instrument specified in the parameters (costly and not very correct method).
Changed it, still doesn't work, the chart is not true.
Do this in your indicator
and read the section Indexing Direction in Arrays and Timeseries
The cropped form works. Add checks and economics.
These two things are not needed there.
//1
//2
Those are the two things you don't need in there.
Yeah, I think it worked!
Thank you all so much!!!
I will test it further.
Need to visualise trades. The Expert Advisor is multicurrency. Let's say it hangs on EURUSD and opens deals on other currency pairs. I have a difference in the results, I understand that it's my fault, but I can't check it (I can't open a chart with AUDUSD trades when the Expert Advisor is hanging on EURUSD).
If the Expert Advisor is hanging on AUDUSD, I open it and see that it works as I programmed it, but if it is hanging on EURUSD, the results are different, and I can't understand why. Visualisation of trades would be very helpful.
7.When testing Exp_TEMA.mq5, Told[] Tnew[1]expressions get the following values:
Told[] Expression could not be evaluated
Tnew[1] Invalid array range.
What do these values mean and how do they affect the result of the Expert Advisor's work?
8.Why does Exp_TEMA.mq5 open trades inside a bar during testing?
9.Will it lead to code reduction, reduction of trade execution time, reduction of slippage, reduction of costs (commissions, etc.), if instead of closing a position and opening a position in the opposite direction, we do a flip, i.e. open a position in the opposite direction with double volume?
Deals inside the bar.
7.When testing Exp_TEMA.mq5, the expressions Told[] Tnew[1]get the following values:
Told[] Expression could not be evaluated
Tnew[1] Invalid array range.
What do these values mean and how do they affect the Expert Advisor's work?