Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1438
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
Please advise how best to proceed when optimising an EA:
There are many parameters that are responsible for indicator settings and there is a parameter that enables/disables this very indicator.
It makes absolutely no sense to optimise the indicator settings if it is disabled.
Question: How can I cut such meaningless overshoots?
Thanks for the help and the new information for me . But it hit me and I came up with a much simpler way....
1. While opening the first order on a minute candlestick, I store in the X variable the LOW of that candlestick at the time of opening this first order.
2. When a zero candlestick opens (the next candlestick after the one on which the order opened), I get LoY[1]
. Then I turn logic and conclude
1. If X = LoY[1], then the order was opened after the LoY of the candlestick on which it was opened
2.If LoY[1]< X, it means that the price went down one more time after the order was opened and was lower than X. It means that the order was opened before LoY[] was formed on the given candlestick
Time LOW I needed only to know when the order was opened . before or after LoY[] formation.
And all orders on one minute candle open one above the other with a difference of 2 pips. That is, when the first one opened so did the others on this candlestick.
Thanks for the help.
But I have one more question.
I opened an order on a one-minute candlestick at X price. After a few seconds on the same candlestick, another order was opened at a price of X+2 pips. Between X and X+2 there is a price low.
I need to find out the low. If we deal with different candlesticks, I would use the iLow and iLowest functions
but these functions must specify bars as interval bounds. But my interval bounds are not bars, but the X and X+2 prices because there is only one bar.
I know how to find the minimum I need. But to do it, I need to track the price value on every tick. I also know how to do it with a cycle at the time of X+2. And how to do it all at once at the time of X+2 as in the case of iLow andiLowest.
I would be very grateful if you could teach me how to do this.
Thanks
Write the ticks to a file
Thank you for the information that is new to me. I have never written ticks to a file. Where can I read more about it to understand how to do it ?
? Another question ..... can I write ticks with prices in an array, to sort the array with ticks and get the tick with the minimum price value? Or with the help of
ArrayMinimum
Thanks for the help.
Thank you for the information that is new to me. I have never written ticks to a file. Where can I read more about it to understand how to do it ?
? Another question ..... can I write ticks with prices in an array, to sort the array with ticks and get the tick with the minimum price value? Or with the help of
ArrayMinimum
Thanks for the help.
Write to the file FileWriteString
In general, it's hard to understand what you need.
FileWriteString
It's hard to know what you're looking for.
I need to find out the low. If we deal with different candlesticks, I would use the iLow and iLowest functions
but these functions must specify bars as interval bounds. But my interval bounds are not bars, but the X and X+2 prices because there is only one bar.
I know how to find the minimum I need. But to do it, I need to track the price value on every tick. I also know how to do it with a cycle at the time of X+2 . And how to do it all at once at the time of X+2 as in the case of iLow andiLowest.
I would be very grateful if you could teach me how to do this.
Thanks
Thank you for the information that is new to me. I have never written ticks to a file. Where can I read more about it to understand how to do it ?
? Another question ..... can I write ticks with prices in an array, to sort the array with ticks and get the tick with the minimum price value? Or with the help of
ArrayMinimum
Thanks for the help.
It is possible. Only it is necessary to write into .bin file by function
and read
You can. You just have to write to the .bin file with the function
and read
Thanks for the new to me information .... and not just new .... oooooooooo new ?:=) I will try to learn it myself....
Thank you for the new information for me .... and not just new .... Very new ?:=) I'll try to digest it myself....
What's new here? You open documentation, read titles, find "File operations" section where description of different functions is given, including FileWriteArray()
It is not the first time I have reminded you that you should read the documentation more often. Even if you do not need it at the moment. By reading the section headings you will understand what is described in the documentation. You are the one who needs it the most.
What's new here? Open the documentation, read the headers, find the "File operations" section where various functions are described, including FileWriteArray()
It is not the first time I have reminded you that you should read the documentation more often. Even if you do not need it at the moment. By reading the section headings you will understand what is described in the documentation. You are the one who needs it.
Thank you for the valuable advice. At the moment I'm reading documentation only when I'm writing code and I'm facing a question I don't know the answer to. I've never encountered a need to write data into files while writing my previous codes, so it's a totally new topic for me.
Tell me, can't my idea be realized in a simpler way, without writing it to a file? As in my code. This is not a working code but to illustrate my idea of how to find the minimum between two adjacent orders opened on one minute candlestick
Thanks for the help.
That is, I wrote the price of each tick directly into the array, not into a file.
Thanks for the help and the new information for me . But it hit me and I came up with a much simpler way....
1. While opening the first order on a minute candlestick, I store in the X variable the LOW of that candlestick at the time of opening this first order.
2. When a zero candlestick opens (the next candlestick after the one on which the order opened), I get LoY[1]
. Then I turn logic and conclude
1. If X = LoY[1], then the order was opened after the LoY of the candlestick on which it was opened
2.If LoY[1]< X, it means that the price went down one more time after the order was opened and was lower than X. It means that the order was opened before the formation of LoY[] on the given candlestick
You may check the time but you are waiting for a new order and then ask for the maximum or minimum tick.