[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 453

 

Good afternoon!

If a pending order is triggered by a script, how can I detach this script from the tool window?

Thank you in advance.

 
baltik >>:

НЕТ

Скрипт при исполнении делает файл с историей в папку ексерт\филес\ имя файла (это номер счета)

Все очень просто скрипт на 3 терминалах исполняется скажем в 6 утра автоматом

Значит нам не надо открывать терминалы - отрываем базу и новые данные уже в ней подхвачены готовые к анализу (это уже реализовано)

% деятельности с посчитанными свопами, сводными таблицами и графиками и т.д.

No script can open the terminal!

So if you want it to work, it must be on a terminal that is open and connected to the net. It will run at the required time and record the data. But the terminals must always be switched on.

 
Aleks25 >>:

Добрый день!

Как сделать, если сработал отложенный скриптом ордер, чтобы этот скрипт отсоединить от окна инструмента?

Заранее благодарен.

the script is executed once on the graph and does not require manual disconnection.

 
sergeev >>:

скрипт выполняется на графике один раз и не требует ручного отсоединения.

Unfortunately, if it is not disconnected from the window, when the previous order is closed it opens the next order.

 
is it a script or an expert?
 
By code a script, but is in the experts' directory.
 

Here is its code

Shifts the pending order on price change


//--------------------------------------------------------------------
extern double OTSTUP_BUY = 7;
extern double TakeProfit = 100;
//extern double BuyStop = 0;
//extern double StopLoss = 0;
extern double Lots = 0.01;
//extern double TrailingStop = 21;

double min =100000;
double
lmax, // Threshold price, after it is passed
// we consider selling (abs)
lmin, // Same for Buy
Lot;

int Count=0;
int total=0;
int Ticket=0; // Global variable.
//--------------------------------------------------------------------
int init() // Special init()

{
int total=OrdersTotal(); // only open orders
string Symbol1=Symbol();
double metka=0;
for(int pos=0;pos<total;pos++)
{
if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)==false) continue;
{
if(OrderSymbol()==Symbol())
{
metka=1;
Alert("Order #", OrderTicket(), " in ", OrderSymbol());

}
else
{
}
}

}

if(metka==0 )
// if(metka==0 && UROVEN>=Ask)

{

double bid =MarketInfo(Symbol(),MODE_BID); // Request Bid value
double ask =MarketInfo(Symbol(),MODE_ASK); // Request Ask value
double min =MarketInfo(Symbol(),MODE_ASK); // Request Ask value
double point =MarketInfo(Symbol(),MODE_POINT)//Query Point
OrderSend(Symbol(),OP_BUYSTOP,Lots,bid+OTSTUP_BUY*Point,3,bid-1*Point,bid+TakeProfit*Point);
int Ticket=OrderTicket();
//OrderSend(Symbol(),OP_BUYSTOP,Lots,BuyStop,3,StopLoss,TakeProfit, "Bye Stop 1");
Alert (Ticket); // Error message
// Alert (Symbol()," ",OP_BUYSTOP," ",0.01," ",ask+10*Point," ",3," ",ask-35*Point," ",ask+35*Point);
Alert (GetLastError());
}


return; // Exit init()
}

//--------------------------------------------------------------------
int start() // Special. function start()
{
if(min>Bid) min=Bid;
{ // Count min price




int total=OrdersTotal(); // only open orders
string Symbol1=Symbol();
for(int pos=0;pos<total;pos++)
{
if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)==false) continue;
{
if(OrderSymbol()==Symbol())
{
Alert("Order #", OrderTicket(), " in ", OrderSymbol());
Alert (min);
OrderModify(OrderTicket(),min+OTSTUP_BUY*Point,min-1*Point,min+TakeProfit*Point,0);//Modify
Alert (GetLastError());
Alert(Symbol(), "",OrderTicket()), OrderTicket()," ",min+OTSTUP_BUY*Point," ",min-1*Point," ",min+TakeProfit*Point," ",0);
}
}
}



}
return; // Exit init()
}

//--------------------------------------------------------------------
int deinit() // Special. f-iia deinit()
{
// Alert ("Deinit() f-iia triggered on unloading"); // Message
return; // Exit deinit()
}
//--------------------------------------------------------------------

 

string iii[];

iii[0] = "1";
iii[1] = "2";
iii[2] = "3";

MessageBox(iii[0]);
MessageBox(iii[1]);
MessageBox(iii[2]);
outputs the number 3 three times! instead of the proper 1, 2, 3.... WTF?

thanks!

 
I guess the problem is that I did not specify the number of elements in the array. But what if the number of elements is initially unknown and the array is filled in the loop? (in my case, when reading from a file)
 
mrddt >>:
догадываюсьчто проблема в том что я не указал кол-во элементов в массиве. а что делать если кол-во элементов изначально неизвесно и массив заполняется в цикле? (в моём случае при чтении из файла)

ArrayResize

Reason: