printf("Total consecutive profitable orders: %d",OrdersTotalProfitable()); int OrdersTotalProfitable() { int count=0,total=OrdersHistoryTotal(); for(int i=total-1;i>=0;i--) if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) && OrderSymbol()==_Symbol) { if(OrderProfit()>0.0) count++; else break; } //--- return(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
I’m looking for a function that returns the number of consecutive profitable trades until X victories. When the number of profitable trades hits the X value, so the count is restarted.
If someone can help me... thx!!!