[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 451

 
7777877:
My goal at this stage is to understand how this or that function works, and in this particular case, how the ArrayGetAsSeries function works. I understand that you can use ArraySetAsSeries function with parameter set=true, which forcibly sets indexing, like in array-timeseries. But I want to understand, why in my case function ArrayGetAsSeries returned 0, despite array looks like timeseries (i.e. indexed like timeseries)

Precisely because it only EXPLAINS as a timeseries.

This is only your Personal opinion. And if you put numbers 1, 2, 1.2, 2.1 in there, you get a timeseries for 1927 pork (numbers are conditional). But this doesn't make the array a timeseries - you need to specify it explicitly with the function

 
TarasBY:

I wonder how you managed to get anything into the log if the code you presented doesn't compile?

Ah, if you compile it, you won't get any weirdness.

I gave you the original version above, which of course compiles. I have a question. Why did you replace lines:

      price1 = iMA(Symbol(),i_maTF,i_maPeriod,i_maShiftByPrice,i_maMethod,i_maPrice,i_shiftBarsBack1+i);       // Цена в точке А
      price2 = iMA(Symbol(),i_maTF,i_maPeriod,i_maShiftByPrice,i_maMethod,i_maPrice,i_shiftBarsBack2+i);       // Цена в точке В

i_maTF toPeriod(). Am I wrong?

The documentation says that when calculating the moving average:

double iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)

timeframe i.e. my variablei_maTF( Period. Can be one of the chart periods. 0 means the period of the current graph.) I had 0 specified.i_maPeriod isnot mentioned.Please clarify!

 
Reshetov:
Ctrl+t and a table of all open positions appears at the bottom if you switch to the "Trade" tab.

I can see that you are missing the point. What is needed is clarity. There is no current price in the Trading section and only one order is visible on the chart on one level, all the others are closed by it. I don't need many, two orders on one level are enough, but they should be visible at the same time.
 
hoz:

I always get everything compiled normally.

I cleaned the code of extra printers and variables, so as not to confuse anyone. But I didn't remove them below, so it didn't compile. Here's the full code that compiles:


I think I've got it, if you use a tester and change extern parameters in "Expert properties" settings do a "Reset". Do it anyway))

 
Question. There is a variable string word="abc 5&"; . Please advise or provide a link:
1) how would one determine how many characters are in this word (6 in this example),
2) how can I copy characters of the word into one-dimensional array, e.g. to get a string array[6]={"a", "b", "c", "", "5","&"};
My task is to determine which characters and in what place are in the variable string. Thanks in advance.
 
paladin80:
Question. There is a variable string word="abc 5&"; . Please advise or provide a link:
1) how would one determine how many characters are in this word (6 in this example),
2) how can I copy characters of the word into one-dimensional array, e.g. to get a string array[6]={"a", "b", "c", "", "5","&"};
My task is to determine which characters and in what place are in the variable string. Thanks in advance.
https://docs.mql4.com/ru/strings Everything is in the documentation though.
 
Sepulca:
https://docs.mql4.com/ru/strings Everything is in the documentation, though.
Thank you very much, I didn't see it that way. :)
 
What should I write instead of Symbol() to make the code work only for a specific pair, "EURUSD" doesn't work, because the script doesn't work if a chart is opened with a different symbol...
 
yellownight:
What should I write instead of Symbol() to make the code work only for a specific symbol, "EURUSD" is not suitable, because the script doesn't work if a chart is opened with another symbol...
Symbol()
 
hoz:
Symbol()
inside the brackets? What should it look like if it's inside the brackets? I don't understand.
Reason: