[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 249

 

"T-G 10.10.2011 10:33


i have a complex function that calculates the MM and in one part of the function returns for example the maximum possible lot 0.18 and i can open either 0.1, 0.2, 0.3, i.e. step 0.1.

If I normalize the lot, it will be rounded down to 0.2 and the order is not supported, although the maximum allowed lot is 0.18. What is the correct way to round it down or to normalize it correctly?

Try to redo this function for yourself in a similar design...

P.s. The forum 'Reply' button doesn't work...

 
Professionals, please help! Installed EA on 4 currencies in one terminal, but only opens trades on 1 of the currencies. What may be the reason for this? How to get it to work on 4 currencies at the same time?
 

2T-G.

In other words, the result of calculation is as follows: Lots_New = MathFloor(0.18/0.1)*0.1;
The value of MathFloor(0.18/0.1) is 1.0, while the calculated value of Lots_New is 0.1 lots. This value corresponds to the rules set by the dealing centre, so you can use it as a declared number of lots for new orders - this is how you want it...

 

skyjet 10.10.2011 11:22

"...:-)) ... I am asking for help! I have installed my Expert Advisor on 4 different currencies in one platform, but it would open trades only on 1 of the currencies. What may be the reason for this? How to make it work for 4 currencies at the same time?

Define "simultaneity" for starters... :-))) As in any case, when orders are opened, they get in line, i.e. if an EA has the same request to open an order, one will be opened before the other.

Maybe, you have to prescribe the traded symbol in the first variable, "Symbol()" of OrderSend() fi...

 
Help me calculate drawdowns :)
Let's say I have 3 MTS, the drawdowns are about this:
1 - 10%
2 - 15%
3 - 30%
At the same time they work on one account, but
there is a limit on the number of open positions, i.e.
only one open order at a time, the risk in one trade is 3%, question :
What is the total drawdown? How to calculate it )
 

Roman! I have installed one EA on 4 currencies in one terminal. But when there is an opening signal on all currencies, the EA opens only on one of them.

I supposed that the magic-number was the problem and I have installed 4 identical EAs with different magicami on 4 currencies. I would not pay attention to the effect it had on 4 currencies but I got only 1 open order on 1 currency and the signal to open 3 of them. Thanks in advance for your help!

 

Have you tried it on the tester?

OrdersTotal() ==0 in the condition?

 
skyjet:

Roman! I have installed one EA on 4 currencies in one terminal. But when there is an opening signal on all currencies, the EA opens only on one of them.

I supposed that the magic-number was the problem and I have installed 4 identical EAs with different magicami on 4 currencies. I would not pay attention to the effect it had on 4 currencies but I got only 1 open order on 1 currency and the signal to open 3 of them. Thanks in advance for your help!

Clearly!!! write the traded instrument in the first variable - "Symbol()" of the OrderSend() fi... and replace your order opening fiure with this one.
 
Roman.:
Clearly!!! write the instrument to be traded in the first variable - "Symbol()" of the OrderSend() fi... and replace your order opening fi nd with this one.
Roman, forgive me for my incompetence in this matter, but how do you write a traded instrument in the Symbol() variable ?
 

Can you tell me why the function to close the last opened BUY order doesn't work... here's the code:

int CloselastB ()                   
{for (int i=OrdersTotal()-1; i>=0; i--)
  {if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) 
    {if(OrderSymbol()==Symbol())
      {int order_type=OrderType();
         {if(order_type==OP_BUY)
            {OrderClose(OrderTicket(),OrderLots(),Bid,3,Red);
            return ;
            }}}}}}
Reason: