mtudersk:
If somebody know how to sumarize all opened long and short positions separately no mater pairs?
Thank You ind advance,
Mtudersk
It's extremely simple, just do a simple loop:
int ntrades=OrdersTotal(); if (ntrades!=0) { for (int i=ntrades-1;i>=0;i--) { if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==True) { if (OrderType()==OP_BUY) { //do stuff with Long orders } if (OrderType()==OP_SELL) { //do stuff with Short orders } } } }
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
If somebody know how to sumarize all opened long and short positions separately no mater pairs?
Thank You ind advance,
Mtudersk