SMC Trader Camel CCI MACD1

Profit factor:
0.62
Orders Execution
Checks for the total of open ordersIt can change open orders parameters, due to possible stepping strategyIt Closes Orders by itself It automatically opens orders when conditions are reached
Indicators Used
Moving average indicatorMACD HistogramCommodity channel index
Miscellaneous
It plays sound alertsIt issuies visual alerts to the screen
8 Views
0 Downloads
0 Favorites
SMC Trader Camel CCI MACD1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                         Steve Cartwright Trader Camel CCI MACD.mq4 |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+

 extern double TakeProfit = 50;
 extern double Lots = 1;
 extern double InitialStop = 10;
 extern double TrailingStop = 10;
 
 int cnt,total,ticket,MinDist;
 int SigPos;
 double MACDSP1, MACDSP2;
 double MACDHP1, MACDHP2;
 double CCIP1;
 double MASP1, MASP2;
 double CAMELHIGHP1, CAMELHIGHP2, CAMELLOWP1, CAMELLOWP2;
 

//#####################################################################
int init()
{
//----
GlobalVariableSet("CCI_Flag",0);
GlobalVariableSet("MACD_Flag",0);
GlobalVariableSet("MAX_Flag",0);

 
//----
   return(0);
  }
//#####################################################################

int start()
  {

   int Flag;
   
   double Spread;
   double ATR;
   double StopMA;
   int cnt, tmp;
   double SetupHigh, SetupLow;
//############################################################################
  if(Bars<100){
     Print("bars less than 100");
     return(0);  
  }
  if(TakeProfit<10){
     Print("TakeProfit less than 10");
     return(0);  // check TakeProfit
  }
//#########################################################################################
//~~~~~~~~~~~~~~~~Indicator Setup~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//MASP1=iMA(NULL,0,3,0,MODE_SMA,PRICE_CLOSE,1);
//MASP2=iMA(NULL,0,3,0,MODE_SMA,PRICE_CLOSE,2);

CAMELHIGHP1=iMA(NULL,0,34,0,MODE_EMA,PRICE_HIGH,1);
CAMELLOWP1=iMA(NULL,0,34,0,MODE_EMA,PRICE_LOW,1);


MACDSP1=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);
MACDSP2=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,2);

MACDHP1=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);
MACDHP2=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,2);

CCIP1=iCCI(NULL,0,20,PRICE_CLOSE,1);
//~~~~~~~~~~~~~~~~~~~~~Timer Signal~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if(0==0)
{
if(Minute() ==0  && Seconds()==0) PlaySound("alert.vav");
}

//~~~~~~~~~~~~~~~~Indicator Signal calcs~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//ADD in a reset routine  what conditions will reset values to zero??

//if(GlobalVariableGet("MAX_Flag")==0
//   && MASP2 < CAMELHIGHP2
//   && MASP1 > CAMELHIGHP1)
//  {GlobalVariableSet("MAX_Flag",1);}  // Flag 1 = LONG 2 = SHORT

//if(GlobalVariableGet("CCI_Flag")==0
//   && CCIP1 >100)
//   {GlobalVariableSet("CCI_Flag",1);}  

//~~~~~~~~~~~~~~~~Miscellaneous setup stuff~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//TrailingStop=iATR(NULL,0,10,0)*2; // BE CAREFUL OF EFFECTING THE AUTO TRAIL STOPS
 //StopMA=iMA(NULL,0,24,0,MODE_SMA,PRICE_CLOSE,1);
 MinDist=MarketInfo(Symbol(),MODE_STOPLEVEL);
 Spread=(Ask-Bid);
