[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 66
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
Well, yes... Then how come I can't assign values to an array? I mean, I've already printed everything I can...
Order bookings...
I gave an example of a function using a dynamic array (p.64).
dim=ArrayResize(Buy,Raz); - устанавливает размерность Raz для массива Buy. Только после этого можно что-то запомнить в элементе массива с номером Raz-1
Help to redo on bar close
Close positions at market price
//| Parameters:|
//| sy - instrument name (" - any symbol,|//|NULL - current symbol)|
//| op - operation(-1 - any position) |
//|mn - MagicNumber (-1 - any magik)|
//+----------------------------------------------------------------------------+
void ClosePositions(string sy="", int op=0, int mn=-1) {
if(last>=Time[0]) return; // if the bar time has already been checked then exit immediately, i.e.i.e. wait for the new bar
last=Time[0]; //
int i, k=OrdersTotal();
if (sy=="0") sy=Symbol();
for (i=k-1; i>=0; i--) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES) {
if ((OrderSymbol()==sy || sy=="") && (op<0 || OrderType()==op)) {
if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
if (mn<0 || OrderMagicNumber()==mn) ClosePosBySelect();
}
}
}
}
}
You don't have to rework someone else's functions - Kim has done them well. You just have to use them properly.
How do you know that the bar has already been closed before a new one opens? So, you need to call the function to close the order when the new bar starts to form. How to detect this moment has been shown many times: in the tutorial, in the FAQ and on the forum. Please read something.
Well, first of all, it's quite realistic to cram 6 gigs in ten minutes. You get one print with every tick, what for do you need it?
And secondly, are you sure it's changing?
Some sort of semaphore should be used to print once...
somewhere like this....thank you guys for the help, but i couldn't figure out what it needs. the loop hangs tight, spits on the conditions, "hangs" the computer and loads gigabytes of logs....
had to amputate!
replaced it with a series of ifs...and put the marks (flags) where needed... ...and it worked. The code just got longer and uglier...
goodbye while function. We'll never meet again!
:))))