Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 936

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
Tried it. Can't see it yet. I'll try again.
Is it really necessary to make such a distortion of the indicators? Wouldn't it be easier to shove everything into the Expert Advisor?
Over time, the Expert Advisor will become encumbered with additional conditions for correct operation and will become inflexible.
(Maybe, it's a perversion. We Russians do not look for easy ways:)
How can "Market is closed" be defined in EA?
Good day!
How can you define "Market is closed" in Expert Advisor?
Why would you want to do that? If the market is closed, there will be no ticks, and therefore the Expert Advisor will not work.
But if you really need it, try this.
MarketInfo(Symbol(), MODE_TRADEALLOWED);
If the market is open, it returns 1. If the market is closed, it should return 0.)
Here's the thing - I need to determine the minimum and maximum price value of the last 100 bars, for example, and then fix the rise/decline when the price goes down/up, so I can draw a reversal pattern like 1 2 3. I cannot understand the difference between ArrayMaximum and iHighest functions. If I understand correctly, the result of their calculations will be only the index of the maximum bar in the specified interval of the array? Is it necessary to use the for operator when working with arrays for calculations, as in the example in question 26 from the textbook? I have changed this code to the following one
Why would you want to do that? If the market is closed, there will be no ticks, and therefore the Expert Advisor will not work.
But if you really need it, try this.
If the market is open, it returns 1. If the market is closed, it should return 0.)
For information. I need to calculate time between ticks.
I use OnTimer().
Here's the thing - I need to determine the minimum and maximum price value of the last 100 bars, for example, and then fix the rise/decline when the price goes down/up, so I can draw a reversal pattern like 1 2 3. I cannot understand the difference between ArrayMaximum and iHighest functions. If I understand correctly, the result of their calculations will be only the index of the maximum bar in the specified interval of the array? Do calculations require use of for statement when working with arrays, like in the Textbook Problem 26? I changed this code to the following one
If you want to trade by these signals, you shouldn't. If you learn to program, write it correctly.
double
If you want to trade on these signals, don't. If you learn to program, write correctly.
Started to learn how to work with files. I came across the term handle. The question arose after writing the code:
After opening the first news.csv file, the program set the filehandle variable to 1. Next, the program opened the second news150901.csv file and set the filehandle variable to 2. It turns out that the program is now left with a handle value only from opening the second file. In other words, I killed the handle value for the first opened file. I.e. I can only access the data/content and close the second file? Is using one variable to store the handle of the open file a mistake? Is it a mistake to use one variable for storing the handle of the open file?
Started to learn how to work with files. I came across the term handle. The question arose after writing the code:
After opening the first news.csv file, the program set the filehandle variable to 1. Next, the program opened the second news150901.csv file and set the filehandle variable to 2. It turns out that the program is now left with a handle value only from opening the second file. In other words, I killed the handle value for the first opened file. I.e. I can only access data/content and close the second file? Is using one variable to store the handle of the open file a mistake? Is it necessary to create a variable for the handle for each file to be opened?
When you open a file, you get an "access code" to it - a handle. As long as you have not closed it, you can work with the file through its handle, regardless of whether the other files are open or not.
P.S. Don't forget to close files (they are not closed in the example).