Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 446
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
Dear, I need some help.
I took the code for accounting, opening and closing orders from the tutorial (tradingexpert.mq4). The code is intended to work with one position. I need to have five positions.
We have slightly modified the code in the following way (changed lines in bold), so that the positions are opened in the right amount, but when we reverse, only one position is closed and the reverse one is opened right away.
How can I make it so that all positions are closed at the reversal and then only the opposite position is opened?
You can't be considered a beginner by the level of use of the libraries. Having looked at your code, it would take me two weeks to figure it out. If not more. So I think you won't get an answer.
I am not a progamer, I am a code builder. So I built this indicator (I see that you can do a text exposition, not a file t-that's what I will do to make it easier to understand.
It shows the sum of points and the dynamics of their summation during the week - at smaller timeframes, if the previous movement continues from Close[i+2] to Close[i+1] the current movement Close[i] is added, if against - is subtracted. I should prescribe it so the program should see Friday's close- instead of close the bar-. I know it can be done with DayOfWeek and 5 (Friday's number), but how can I do it practically? Help.
Vitya, nothing needs to be sorted out here - the person wants global variables from one sandbox (EA with its libraries) to be visible in another sandbox (compiled library). :)))
Igor, a little bit wrong! In the "sandbox" (compiled library) only functions, and all variables are declared in the inluder. And the variables which are declared in the inluder (include file) should be visible in the owl, because I have inserted the inluder directly into the owl. Do you disagree?
I am not a progamer, I am a code builder. So I built this indicator (I see that you can do a text exposition, not a file t-that's what I will do to make it easier to understand.
It shows the sum of points and the dynamics of their summation during the week - at smaller timeframes, if the previous movement continues from Close[i+2] to Close[i+1] the current movement Close[i] is added, if against - is subtracted. I should prescribe it so the program should see Friday's close- instead of close the bar-. I know it can be done with DayOfWeek and 5 (Friday's number), but how can I do it practically? Help.
Will it suit?
Igor, a little wrong! Only functions are in the sandbox (compiled library), and all variables are declared in the inluder. And the variables which are declared in the inluder (include file) should be visible in the owl, because I have inserted the inluder directly into the owl. Don't you agree?
Is that all right?
No it does not. I will explain - your forum is like a hope for the last competent stronghold of prog. and insertion of size - that's how the writing PERIOD_W1 sees itbut neither use of size nor use of fixed datums as dates get any desired effect. I posted a specific question about Friday - by the way your code doesn't compile because it says 'version' - unknown property, so if you don't know how to put DayOfWeek and 5 (Friday's number) into the code other options won't help .
TimeDayOfWeek(Time[i]) does not specify Time[i] but a specific date in the format D'2014.01.27'.
And if you need to determine what day it is, just call DayOfWeek().
In TimeDayOfWeek(Time[i]) you do not set Time[i] but a specific date in the format D'2014.01.27'.
And if you want to determine what day it is, just call DayOfWeek().
And where did you read that about TimeDayOfWeek () (in the example)? :)))
On the right ;)
I was wrong, I can set it in Time[] form too, but in the example it is different and more convenient ))))