sorted!!!!!
int CountTrades2() { int Count=0; bool BuyNow=true; bool SellNow=true; for(int b=OrdersTotal()-1;b>=0;b--) { if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES)) if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber) { if(OrderType()==OP_BUY)BuyNow=true; else if(OrderType()==OP_SELL)SellNow=true; } } return(Count); }
int HedgeNow() { int Now=0; for(int o=0;o<OrdersTotal();o++) { if(OrderSelect(o,SELECT_BY_POS,MODE_TRADES)) if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber) { if(OrderType()==OP_BUY)BuyNow=0; else if(OrderType()==OP_SELL)BuyNow=0; } } return(Now); }
if(!HedgeNow()&&Ask-OrderOpenPrice()>5*Pips()) { //Buy }
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
I want to hedge my trades multiple times instead of once. For example If price opens at buy 1.12345 & sell at 1.12295, how do I hedge my trades at that price multiple times?