Orders Execution
Indicators Used
0
Views
0
Downloads
0
Favorites
Profitability Reports
GBP/USD
Oct 2024 - Jan 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%
NZD/USD
Oct 2024 - Jan 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%
CCI ver2
//+------------------------------------------------------------------+
//| CCI.mq4 |
//| not me |
//| |
//+------------------------------------------------------------------+
#property copyright "not me"
#property link ""
extern int longperiod; bool onswitch; int magic=1999;
extern int shortperiod; bool offswitch;
extern int takeprofit; extern int stoploss;
extern int longema;
extern int shortema;
bool upswitch;
bool upswitch2;
bool downswitch;
bool downswitch2;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
offswitch=true;
onswitch=false;
double ccilong=iCCI(Symbol(),0,longperiod,PRICE_OPEN,0);
double ccishort=iCCI(Symbol(),0,shortperiod,PRICE_OPEN,0);
if (ccishort > 0 && ccilong > 0) {
upswitch=true; downswitch=false;
}
if (ccishort < 0 && ccilong < 0) {
downswitch=true; upswitch=false;
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
RefreshRates();
double ccilong=iCCI(Symbol(),0,longperiod,PRICE_OPEN,0);
double ccishort=iCCI(Symbol(),0,shortperiod,PRICE_OPEN,0);
double ema1=iMA(Symbol(),0,shortema,0,MODE_EMA,PRICE_OPEN,0);
double ema2=iMA(Symbol(),0,longema,0,MODE_EMA,PRICE_OPEN,0);
double emas = ema1 - ema2;
if (offswitch) {
if (ccishort > 0 && ccilong > 0 && downswitch && emas > 0) {
OrderSend(Symbol(),OP_BUY,1,Ask,1,Ask - stoploss*Point,Bid + takeprofit*Point,NULL,magic,0,Blue);
offswitch=false; onswitch=true; upswitch=true; downswitch=false; upswitch2=true; downswitch2=false;
}
if (ccishort < 0 && ccilong < 0 && upswitch && emas < 0) {
OrderSend(Symbol(),OP_SELL,1,Bid,1,Bid + stoploss*Point, Ask - takeprofit*Point,NULL,magic,0,Blue);
offswitch=false; onswitch=true; downswitch=true; upswitch=false; downswitch2=true; upswitch2=false;
}
}
if (onswitch) {
int orderstotal=0;
int allorders;
for(allorders=OrdersTotal();allorders>0;allorders--) {
OrderSelect(allorders,SELECT_BY_POS);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == magic) orderstotal++;
}
if (orderstotal == 0) {
onswitch=false; offswitch=true;
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---