[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 323

 
okvseok:
Why, if I set Stoploss value 15 or another number in OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3,0,Bid+Take_Profit*Point,"",MAGICMA,0,Blue); then buy is not opened?


The reason is that you have to specify there the price of stoploss, but not its size in points. So, for example, if the price of setting an order = 1.2098 (ask) and Bid = 1.2095 and stop loss = 15 pips, you should set the Bid price minus 0.0015. That is, Bid minus 15*Point = 1.2080

And you should also check to make sure that the size of the stop matches the minimum acceptable level for placing stop orders. And be sure that your brokerage company allows you to place orders together with stop orders.

 
drknn:

This is just information - the previous successful authorisation (access to the account) was from the IP address 109.68.....
Thank you, another question please: the EA is running simultaneously on 29 instruments, i.e. on 29 respective terminals on a shared account. I need to make the total number of open positions never exceed 30. I had put such a limit to the EA and thought it would be counting by the total magic number but it did not, it still put more than 30 orders. It seems that I gave a wrong instruction and the EA took it as 30 orders per symbol. What should I do? I am still following it visually.
 
If the EA was not originally designed as a multi-currency EA, you probably have a magik and a symbol filter. Allow only one order per EA.
 
yosuf:
Thank you, another question please: the EA is running on 29 instruments simultaneously, i.e. on 29 corresponding terminals in a common account. I need to make sure that the total number of open positions never exceeds 30. I had put such a limit to the EA and thought it would be counting by the total magic number but it did not, it still put more than 30 orders. It seems that I gave a wrong instruction and the EA took it as 30 orders per symbol. What should I do? I am still following it visually.

As we say in Odessa, there are two big differences between 29 symbols in one terminal and 29 terminals with one symbol in each. I do not know about you :)
 
The difference is the multiplicity of threads (ability to open multiple orders simultaneously) the rest is business as usual
 
FAQ:
The difference is in multiple threads (ability to open multiple orders simultaneously) the rest is the same as usual

... and - the cause of the problem of the author of the question.
 
Yusuf, do the same in one terminal opening 29 tool windows. When it starts working adequately, make the architecture more complex if necessary.
 
FAQ:
The difference is in the multiple flows (the ability to open multiple orders simultaneously) the rest is as usual

If we set one order at a time, then the "fast" instruments, which would be able to open orders more often, would lose that opportunity. Moreover, 8 other instruments are now waiting for an opportune moment and now they should queue to open, I had to close 10 excessive positive orders urgently:


 
Then you need to change the logic. For a start, remove the character filter.
 

Now I'll ask and the thread will go back to its original place!

Here is a question: I sometimes get the Common error(2) when a position is closed by Stop Loss and the EA tries to close it by Close. The function allows 3 attempts to close the position, so it tries up to 3 times and gets Invalid ticket(4108) twice. How do I make it stop trying? The ticket has not been opened among other orders and there is no any other position, but we still get the same result.

And these attempts are sent to DC or not? Maybe, it remains only on the terminal and I do not bother DC for nothing? Thanks in advance for the clarification!

Reason: