[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 371

 
drknn:

Better like this: https://docs.mql4.com/ru/array/ArrayInitialize - there is a concrete code example
Isn't that what I wrote?
 
artmedia70:
No, it doesn't have to be. All elements of Indic_mas_copi[] array will be replaced with copied from main Indic_mas[] array


Artyom, good day!

It's good that they will...it's exactly what you need, without any special contrivances (loops and functions) - it's handy.

 

Hi all!

Can you tell me how to get the value of ZigZag indicator in Expert Advisor?

I didn't find it in functions like iMA(_______)

 
drknn:


Although from a processor perspective, if we know in advance exactly what to double, it is better to apply addition than multiplication - addition will take less processor time.

Thanks, I'll keep that in mind.
 
artmedia70:
Isn't that what I wrote?


The same, but if you follow the link, you can see in the example code that the array name is applied in the function parameter without square brackets. And this is exactly what you don't see in your example - ArrayInitialize(Array_Name,0); -, nor in my (preceding) explanation. We both missed the point, so I gave the reference. If you had specified "Array_Name" in Latin letters, your explanation would have been necessary and sufficient.

Heh, okay, bygones. :)

 
msl:

Hi all!

Can you tell me how to get the value of indicator ZigZag in Expert Advisor?

See https://www.mql5.com/ru/forum/131859/page6#434260


GetExtremumZZZPrice() function

 
Reshetov:
See https://www.mql5.com/ru/forum/131859/page6#434260


GetExtremumZZZPrice() function


The right link and I could use it. Thank you.
 
Reshetov:
See https://www.mql5.com/ru/forum/131859/page6#434260


GetExtremumZZZPrice() function


Wouldn't it be simpler to create a loop by yourself, in which you sequentially loop through the candles to the past, while calling values of ZigZag through iCustom()? After all, it's simple there - if it's more than zero, then the value. If it is not empty again, then it is the second value - brekk on it (well, this is if the last two are needed). Then see which one is higher than the other. If the first is higher than the second, it's the arrow drawn upwards. In my opinion, this is much easier than trying to dig into someone else's function code.
 
artmedia70:
Have a look at tester's log. I am sure you will see Zero Divide entry. If so, look for division by zero in the code and you'll be happy.


Here is the log:

2011.11.27 16:12:29 2010.01.11 05:20 Tester: order #1 is closed
2011.11.27 16:12:29 2010.01.11 02:40 channel_err RTSI,Daily: open #1 buy 1.00 RTSI at 1498.23 sl: 1403.37 tp: 282172.43 ok
2011.11.27 16:12:29 2010.01.11 02:40 channel_err RTSI,Daily: Alert: buy 1 lots worth 1216 (121.6%) With leverage = 1.2
2011.11.27 16:12:29 2010.01.11 02:40 a_max_example RTSI,Daily: loaded successfully
2011.11.27 16:12:29 2010.01.11 02:40 channel_err RTSI,Daily: Alert: Last order was null. TREND trading
2011.11.27 16:12:29 2010.01.11 00:00 a_max_example_median RTSI,Daily: loaded successfully
2011.11.27 16:12:29 channel_err inputs: trstop=30; trstEp=0.5; Buy=24; Sell=10; risk=4;
2011.11.11.27 16:12:29 Tester: exchange rate cannot be calculated
2011.11.27 16:12:29 Tester: exchange rate cannot be calculated
2011.11.27 16:12:29 TestGenerator: unmatched data error (low value 1845.0000 at 2011.01.28 00:00:00 is not reached from the lowest timeframe, low price 1845.8900 mismatches)
2011.11.27 16:12:29 TestGenerator: unmatched data error (high value 1900.4000 at 2011.01.28 00:00 is not reached from the lowest timeframe, high price 1900.0400 mismatches)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 38599 at 2010.05.11 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (high value 1653.6300 at 2010.04.04.13 12:05 and price 1653.7600 mismatched)
2011.11.27 16:12:29 TestGenerator: unmatched data error (low value 1641.2200 at 2010.04.12 12:05 and price 1641.2100 mismatched)
2011.11.27 16:12:29 TestGenerator: unmatched data error (high value 1636.0400 at 2010.04.09 00:00 is not reached from the lowest timeframe, high price 1632.9900 mismatches)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1869 at 2010.04.09 00:00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1869 at 2010.04.09 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1869 at 2010.04.09 00:00 exceeded)
2011.11.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1869 at 2010.04.09 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1869 at 2010.04.09 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1457 at 2010.04.08 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1457 at 2010.04.08 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1457 at 2010.04.08 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1457 at 2010.04.08 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1457 at 2010.04.08 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.07 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.07 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.07 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.04.07 00:00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.07 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.07 00:00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.07 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.07 00:00 exceeded)
2011.11.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.07 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (volume limit 1720 at 2010.04.07 00:00 exceeded)
2011.11.27 16:12:29 TestGenerator: unmatched data error (low value 1561.1500 at 2010.03.31 00:00 is not reached from the lowest timeframe, low price 1568.3100 mismatches)
2011.11.27 16:12:25 channel_err: loaded successfully

Thanks in advance for the tips.

 
Hi all, I have a question, let's say I wrote an EA that trades on several currency pairs at the same time. But how to test it now, because in the strategy tester you can use only one currency pair (mt4), what to do in such cases, how to circumvent this problem?