//#########################################################################################
//ALWAYS TRY TO COME OUT WITH A PROFIT:  ????????
 if(0==1)
 {
 total=OrdersTotal();
 if (total>0)
  {
  for(cnt=0;cnt<total;cnt++)
   {  
//LONG
     OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
     if(OrderType()==OP_BUY && OrderSymbol()==Symbol())
      {
       if(OrderStopLoss() < OrderOpenPrice())
      {
       if (OrderStopLoss() < Bid -(Point*(MinDist*2)))
       {
        OrderModify(OrderTicket(),OrderOpenPrice(),Bid -(Point*(2*MinDist)),OrderTakeProfit(),0,Lime);
        }}}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// SHORT
     OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
     if(OrderType()==OP_SELL && OrderSymbol()==Symbol())
      {
       if(OrderStopLoss() > OrderOpenPrice())
        {
         if (OrderStopLoss() > Ask + (Point*(MinDist*2)))
        {
         OrderModify(OrderTicket(),OrderOpenPrice(),Ask+(Point*(MinDist*2)),OrderTakeProfit(),0,Lime);
        }}}
    }}
//########################################################################################
//##################     ORDER CLOSURE  ###################################################
// If Orders are in force then check for closure against Technicals LONG & SHORT
//CLOSE LONG Entries
  total=OrdersTotal();
  if(total>0)
   { 
   for(cnt=0;cnt<total;cnt++)
    {
     OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()==OP_BUY && OrderSymbol()==Symbol())
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//##   LONG Closure Rules   ###
 {
  if(MACDHP1 < MACDSP1 || CCIP1 < 100)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   {                                 
    OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close LONG position
    }}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//CLOSE SHORT ENTRIES: 
     OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); 
      if(OrderType()==OP_SELL && OrderSymbol()==Symbol()) // check for symbol
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//##  SHORT Closure Rules  ##
 {
  if(MACDHP1 > MACDSP1)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   {   
    OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close SHORT position
     }}
  }  // for loop return
 }   // close 1st if 
//##############################################################################
//##################     ORDER TRAILING STOP Adjustment  #######################
//TRAILING STOP: LONG
if(0==1)
{
  total=OrdersTotal();
  if(total>0)
   { 
   for(cnt=0;cnt<total;cnt++)
    {
     OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
     if(OrderType()==OP_BUY && OrderSymbol()==Symbol())
      {
       if(TrailingStop>0)  
        {                 
         if(Bid-OrderOpenPrice()>Point*TrailingStop)
          {
           if(OrderStopLoss()<Bid-Point*TrailingStop)
            {
             OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,White);
             return(0);
 }}}}}}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//TRAILING STOP: SHORT
  total=OrdersTotal();
  if(total>0)
   { 
   for(cnt=0;cnt<total;cnt++)
    {
     OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
     if(OrderType()==OP_SELL && OrderSymbol()==Symbol())
      {
       if(TrailingStop>0)  
        {                 
         if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
          {
           if(OrderStopLoss()>Ask+(Point*TrailingStop)) 
            {
             OrderModify(OrderTicket(),OrderOpenPrice(),Ask+(Point*TrailingStop),OrderTakeProfit(),0,Yellow);
             return(0);
 }}}}}}
}  // end bracket for on/off switch
//##########################################################################################
//~~~~~~~~~~~ END OF ORDER Closure routines & Stoploss changes  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//##########################################################################################
//~~~~~~~~~~~~START of NEW ORDERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//#########################  NEW POSITIONS ?  ######################################
//Possibly add in timer to stop multiple entries within Period
// Check Margin available
// ONLY ONE ORDER per SYMBOL
// Loop around orders to check symbol doesn't appear more than once
// Check for elapsed time from last entry to stop multiple entries on same bar
if (0==0) // switch to turn ON/OFF history check
{  
  total=HistoryTotal();
  if(total>0)
   { 
    for(cnt=0;cnt<total;cnt++)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_HISTORY);
       if(OrderSymbol()==Symbol()
       && CurTime()- OrderCloseTime() < (Period() * 60 )
       )
        {
        return(0);
 }}}}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 total=OrdersTotal();
  if(total>0)
   { 
    for(cnt=0;cnt<total;cnt++)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
       if(OrderSymbol()==Symbol()) return(0);
   }
   }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   if(AccountFreeMargin()<(1000*Lots))
   {Print("We have no money. Free Margin = ", AccountFreeMargin());
    return(0);}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//#########################################################################################
