[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 463

 

The DC unilaterally increased the stop out from 1-2% to 15%. Discovered it by accident. I assume that there may be some other bummer as well, like spread increase, freezing or some other changes. Has anyone seen an EA that signals Alert after any change in parameters? I will have to write one.

Gentlemen, what other data can be requested from the brokerage companies apart from the ones I have inserted in the script?

Files:
 
rosomah:

The DC unilaterally increased the stop out from 1-2% to 15%. Discovered it by accident. I assume that there may be some other bummer as well, like spread increase, freezing or some other changes. Has anyone seen an EA that signals Alert after any change in parameters? I will have to write one.

Gentlemen, what other data may be requested from brokerage companies apart from those I have inserted in the script?

It may be a normal phenomenon on Fridays before going away for the weekend... You still have a God-given percentage.

Everything should be in the trading agreement...

I haven't looked at your script, but for example, Alpari widens the spread on the news (before the weekend).

 
Roman.:

It may be normal on Fridays before you go away for the weekend... You still have a God-approved percentage.

Everything should be written in your trading agreement...

I haven't looked at your script, but for example, Alpari widens the spread on the news (before the weekend).



So I will write an EA with all possible data about my brokerage company and my account. At any move Alert will appear at once.

And I cannot find the limit number of orders I am allowed to place in my brokerage company, why should I simply place 1000 pending orders and then automatically delete them once the limit is found?

 
rosomah:


1. I am going to write an advisor where I will enter all possible data about the brokerage company and the account. At any move Alert will appear at once.

I cannot find the limit number of orders I will be able to place in my brokerage company, why should I simply charge 1000 pending orders and then automatically delete them when the limit is found?

1) Alert will not help. You have to enter these environment parameters into the code section that is responsible for executing the trade criteria, and if any of these parameters exceeds its maximum permissible value (you set it), then you have to make an appropriate decision (for example, to reject a deal... - to perform a trade operation).

2. No. You cannot do this, IMHO - read the rules and trade conditions. If not, then call tech support and phone the local chefs for ALL such questions on your type of trading account.

 

Hello.

I've been working on this code all day - it's giving out error 131. The code should go through all market orders and at each turn of the same cycle, re-read the volume of open orders for the symbol of the selected order. In case the volumes of buy and sell positions for one symbol are different, a locking order is opened for the remaining volume.

     int i;
     int ii;
     string SMB="";
     double Price=0;
     double PriceAsk=0;
     double PriceBid=0;
     double SchBuyLotsSMB=0;
     double SchSellLotsSMB=0;
     double MarketLotSMB=0;
     for (i=OrdersTotal()-1;i>=0;i--)
      {
       if (!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
        {
         Alert ("Ошибка ",GetLastError()," выбора ордера!");
         Print ("Ошибка ",GetLastError()," выбора ордера!");
        }
       else
        {
         SMB=OrderSymbol();
         PriceAsk=MarketInfo(SMB,MODE_ASK);
         PriceBid=MarketInfo(SMB,MODE_BID);
         for (ii=OrdersTotal()-1;ii>=0;ii--)
          {
           if (!OrderSelect(ii, SELECT_BY_POS, MODE_TRADES))
            {
             Alert ("Ошибка ",GetLastError()," выбора ордера!");
             Print ("Ошибка ",GetLastError()," выбора ордера!");
            }
           else
            {
             if(OrderSymbol()==SMB)
              {
               if(OrderType()==OP_BUY)
                {
                 SchBuyLotsSMB=SchBuyLotsSMB+OrderLots();
                }
               if(OrderType()==OP_SELL)
                {
                 SchSellLotsSMB=SchSellLotsSMB+OrderLots();
                }
              }
            }
          }
         MarketLotSMB=SchBuyLotsSMB-SchSellLotsSMB;
         if (MarketLotSMB<0)
          {
           MarketLotSMB=MathAbs(MarketLotSMB);
           Price=PriceAsk;
           OPENORDER ("Buy",SMB,MarketLotSMB,Price);
          }
         else
          {
           if (MarketLotSMB>0)
           Price=PriceBid;
           OPENORDER ("Sell",SMB,MarketLotSMB,Price);
          }            
        }
       SMB="";
       Price=0;
       PriceAsk=0;
       PriceBid=0;
       SchBuyLotsSMB=0;
       SchSellLotsSMB=0;
       MarketLotSMB=0;        
      }

Please help me to find the reason. 131 - I read that it has to do with a volume finding error. But I do not see it.

Thank you in advance for the answer.

 
TarasBY:
You use a strange loop in the order loop, BUT this is the author's right, then zero out the total lots (SchBuyLotsSMB and SchSellLotsSMB) before the second loop.
So I am zeroing them.
 
nemo811:

Hello.

I've been working on this code all day - it's giving out error 131. The code should go through all market orders and at each turn of the same cycle, re-read the volume of open orders for the symbol of the selected order. In case the volumes of buy and sell positions for one symbol are different, a locking order is opened for the remaining volume.

Please help me to find the reason. 131 - I read that it has to do with a volume finding error. But I do not see it.

Thanks in advance for the answer.


Where do you have the slippage? Maybe that's the reason!
 
By the way, the code works correctly if the orders are open for one symbol, and the EA itself is run on this symbol. If orders are open for 2 or more pairs, or if the EA is running on a symbol for which there are no orders, there is an error.
 
borilunad:

Where do you have the slippage? Maybe that's the reason!

Meaning?

Sleep (1000);

?

I've tried it - it doesn't work.

 
nemo811:
That's how I reset them.
I didn't notice it right away. As an option (I would do obligatory), make the normalisation of the lot value passed to the token function.
Reason: