| / | Forum |
|
rayves
2007.05.09 16:59
I've made a simple EA which works just fine when using it on a single pair and I've
been trying to figure out how to make it work with several pairs at the same time.
I just can't get it right :) if (OrdersTotal()==1) if (go_short==1) //Trail Short order and reverse if (in_short==true) |
|
Mathematics in Trading: How to Estimate Trade Results A certain level of mathematical background is required of any trader, and this statement needs no proof. The matter is only: How can we define this minimum required level? |
|
lalilo
2007.05.09 18:02
use this code to calculate total of orders to only current symbol
int ordTotal = 0; for(i = 0;i < OrdersTotal();i++) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); if(OrderSymbol() == Symbol()) ordTotal++; } use "ordTotal" instead or OrdersTotal() all over your EA. except if you are scanning all orders, like for trailing stop, then use OrdersTotal() and combine it with "OrderSymbol() == Symbol()", Also, for "if" statements, add "Symbol() == OrderSymbol()", for example in your code use "if (in_short==true && Symbol() == OrderSymbol())" instead of just "if (in_short==true)" you don't need sometimes but add it to make sure you are dealing with the right pair |