//ENTRY RULES: LONG 
if(0==0)
{
 if(CCIP1 > 100 
    &&
    MACDHP1 > 0
    &&
    MACDHP1 > MACDSP1
    &&
    Close[1] > CAMELHIGHP1
     )                                             //High[1] > High[2] && Low[1] > Low[2])
  {
   ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"Camel Long",16384,0,Orange); //Bid-(Point*(MinDist+2))
   //Alert("Order opened for: ",Symbol());
   if(ticket>0)
     {
      if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
        }
      else Print("Error opening BUY order : ",GetLastError()); 
      return(0); 
   }
   } 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//ENTRY RULES: SHORT                                     //################################
 if(0==0)
  {
   if(
    CCIP1 < -100 
    &&
    MACDHP1 < 0
    &&
    MACDHP1 < MACDSP1
    &&
    Close[1] < CAMELLOWP1)                        //Low[1] < Low[2] && High[1] < High[2])
  {
   ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"SMC Camel Short",16384,0,Red);
   Alert("Order opened for: ",Symbol());
   if(ticket>0)
     {
      if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
        }
      else Print("Error opening SELL order : ",GetLastError()); 
      return(0); 
   }}

//####################################################################################
//############               End of PROGRAM                  #########################   
   return(0);
}

Profitability Reports

