izmnaari:
my question is that can i attached at any moment openprice of all orders to an array and if it s possible what is the code to realize it.
You probably do not want ALL orders, only that EA's - so filter by magic number and pair.my question is that can i attached at any moment openprice of all orders to an array and if it s possible what is the code to realize it.
int count=0; double openPrices[]; for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair. ResizeBuffer(openPrices, count+1); openPrices[count] = OrderOpenPrice(); count++; }
WHRoeder:
You probably do not want ALL orders, only that EA's - so filter by magic number and pair.
You probably do not want ALL orders, only that EA's - so filter by magic number and pair.
thank you very much that s what i need
thank you
but i have change an expression in your code
int count=0; double openPrices[]; for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair. ArrayResize(openPrices, count+1); openPrices[count] = OrderOpenPrice(); count++;
}
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
hola
i hope that all member of the forum are ok.
my question is that can i attached at any moment openprice of all orders to an array and if it s possible what is the code to realize it.
ex:
price[10]={1.3560, 1.3600, ........}