[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 572
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 to create an EA based on a coin, heads buy, tails sell. But it doesn't work. When testing in a window there is an inscription: When opening the order error 131, in the application looked - it is not the correct volume. I looked carefully, I cannot find any error. There is a dot everywhere, to separate the integer part, not a comma. Please help. The code is in the file.
Tried to create an EA, based on coin, eagle buy, tails sell. But it did not work. When testing, I got the following message in the window: Error 131 when opening order, I looked it up in the application, it is not correct volume. I looked carefully, I cannot find any error. There is a dot everywhere, to separate the integer part, not a comma. Please help. The code is in the file.
use:
MinLot= MarketInfo( symbol(),MODE_MINLOT )// Minimum possible lot size
StepLot= MarketInfo( symbol(),MODE_STEPLOT )// Minimum step of lot change
Lot should be >= MinLot and normalized using Lot=NormalizeDouble(Lot,Dig);
where Dig = Num_of_digits_after_pecimal point StepLota, i.e. StepLot=0.01 - Dig=2 ... StepLot=0.1 - Dig=1 .....
For example, with MinLot=0.1 and StepLot=0.01:
Lot can be 0.1, 0.11,0.12 etc. But it cannot be 0.99, 0.98 and it certainly cannot be 0.998,0.999, 0.111, 0.101.
use:
MinLot= MarketInfo( symbol(),MODE_MINLOT )// Minimum possible lot size
StepLot= MarketInfo( symbol(),MODE_STEPLOT )// Minimum step of lot change
Lot should be >= MinLot and normalized using Lot=NormalizeDouble(Lot,Dig);
where Dig = Number of_digits_after_pecimal point StepLota, i.e. StepLot=0.01 - Dig=2 ... StepLot=0.1 - Dig=1 .....
For example, with MinLot=0.1 and StepLot=0.01:
Lot can be 0.1, 0.11,0.12 etc. But it cannot be 0.99, 0.98 and moreover it cannot be 0.998,0.999, 0.111, 0.101.
For example, with MinLot=0.1 and StepLot=0.01:
Lot can be 0.1,0.11,0.12 etc. But it cannot be 0.99, 0.98.
No way... really?
88 or 89 times increase the lot by the minimum step. For example - the lot of each subsequent position opened must be increased by the minimum step. I.e., bluntly add the minimum lot change step to the lot of the previous position. The 98th position to be opened will have the lot 0.98, respectively, the lot of the 99th position will be increased by a minimal step 0.98+0.01=0.99...
Doyou think DT will not let open with such a lot?
For example with MinLot=0.1 and StepLot=0.01:
Lot can be 0.1, 0.11,0.12 etc. But it cannot be 0.99, 0.98
No way... really?
88 or 89 times increase the lot by the minimum step. For example - the lot of each subsequent position opened must be increased by the minimum step. I.e., bluntly add the minimum lot change step to the lot of the previous position. The 98th position to be opened will have the lot 0.98, respectively, the lot of the 99th position will be increased by a minimal step 0.98+0.01=0.99...
Do you think that brokerage companies will not allow opening with such a lot?
Damn it .... wrong of course. it can't be 0.09, 0.08.
And stupid or not stupid - is up to the EA writer to decide.
No, of course I have to open with a buy or sell order at the opening of the next or one of the following bars. And I also plan to close by an order, assigning it by the number of points from the opening.
Later (at weekend) I will post here the code for opening market order - either buy or sell (at your choice), at opening of a new candle.
use:
MinLot= MarketInfo( symbol(),MODE_MINLOT )// Minimum possible lot volume
StepLot= MarketInfo( symbol(),MODE_STEPLOT )// Minimum step of lot change
Lot should be >= MinLot and normalized using Lot=NormalizeDouble(Lot,Dig);
where Dig = Number of_digits_after_pecimal point StepLota, i.e. StepLot=0.01 - Dig=2 ... StepLot=0.1 - Dig=1 .....
For example, with MinLot=0.1 and StepLot=0.01:
Lot can be 0.1, 0.11,0.12 etc. But it can't be 0.99, 0.98 and much less 0.998,0.999, 0.111,0.101
By the way, I don't intend to use this Expert Advisor, I'm just learning the programming language. In fact, I decided for fun to see how it will work on the tester, I just read that the random number generator does not give out such random numbers, as it repeats itself. The problem doesn't seem to be in the misspelling of the number but in the algorithm, just what is the problem?
Help with a problem.
The question is this: I have an owl martin, opens knees after a given number of points, but with a new majik. It turns out the signal opens one or three orders with majic = 1, then minus the next knee on a signal2 open one or three orders with a majic 2 and so on.
So every knee goes on 1-3 orders with its own majic.
Now the point of the question is how to calculate in a loop the orders of each majic, for example, I tried to do it this way
How about this:
I didn't check it, I drafted it on my knee...
How about this:
Didn't check it, just sketched it out on my knees...