Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1123

 
Evgeniy Oshurkevich:
Greetings all! Can you please advise me, is it necessary to register error handling functions in an EA? And what will happen if I don't add these functions? I read somewhere that they should be implemented. I have a pile of recently created EAs without these errors, and they work fine in tests and demos.
Check for errors should be done, at least for critical ones. You may encounter situation when EA starts to bombard the server with requests and the server returns the error and simply disconnects auto-trading in your account after frequent request. Errors can be different, for example, "close stops" or "not enough funds".
 
Vitaly Muzichenko:
It is desirable to check for errors, at least for critical ones, there may be a situation where the Expert Advisor starts to bombard the server with requests, and the server returns an error, and if frequent requests simply turn off auto-trading in the account. Errors can be different, for example, "close stops" or "not enough funds".
i did not even think about it, i feel ashamed))) Thanks)
 

Hi all, I apologise in advance if I am writing in the wrong topic. 1) Please tell me if I want to subscribe to the signal and my broker and my provider's brokers do not coincide, is there any way to subscribe? Or is it compulsory to have the same brokers? (2) I want to subscribe to the signal and my Provider's deposit does not coincide. Provider's deposit is 10 times bigger than mine and he works with 0.10 lots, therefore, my signal opens 0.01. Can I set it manually to open more volume, say, 0.02 or 0.03? I can manually adjust the volume to open more, say 0.02 or 0.03? Thanks.

 
Hello. Please help me to write an EA. At price X I need to check if there are any open positions to buy or pending orders to buy. If not, then open a pending buy order with stop loss and take profit parameters. And the second check only positions on sale and pending orders on sale. If not, we open a pending sell order. And the second question ... Where to prescribe the opening of orders when first running the EA - once
 
pajaxander:

Hi all, I apologise in advance if I am writing in the wrong topic. 1) Please tell me if I want to subscribe to the signal and my broker and my provider's brokers do not coincide, is there any way to subscribe? Or is it compulsory to have the same brokers? (2) I want to subscribe to the signal and my Provider's deposit does not coincide. Provider's deposit is 10 times bigger than mine and he works with 0.10 lots, therefore, my signal opens 0.01. Can I set it manually to open more volume, say, 0.02 or 0.03? I can manually adjust the volume to open more, say 0.02 or 0.03? Thanks.

You do not need to adjust them to be the same, but you'd better adjust them to be the same for the best speed of copying. The lot is adjusted in the signal settings
 
FullH:
Hello. Please help me to write an EA. At price X I need to check if there are any open positions to buy or pending orders to buy. If not, then open a pending buy order with stop loss and take profit parameters. And the second check only positions on sale and pending orders on sale. If not, we open a pending sell order. Second question ... Where do I prescribe the opening of orders when I first run the EA?
Look here, all the functions you need are available in the libraries.
Автоматизация торговли на финансовых рынках - Главная
Автоматизация торговли на финансовых рынках - Главная
  • www.kimiv.ru
Что нового по сравнению с версией 1.4? stSender. Изменена процедура записи файлов под требования билда 610 и выше. stReceiver. Функции проверки существования файла и копирования файлов заменены на аналогичные, поддерживающие UNICODE (для работоспособности в билде 610 и выше). Разработан и доступен для покупки новый советник e-Reverser...
 
Vitaly Muzichenko:

I have this function and it works in an EA/script

double cLot(double Percent, string symbol, ENUM_ORDER_TYPE action=ORDER_TYPE_BUY)
  {
   double One_Lot=0.0;
   double price=0.0;
   double volume=0.0;
   double MinLot=SymbolInfoDouble(symbol,SYMBOL_VOLUME_MIN);
   double Free=AccountInfoDouble(ACCOUNT_FREEMARGIN);
   double Step=SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP);
   if(action==ORDER_TYPE_BUY)price=SymbolInfoDouble(symbol,SYMBOL_ASK);
   if(action==ORDER_TYPE_SELL)price=SymbolInfoDouble(symbol,SYMBOL_BID);
   if(!OrderCalcMargin(action,symbol,1.0,price,One_Lot))return(MinLot);
   if(One_Lot!=0 && Step!=0)volume = MathFloor(Free*Percent/100.0/One_Lot/Step)*Step;
   if(volume!=0)return(volume);
   return(MinLot);
  }

Question:how to get the maximum possible lot in the indicator,OrderCalcMargin does not work in the indicator for some reason? In mt4 the"MarketInfo(symbol,MODE_MARGINREQUIRED)" works fine, in mt5 it doesn't, but there is some fragment ofthe OrderCalcMargin that does not work in the indicator

Thank you!

You know this is an MT4 thread, you don't need to drag MT5 questions over here )))

There is noOrderCalcMargin() in MT4, there isAccountFreeMarginCheck()

 
Hi all. Please help me find an EA which puts a stop on price and not on a pips from price. Thanks in advance!
 
Anton Govorukhin:
Hi all. Please help me find an EA which puts a stop on price and not on a pips from price. Thanks in advance!
You would set a stop by price. Only the points are multiplied by _Point and added to the current price. But no one forbids specifying a particular price.
 
Alexey Viktorov:
This is how anyone sets a stop on price. Only the points are multiplied by _Point and added to the current price. But no one forbids specifying a particular price.
We have to set a stop for all open orders at a specified price. For example, we open three orders and the stop price, say, 1.32511, is already specified in the Expert Advisor. This is what we need)
Reason: