[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 368
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
Good afternoon!
I have a task, it seems easy at first glance, but it doesn't work. There is an array in which the values are always in a row (in some cases the values may go in ascending order, in other cases - in descending order). There is some level (red in the picture). You need to find the two array values that are closest to the red line level. In figure a) these will be array values with indexes 0 and 1. In figure b) these will be array values with indexes 2 and 1. In figures c) and f) these will be array values with indexes 0 and 0. In figures d) and e) these will be array values with indexes 2 and 2.
Please tell me how to solve this problem. Thank you in advance.
Then don't bother at all - just move the code of the indicator to the Expert Advisor as it is to fulfil trading criteria and that's it - then in the board using these transferred trading conditions from this indicator you open positions through the Expert Advisor and that's it...
Thanks, I'm sorting it out :)
You're welcome... Everyone's been through it. :-)
Today is Saturday - day off. You start EA, initialization happens, but since it's day off and there is no tick, the start function is not started (i.e. Trade() is not called.). To check if it works correctly, you need to stick the call of this function in the initialization block, or test it in the tester.
After substituting this function in Init() and adding the check code Print(DayOfWeek()) it turned out that the time was taken from the server, and the server's time was Friday...
Replaced
to
and it worked as intended.
Thank you.
Hello, comrades!
Faced an unexpected problem.
The day before yesterday the tester was working as it should. Since yesterday evening, any version of the strategy in the tester opens one trade and after a second, or a few minutes/hours of history, the tester stops working. No errors, nothing.
Anybody have a problem with it? Please advise
Hello.
Please help me find the error.
Below is the problematic section in its entirety, excerpted from the EA.
Please pay attention to the line (almost at the very beginning):
For some reason, when dy+zx and SchSellStopLots100 values are equal separately (I checked with allerts) in this expression they are no longer equal to each other, and the variable tt takes value 1 instead of 2.
I ask you to help me find the flaw.
Thank you in advance.
(checked with allerts)
Better check via ND or differences modulo less than some delta.
For some reason, adding dy and zx gives a number 0.3 (in my particular test of the current market situation) when compared to this number does not equal it. That is, I add dy+zx and get 0.3. I compare dy+zx with 0.3 - they are not equal.
Comparing dy and zx with numbers they return - equals work as they should.
Riddle.
Please help.
Hello, comrades!
Faced an unexpected problem.
The day before yesterday the tester was working as it should. Since yesterday evening, any version of the strategy in the tester opens one trade and after a second, or a few minutes/hours of history, the tester stops working. No errors, nothing.
Anybody have a problem with it? Please advise