sergeev>>: В принципе можно искать ордера в истории и отсортировать их, затем узнать два последних закрытия. Но это вам надо пройтись по всем ордерам истории два раза.
Другим вариантом - чтоб не сканировать два раза историю - это запоминание тикетов открывшихся ордеров и потом определения их профита.
How exactly do you memorise tickets? And how do you understand: to access a ticket, you need to select an order, and to select it, you need to know the ticket...
I'm confused with the marketinfo function and can't calculate the correct spread value for an instrument in the currency of deposit with a given lot size. Can you suggest a correct formula? I need it for both spot and CFD...
I have a question for experts - is it possible to make a constant, the first price value received when I start the Expert Advisor?
I want to save this price as a constant, so that all the time the EA is running, I can refer to it. The only question is, how to do it? Because Ask is constantly changing, and I can't find the copying function.
У меня такой вопрос к спецам - есть ли возможность сделать константой, первое полученное значение цены при запуске советника?
Т.е если я запустил советник и в это время цена Ask=1.4444 Я хочу эту цену сохранить как константу, чтобы всё время работы советника можно было к ней орбащаться. Только вот вопрос, как это сделать??? Ведь Ask постоянно меняеться, а функции копирования я нигде не нашёл.
How exactly do you memorise tickets? And how do you understand: to refer to a ticket, you need to select an order, and to select it, you need to know the ticket...
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
приведите здесь вашу функцию открытия ордеров.
int NewOrder(int Cmd,double Lot)
{double TP=0, TP2=0;
double SL=0, SL2=0;
double PR=0;
datetime endtime;
while(!IsTradeAllowed()) Sleep(100);
endtime = TimeCurrent()+4*60*60;
if(Cmd == OP_BUYSTOP)
{
PR=TOP+10*Point;
PR=NormalizeDouble(PR,2);
if(TakeProfit>0)
{
TP=PR+25*Point;
}
if(StopLoss>0)
{
SL=PR-30*Point;
SL=NormalizeDouble(SL,2);
}
}
if(Cmd==OP_SELLSTOP)
{
PR=BOT-7*Point;
PR=NormalizeDouble(PR,2);
if(TakeProfit>0)
{
TP=PR-25*Point;
}
if(StopLoss>0)
{
SL=PR+30*Point;
SL=NormalizeDouble(SL,2);
}
}
if ((TOP-BOT)<115*Point)
int tic=OrderSend(Symbol(),Cmd,Lot,PR,3,SL,TP,"",0,endtime,CLR_NONE);
else
Print("Big difference between TOR and BOT: ",(TOP-BOT));
if(tic<0) Print("Order opening error: ",GetLastError();
return(tic);
а ордер как закрывается? по стоп лосту или функцией OrderClose()
at stop loss or take profit.
Hi all...I have a question...where can I see a transaction report...total for the whole period of work...?
В принципе можно искать ордера в истории и отсортировать их, затем узнать два последних закрытия. Но это вам надо пройтись по всем ордерам истории два раза.
используйте OrderHistoryTotal(), MODE_HISTORY, OrderCloseTime()>0, OrderProfit()
Другим вариантом - чтоб не сканировать два раза историю - это запоминание тикетов открывшихся ордеров и потом определения их профита.
How exactly do you memorise tickets? And how do you understand: to access a ticket, you need to select an order, and to select it, you need to know the ticket...
А как именно запоминать тикеты? И как понимать: чтоб обратиться к тикету - нужно выбрать ордер, а чтоб его выбрать - нужно знать тикет...
you do not need to know the ticket to select an order
I'm confused with the marketinfo function and can't calculate the correct spread value for an instrument in the currency of deposit with a given lot size. Can you suggest a correct formula? I need it for both spot and CFD...
I have a question for experts - is it possible to make a constant, the first price value received when I start the Expert Advisor?
I want to save this price as a constant, so that all the time the EA is running, I can refer to it. The only question is, how to do it? Because Ask is constantly changing, and I can't find the copying function.
make a global variable or just a variable
and insert this not in the start function, but in the init function
У меня такой вопрос к спецам - есть ли возможность сделать константой, первое полученное значение цены при запуске советника?
Т.е если я запустил советник и в это время цена Ask=1.4444 Я хочу эту цену сохранить как константу, чтобы всё время работы советника можно было к ней орбащаться. Только вот вопрос, как это сделать??? Ведь Ask постоянно меняеться, а функции копирования я нигде не нашёл.
A variation on the theme.
How exactly do you memorise tickets? And how do you understand: to refer to a ticket, you need to select an order, and to select it, you need to know the ticket...
https://docs.mql4.com/ru/trading/OrderSelect - see SELECT_BY_POS