USD/JPY Jan 2025 - Jul 2025
1.22
Total Trades 201
Won Trades 86
Lost trades 115
Win Rate 42.79 %
Expected payoff 21.77
Gross Profit 23954.98
Gross Loss -19579.38
Total Net Profit 4375.60
-100%
-50%
0%
50%
100%
EUR/USD Jan 2025 - Jul 2025
1.13
Total Trades 194
Won Trades 72
Lost trades 122
Win Rate 37.11 %
Expected payoff 13.64
Gross Profit 23158.00
Gross Loss -20512.00
Total Net Profit 2646.00
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
1.03
Total Trades 198
Won Trades 64
Lost trades 134
Win Rate 32.32 %
Expected payoff 2.77
Gross Profit 22284.74
Gross Loss -21736.93
Total Net Profit 547.81
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
1.02
Total Trades 94
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff 1.01
Gross Profit 5671.00
Gross Loss -5576.00
Total Net Profit 95.00
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
0.88
Total Trades 201
Won Trades 69
Lost trades 132
Win Rate 34.33 %
Expected payoff -9.54
Gross Profit 14602.55
Gross Loss -16519.87
Total Net Profit -1917.32
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.86
Total Trades 104
Won Trades 33
Lost trades 71
Win Rate 31.73 %
Expected payoff -14.59
Gross Profit 9595.00
Gross Loss -11112.00
Total Net Profit -1517.00
-100%
-50%
0%
50%
100%
GBP/USD Jan 2025 - Jul 2025
0.86
Total Trades 200
Won Trades 67
Lost trades 133
Win Rate 33.50 %
Expected payoff -19.09
Gross Profit 23240.00
Gross Loss -27058.00
Total Net Profit -3818.00
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.82
Total Trades 89
Won Trades 26
Lost trades 63
Win Rate 29.21 %
Expected payoff -11.10
Gross Profit 4615.00
Gross Loss -5603.00
Total Net Profit -988.00
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.79
Total Trades 85
Won Trades 30
Lost trades 55
Win Rate 35.29 %
Expected payoff -22.50
Gross Profit 7122.65
Gross Loss -9035.36
Total Net Profit -1912.71
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.76
Total Trades 174
Won Trades 51
Lost trades 123
Win Rate 29.31 %
Expected payoff -11.24
Gross Profit 6293.00
Gross Loss -8248.00
Total Net Profit -1955.00
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.73
Total Trades 201
Won Trades 60
Lost trades 141
Win Rate 29.85 %
Expected payoff -22.35
Gross Profit 11862.00
Gross Loss -16354.00
Total Net Profit -4492.00
-100%
-50%
0%
50%
100%
AUD/USD Jan 2025 - Jul 2025
0.72
Total Trades 221
Won Trades 75
Lost trades 146
Win Rate 33.94 %
Expected payoff -21.91
Gross Profit 12537.00
Gross Loss -17379.00
Total Net Profit -4842.00
-100%
-50%
0%
50%
100%
GBP/AUD Jan 2025 - Jul 2025
0.72
Total Trades 212
Won Trades 70
Lost trades 142
Win Rate 33.02 %
Expected payoff -37.90
Gross Profit 20671.13
Gross Loss -28706.80
Total Net Profit -8035.67
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.67
Total Trades 91
Won Trades 28
Lost trades 63
Win Rate 30.77 %
Expected payoff -29.31
Gross Profit 5494.00
Gross Loss -8161.00
Total Net Profit -2667.00
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.67
Total Trades 193
Won Trades 50
Lost trades 143
Win Rate 25.91 %
Expected payoff -25.74
Gross Profit 10008.12
Gross Loss -14976.65
Total Net Profit -4968.53
-100%
-50%
0%
50%
100%
GBP/CAD Jan 2025 - Jul 2025
0.66
Total Trades 193
Won Trades 53
Lost trades 140
Win Rate 27.46 %
Expected payoff -46.81
Gross Profit 17240.43
Gross Loss -26275.13
Total Net Profit -9034.70
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.55
Total Trades 97
Won Trades 30
Lost trades 67
Win Rate 30.93 %
Expected payoff -39.56
Gross Profit 4700.00
Gross Loss -8537.00
Total Net Profit -3837.00
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.53
Total Trades 186
Won Trades 41
Lost trades 145
Win Rate 22.04 %
Expected payoff -21.65
Gross Profit 4472.62
Gross Loss -8499.55
Total Net Profit -4026.93
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.52
Total Trades 103
Won Trades 24
Lost trades 79
Win Rate 23.30 %
Expected payoff -30.54
Gross Profit 3357.38
Gross Loss -6503.03
Total Net Profit -3145.65
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
0.50
Total Trades 194
Won Trades 51
Lost trades 143
Win Rate 26.29 %
Expected payoff -47.60
Gross Profit 9226.00
Gross Loss -18460.00
Total Net Profit -9234.00
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.47
Total Trades 104
Won Trades 26
Lost trades 78
Win Rate 25.00 %
Expected payoff -57.43
Gross Profit 5366.04
Gross Loss -11339.27
Total Net Profit -5973.23
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.45
Total Trades 99
Won Trades 23
Lost trades 76
Win Rate 23.23 %
Expected payoff -54.67
Gross Profit 4407.49
Gross Loss -9819.37
Total Net Profit -5411.88
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.41
Total Trades 127
Won Trades 24
Lost trades 103
Win Rate 18.90 %
Expected payoff -71.54
Gross Profit 6325.41
Gross Loss -15411.07
Total Net Profit -9085.66
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.39
Total Trades 89
Won Trades 21
Lost trades 68
Win Rate 23.60 %
Expected payoff -86.28
Gross Profit 4927.78
Gross Loss -12606.40
Total Net Profit -7678.62
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.38
Total Trades 118
Won Trades 32
Lost trades 86
Win Rate 27.12 %
Expected payoff -45.74
Gross Profit 3374.62
Gross Loss -8771.93
Total Net Profit -5397.31
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.20
Total Trades 80
Won Trades 11
Lost trades 69
Win Rate 13.75 %
Expected payoff -112.78
Gross Profit 2225.12
Gross Loss -11247.66
Total Net Profit -9022.54
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.18
Total Trades 84
Won Trades 13
Lost trades 71
Win Rate 15.48 %
Expected payoff -107.18
Gross Profit 1917.00
Gross Loss -10920.00
Total Net Profit -9003.00
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.00
Total Trades 9
Won Trades 1
Lost trades 8
Win Rate 11.11 %
Expected payoff -117106.33
Gross Profit 327.00
Gross Loss -1054284.00
Total Net Profit -1053957.00
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.00
Total Trades 19
Won Trades 5
Lost trades 14
Win Rate 26.32 %
Expected payoff -55484.26
Gross Profit 882.00
Gross Loss -1055083.00
Total Net Profit -1054201.00
-100%
-50%
0%
50%
100%

Comments