свинья в хлеву - страница 2

 
granit77:
Замедление работы терминала по моему опыту происходит по двум основным причинам.
- накопление логов при множестве ошибок в используемых программах
- применение неоптимизированных индикаторов, советников, зацикленных скриптов, приводящее к тормозам в расчетах, утечке памяти и прочим неприятностям.
Для того, чтобы грубо определиться с причинами, посмотрите загрузку памяти в Диспетчере Виндоус, сравните скорость терминала с самодельными индикаторами и в их отсутствие, проверьте размеры логов и их содержание.

Есть и другие причины, которые могут объяснить более квалифицированные пользователи, чем я.
Я взял себе за правило периодически скачивать у брокера новую копию терминала и переносить туда вручную только проверенные программы. Старая копия архивируется и сдается на склад :))


granitt77-budu tak delatj!

BOLSHOE SPASIBO

pansa

 
more:
I cant help you, until i see any your scripts.

Hallo,xrust!

Im very glad to meet YOU-that loop script problem is very big!

il be very glad if YOU modify a old script that close the oldes order.

It mast compare the OpenTime of oldest Order with current time.

if currenttime-opentime>2Hour then close.Order that is old is

dangerous becose new situation! pansa
//+------------------------------------------------------------------+
//| close.mq4 |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| https://www.metaquotes.net// |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "https://www.metaquotes.net//"
#property show_confirm

//+------------------------------------------------------------------+
//| script "close first market order if it is first in the list" |
//+------------------------------------------------------------------+
int start()
{
bool result;
double price;
int cmd,error;
//----
if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES))
{
cmd=OrderType();
//---- first order is buy or sell
if(cmd==OP_BUY || cmd==OP_SELL)
{
while(true)
{
if(cmd==OP_BUY) price=Bid;
else price=Ask;
result=OrderClose(OrderTicket(),OrderLots(),price,3,CLR_NONE);
if(result!=TRUE) { error=GetLastError(); Print("LastError = ",error); }
else error=0;
if(error==135) RefreshRates();
else break;
}
}
}
else Print( "Error when order select ", GetLastError());
//----
return(0);
}
//+--------------------------------------------------------------

 
pansa:

Hallo,xrust!

Im very glad to meet YOU-that loop script problem is very big!

il be very glad if YOU modify a old script that close the oldes order.

It mast compare the OpenTime of oldest Order with current time.

if currenttime-opentime>2Hour then close.Order that is old is

dangerous becose new situation! pansa
//+------------------------------------------------------------------+
//| close.mq4 |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| https://www.metaquotes.net// |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "https://www.metaquotes.net//"
#property show_confirm

//+------------------------------------------------------------------+
//| script "close first market order if it is first in the list" |
//+------------------------------------------------------------------+
int start()
{
bool result;
double price;
int cmd,error;
//----
if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES))
{
cmd=OrderType();
//---- first order is buy or sell
if(cmd==OP_BUY || cmd==OP_SELL)
{
while(true)
{
if(cmd==OP_BUY) price=Bid;
else price=Ask;
result=OrderClose(OrderTicket(),OrderLots(),price,3,CLR_NONE);
if(result!=TRUE) { error=GetLastError(); Print("LastError = ",error); }
else error=0;
if(error==135) RefreshRates();
else break;
}
}
}
else Print( "Error when order select ", GetLastError());
//----
return(0);
}
//+--------------------------------------------------------------

 
pansa:

Hallo,xrust!

Im very glad to meet YOU-that loop script problem is very big!

il be very glad if YOU modify a old script that close the oldes order.

It mast compare the OpenTime of oldest Order with current time.

if currenttime-opentime>2Hour then close.Order that is old is

dangerous becose new situation! pansa
//+------------------------------------------------------------------+
//| close.mq4 |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| https://www.metaquotes.net// |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "https://www.metaquotes.net//"
#property show_confirm

//+------------------------------------------------------------------+
//| script "close first market order if it is first in the list" |
//+------------------------------------------------------------------+
int start()
{
bool result;
double price;
int cmd,error;
//----
if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES))
{
cmd=OrderType();
//---- first order is buy or sell
if(cmd==OP_BUY || cmd==OP_SELL)
{
while(true)
{
if(cmd==OP_BUY) price=Bid;
else price=Ask;
result=OrderClose(OrderTicket(),OrderLots(),price,3,CLR_NONE);
if(result!=TRUE) { error=GetLastError(); Print("LastError = ",error); }
else error=0;
if(error==135) RefreshRates();
else break;
}
}
}
else Print( "Error when order select ", GetLastError());
//----
return(0);
}
//+--------------------------------------------------------------


int start()
{
  bool result;
  double price;
  int cmd,error;
  //----
  if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES))
  {
    cmd=OrderType();
    //---- first order is buy or sell
    if(cmd==OP_BUY || cmd==OP_SELL)
    {
      while(true)
      {
        if(cmd==OP_BUY) price=Bid;
        else price=Ask;
        result=OrderClose(OrderTicket(),OrderLots(),price,3,CLR_NONE);
        if(result!=TRUE) { error=GetLastError(); Print("LastError = ",error); }
        else error=0;
        if(error==135) RefreshRates();
        else break;
      }
    }
  }
  else
  {
    Print( "Error when order select ", GetLastError());
    break;
  }
  //----
  return(0);
}
 
int start()
{
  bool result;
  double price;
  int cmd,error;
  //----
  if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES))
  {
    cmd=OrderType();
    //---- first order is buy or sell
    if(cmd==OP_BUY || cmd==OP_SELL)
    {
      while(!IsStopped())
      {
        if(cmd==OP_BUY) price=Bid;
        else price=Ask;
        result=OrderClose(OrderTicket(),OrderLots(),price,3,CLR_NONE);
        if(result!=TRUE) { error=GetLastError(); Print("LastError = ",error); }
        else error=0;
        if(error==135) RefreshRates();
        else break;
      }
    }
  }
  else
  {
    Print( "Error when order select ", GetLastError());
    break;
  }
  //----
  return(0);
}

Эта версия не будет подвешивать терминал, разве что на пару секунд, если выполняется торговый приказ.

Pansa, лучше скажите какие скрипты вам нужны для работы, вам посоветуют более новые и правильные версии.

 
TheXpert:
Эта версия не будет подвешивать терминал, разве что на пару секунд, если выполняется торговый приказ.


Hallo,TheXpert! thanks very much.

That old script work well bat i ask it modify so

that order must be not older as 2Hour.

It must compare opentime with currenttime

Also so if(currenttime-opentime>2Hour) then close.

PRIVET

pansa

 
more:
I cant help you, until i see any your scripts.
You are right, thx.
 
2 pansa может быть в этом случае есть смысл использовать не скрипты а EA в стандартном (не зацикленном режиме) ?
 
xrust:
2 pansa может быть в этом случае есть смысл использовать не скрипты а EA в стандартном (не зацикленном режиме) ?


Hallo,xrust!

i have found that "istochnik musora" it wos komming from

indicator Sultanova.But that big loop problem is actuell!

I have found that StopLoss is not so good as active order with

time limit! It must be controll of order life time!

The best thing wod be a Function that only compare

that open time from oldest order with current time!

if(current-opentimeopder>2hour)then close that order.

im oun not a programmer.

Mibe You write that.

PRIVET

pansa

Причина обращения: