
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Clarifying question: are the conditional indicator values needed for all candlesticks on the chart at any given time, or for a certain number of recent candlesticks?
Here is a piece of my working code. Never had a problem with closing (tweaked it a bit)
int i, total = OrdersTotal(), slippage = 50;
bool Ans;
for (i = total-1; i >=0; i--) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol()) {
if(OrderType()==OP_BUY) {
Print("CLOSE BUY");
Ans = false;
while(Ans==false) {
Ans = OrderClose(OrderTicket(),OrderLots(),Bid, slippage, DodgerBlue);
Sleep(1000);
RefreshRates();
}
}
if(OrderType() == OP_SELL) {
Print("CLOSE SALE");
Ans = false;
while(Ans==false) {
Ans = OrderClose(OrderTicket(),OrderLots(),Ask, slippage, Orange);
Sleep(1000);
RefreshRates();
}
}
}
}
Here's a piece of my working code. Never had a problem with closing (tweaked it a bit)
...
Thank you so much!!! I'll give it a try.
preferably for the latter, set by some kind of window.
I have it implemented like this:
This is a scheme for calculating one or more n indicator values based on copied m(GLOBAL_DATA_LIMIT) price values on each bar or tick.
If the past values of the calculated value window do not change, then in the calculation(inside) you can proceed as follows
-calculate only the new value(one);
-shift the calculated value window (array with results) to the left by 1 index;
-write a new value in the last index of the results array.
I do not know if it is clear. The code is in MQL5, I don't know 4, but it should be similar I guess.
...
Admins, absolute power leads to dictatorship. Even our politically correct timbo could not stand this marasmus and went somewhere :)
There must be an opposition that at least sometimes puts everything in its place, but here it is unclear who seriously defines sections of mathematics, while they cannot close the order without the help of schoolchildren. What will happen tomorrow?
You are presented for another ban.
Thank you for the thread. Please do ask if there is anything you need.
To keep the thread alive:)
On Monday at 11:15 am Moscow time, without any analysis, I opened pairs observed in MT5 (I should get used to it).
I didn't open EURUSD and GBPUSD because they were flat. I'll just hold it till Friday, though, I should properly look and possibly correct it every day.
If somebody is interested, you may watch it.
Login: 729566