[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 452
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
But the indicator header also needs to be edited. All buffers should be able to store the value
And it would be nice to calculate the history, but it is of course a matter of taste. And to work with objects more correctly. On each tick objects with the same names are created (or create an error).
I fixed the header.
with a buffer:
Got it.
Thank you very much for the help.
As for your suggestions, I'd like to make them, but I can't do them myself, unfortunately.
Try to put into words what you have written here:
Personally, at the very first glance I found your conundrum: If one is not equal to one, then close the order...
I did not look at the rest after that...
SZY and don't try, don't even think, that it is possible to write a good EA in one cycle...
Here is the idea:
Market entry point : at any time, if there are no pending, much less open positions.
The robot opens 2 pending positions, with equal distance in pips from the current price (this is a custom variable PriceDistance).
The pending orders both with the same TP, SL, TS (as in the mirror image of the current price.
And both for the same time (in perspective the "TimeStop" variable).
All....
In practice: previous positions are closed (either both with expiration time, or on the SL or TP - it does not matter), the terminal is released, immediately after that the same positions are opened with the same parameters, but, starting from the current price, in a new range. Further on, according to the cycle.
The idea is primitive, 100% pluator, but I plan to move in this direction and connect it to other signals, for example Volumes at certain values at certain timeframes....
That's why I need the software in a hurry....
So I set myself the task of writing it...
Good evening! I have written a simple construction for calculating available profit on each tick. Well, it doesn't work! I looked at it with my eyes for 10 minutes. I don't see the error. Magik's code is right. I checked it four times. The brackets, everything I could think of, everything seems to be right. Maybe I am writing/comparing wrong order? I looked at the reference. Help me please! I cannot do it without you! Can you tell me what could be wrong?
A few brackets are missing.
This seems to be the case. Although it's better to keep it simple.
I have this question - in MT4: ( 2/3*9 == 2*9/3) ?
Thank you!
I have this question - in MT4: ( 2/3*9 == 2*9/3) ?
Thanks!
What's the point?
Check with a calculator - you will find out.
See the documentation - how expressions are calculated.
You should at least read a textbook...
"It is easy to see that the order of calculating expressions in a program is similar to the order of similar calculations in mathematics, but differs in calculating types of values of intermediate expressions, which significantly affects the final result of the calculations. In particular (in contrast to rules accepted in mathematics), the order of operands in an expression is of no small importance. To show this, let's take a little example. Problem 6: Calculate the values of expressions A/B*C and A*C/B for integers A, B and C.
Intuitively, it is expected that the result of calculations in both cases will be the same. However, this is only true for real numbers. When calculating the values of expressions composed of integer operands, the intermediate result is very important. In such a case, the sequence of operands is of fundamental importance:
Let us trace the process of calculating the expression A/B*C:
1. First (from left to right) the value of expression A/B will be calculated. According to the above rules the value of expression (3/5) will be integer value 0 (zero).
2. Calculate the expression 0*C (zero multiplied by C). The result is integer value 0 (zero).
3. The overall result (value of Res_1 variable) is an integer value of 0 (zero).
Now let's see how events develop when calculating the expression A*C/B.
1. Calculating A*C. The value of this expression is integer 18 (3*6=18).
2. Calculation of the expression 18/B. The answer is obvious: (18/5) after discarding the fractional part, the result will be an integer 3 (three).
The total result (value of Res_2) is integer 3 (three).
This example shows a small fragment of program that calculates the values of variables of integer type. If we replace these variables with constants, but use the same values, the final result will be the same. When calculating expressions, in which integers are used, you should be very careful with the contents of program lines. Otherwise, an error may occur in the program, which is very hard to detect later (especially in large programs). This problem does not occur in case of calculations, in which only real numbers are involved. However, if you use operands of different types in a complex expression, the final result may depend entirely on a randomly generated fragment containing division of integers.
The concept and general properties of operators are discussed in the section Operators, and the chapter Operators reveals the eigenproperties of each operator."
What's the problem?
Check with a calculator - you'll find out.
I checked - both Casio and even the Microsoft calculator say that 2/3*9=6.
Checked - both Casio and even the Microsoft calculator say 2/3*9=6.
Well. What's the problem?