Hi guys, I'm seriously getting into programming but I have a lot more to learn.
I'm currently trying to implement into an EA a consecutive loss count / win count under the following condition:
here is where I got so far, counts properly the loss and wins, but I can't figure how to make it start over when Max_Count is reached:
Thanks !
I'm currently trying to implement into an EA a consecutive loss count / win count under the following condition:
Inserted Code
//----------------------------------------------------- extern int = Max_Count; // User defines the maximum Loss/Win Count to start over from 0 //-----------------------------------------------------
Inserted Code
int LossCount = 0, WinCount = 0; for (int i = 0; i < OrdersHistoryTotal(); i++) { if (!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue; if (OrderMagicNumber() == MagicNumber && OrderSymbol() == Symbol() && OrderProfit()<0) {LossCount++; WinCount=0;} if (OrderMagicNumber() == MagicNumber && OrderSymbol() == Symbol() && OrderProfit()>0) {LossCount=0; WinCount++;} } //-----------------------------------------------------
You'll always miss 100% of the shots you don't take.