Hello, can you tell me how to calculate the losing orders going in a row? And with a profitable one, the account would be reset to zero. I've invented something, but it's not enough...
int LossOrders() { int oldticket; ticket = 0;
for (i = OrdersHistoryTotal() - 1; i >= 0; i--) { if(OrderSelect (i, SELECT_BY_POS, MODE_HISTORY)) { if (OrderSymbol() == Symbol() && OrderMagicNumber() == magic) { oldticket = OrderTicket(); if (oldticket > ticket) { ticket = oldticket; if(OrderProfit()<0) { orderloss++; }else orderloss=0; } } } } return(orderloss); }
Foxonn: Hello, could you please tell me how to make timestart not static, but dynamic like this D'(timest) 07:00' ? timets = TimeToString(TimeCurrent(), TIME_DATE);
Hi all, I still haven't received a substantive answer, let me ask a different question,is there any way to pass the values of a variable from one if, to another?
Foxonn: Declare them globally, not in one condition. Make them global variables.
It didn't help =) why not, but this solution did not bring any results either In general, maybe someone knows how to bind an object to the pointer like when drawing a trend line?
Or alternatively is it possible to remove the indicator menu when running it? i.e. to have it as a script immediately on the chart, then the problem would be solved)
What function causes the indicator window in the strategy tester to open at the beginning. At the moment the indicator window appears after the visual test is completed.
In the strategy tester, does the indicator and the Expert Advisor use the same data file (prices)?
Yes
abeiks: What function to call the opening of the indicator window in the strategy tester at the beginning. At the moment, the indicator window appears after the end of visual testing.
The indicator window in visual mode does not appear at all, if the indicator is called through iCustom or included in a template. Only if it is manually added to the chart.
The indicator window in visual mode does not appear at all, if the indicator is called via iCustom or included in a template. Only if it is manually added to the chart.
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.
Hello, can you tell me how to calculate the losing orders going in a row? And with a profitable one, the account would be reset to zero. I've invented something, but it's not enough...
int LossOrders()
{
int oldticket;
ticket = 0;
for (i = OrdersHistoryTotal() - 1; i >= 0; i--)
{
if(OrderSelect (i, SELECT_BY_POS, MODE_HISTORY))
{
if (OrderSymbol() == Symbol() && OrderMagicNumber() == magic)
{
oldticket = OrderTicket();
if (oldticket > ticket)
{
ticket = oldticket;
if(OrderProfit()<0)
{
orderloss++;
}else orderloss=0;
}
}
}
}
return(orderloss);
}
Hello, could you please tell me how to make timestart not static, but dynamic like this D'(timest) 07:00' ?
timets = TimeToString(TimeCurrent(), TIME_DATE);
Like this
It's more or less like this
Hi all, I still haven't received a substantive answer, let me ask a different question,is there any way to pass the values of a variable from one if, to another?
Hi all, I still haven't received a substantive answer, I'll ask a different question,is there any way to pass variable values from one if, to another?
Declare them globally, not in one condition. Make them global variables.
It didn't help =) why not, but this solution did not bring any results either
In general, maybe someone knows how to bind an object to the pointer like when drawing a trend line?
Or alternatively is it possible to remove the indicator menu when running it? i.e. to have it as a script immediately on the chart, then the problem would be solved)
Afternoon.
In the strategy tester, does the indicator and expert use the same data file (prices)?
Good afternoon.
In the strategy tester, does the indicator and the Expert Advisor use the same data file (prices)?
Yes
What function to call the opening of the indicator window in the strategy tester at the beginning. At the moment, the indicator window appears after the end of visual testing.
The indicator window in visual mode does not appear at all, if the indicator is called through iCustom or included in a template. Only if it is manually added to the chart.
Yes
The indicator window in visual mode does not appear at all, if the indicator is called via iCustom or included in a template. Only if it is manually added to the chart.