Profit factor:
0.43
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself
Indicators Used
Commodity channel indexMoving average indicator
Miscellaneous
It issuies visual alerts to the screen
6 Views
0 Downloads
0 Favorites
CCI ver2.3
extern int shortcciperiod=7;
extern int longcciperiod=30;
extern int shortmaperiod=2;
extern int longmaperiod=55;
extern int stoploss=90;
extern int takeprofit=30;
extern int lots=1;


bool notrades;
int tradeconditions;
int trend;
bool enabletrading;
double vol;
int startingbalance;



int magicnumber=1234;


int init() {

startingbalance = AccountBalance() / lots;

tradeconditions = 1;

double shortcci=iCCI(Symbol(),0,shortcciperiod,PRICE_OPEN,0);
double longcci=iCCI(Symbol(),0,longcciperiod,PRICE_OPEN,0);

if (shortcci > 0 && longcci > 0) trend=1;
if (shortcci < 0 && longcci < 0) trend=-1;

int allexpertorders=0;
for (int alltheorders=OrdersTotal(); alltheorders >= 0; alltheorders--) {
   OrderSelect(alltheorders,SELECT_BY_POS,MODE_TRADES);
   if (OrderSymbol()==Symbol() && OrderMagicNumber()==magicnumber) allexpertorders++;
   }
   
if (allexpertorders==0) enabletrading=true;
if (allexpertorders > 0) {enabletrading=false; Alert("There are orders from this expert opened...");}

return(0);

}



int start() {

if (enabletrading) {


RefreshRates();

vol = NormalizeDouble(AccountBalance() / startingbalance, 2);


double shortcci=iCCI(Symbol(),0,shortcciperiod,PRICE_OPEN,0);
double longcci=iCCI(Symbol(),0,longcciperiod,PRICE_OPEN,0);
double shortema=iMA(Symbol(),0,shortmaperiod,0,MODE_EMA,PRICE_OPEN,0);
double longema=iMA(Symbol(),0,longmaperiod,0,MODE_EMA,PRICE_OPEN,0);
double emavalue=shortema-longema;

if (tradeconditions == 0) tradeconditions++;   


if (tradeconditions > 0) {
   if (shortcci > 0 && longcci > 0 && emavalue > 0) {
      OrderSend(Symbol(),OP_BUY,vol,Ask,1,Ask-stoploss*Point,Ask+takeprofit*Point,NULL,magicnumber,0,Blue);
      tradeconditions=-1;
      trend=1;
      Alert(trend);
      }
   if (shortcci < 0 && longcci < 0 && emavalue < 0) {
      OrderSend(Symbol(),OP_SELL,vol,Bid,1,Bid+stoploss*Point,Bid-takeprofit*Point,NULL,magicnumber,0,Red);
      tradeconditions=-1;
      trend=-1;
      Alert(trend);
      }
   }
if (tradeconditions < 0) {
   if (trend > 0) {
      if (shortcci < 0 && longcci < 0) {
         for (int alltheorders2=OrdersTotal(); alltheorders2 >= 0; alltheorders2--) {
            OrderSelect(alltheorders2,SELECT_BY_POS,MODE_TRADES);
            if (OrderSymbol()==Symbol() && OrderMagicNumber()==magicnumber) OrderClose(OrderTicket(),OrderLots(),Bid,1,Blue);
            tradeconditions=1;
            }
         }
      }
   if (trend < 0) {
      if (shortcci > 0 && longcci > 0) {
         for (int alltheorders3=OrdersTotal(); alltheorders3 >= 0; alltheorders3--) {
            OrderSelect(alltheorders3,SELECT_BY_POS,MODE_TRADES);
            if (OrderSymbol()==Symbol() && OrderMagicNumber()==magicnumber) OrderClose(OrderTicket(),OrderLots(),Ask,1,Red);
            tradeconditions=1;
            }
         }
      }
   
   }




}



}
int deinit() {
return(0);
}




Profitability Reports

GBP/USD Jul 2025 - Sep 2025
0.38
Total Trades 170
Won Trades 91
Lost trades 79
Win Rate 53.53 %
Expected payoff -20.90
Gross Profit 2202.60
Gross Loss -5756.06
Total Net Profit -3553.46
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.21
Total Trades 184
Won Trades 70
Lost trades 114
Win Rate 38.04 %
Expected payoff -22.45
Gross Profit 1076.36
Gross Loss -5207.34
Total Net Profit -4130.98
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.67
Total Trades 170
Won Trades 110
Lost trades 60
Win Rate 64.71 %
Expected payoff -8.68
Gross Profit 3046.50
Gross Loss -4522.12
Total Net Profit -1475.62
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.68
Total Trades 190
Won Trades 122
Lost trades 68
Win Rate 64.21 %
Expected payoff -8.36
Gross Profit 3422.10
Gross Loss -5009.68
Total Net Profit -1587.58
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.55
Total Trades 80
Won Trades 50
Lost trades 30
Win Rate 62.50 %
Expected payoff -10.19
Gross Profit 1000.73
Gross Loss -1816.03
Total Net Profit -815.30
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.23
Total Trades 108
Won Trades 43
Lost trades 65
Win Rate 39.81 %
Expected payoff -33.11
Gross Profit 1083.00
Gross Loss -4658.46
Total Net Profit -3575.46
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.68
Total Trades 106
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -9.21
Gross Profit 2049.60
Gross Loss -3025.49
Total Net Profit -975.89
-100%
-50%
0%
50%
100%

Comments